pax_global_header00006660000000000000000000000064141550407760014523gustar00rootroot0000000000000052 comment=2e91c85fc95bc722e5a7141d7fa0acde4aab61aa rollup-2.61.1/000077500000000000000000000000001415504077600131275ustar00rootroot00000000000000rollup-2.61.1/.editorconfig000066400000000000000000000003201415504077600155770ustar00rootroot00000000000000# 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-2.61.1/.eslintrc.js000066400000000000000000000042141415504077600153670ustar00rootroot00000000000000module.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' ], ignorePatterns: [ 'node_modules/**/*.*', 'dist/**/*.*', '/test/**/*.*', '!/test/*.js', '!/test/*/*.js', '/test/node_modules/*.*', '!/test/*/samples/**/_config.js' ], overrides: [ { files: ['*.js'], rules: { '@typescript-eslint/explicit-module-boundary-types': 'off' } }, { files: ['*.js', 'cli/**/*.ts'], rules: { '@typescript-eslint/no-var-requires': 'off' } }, { env: { mocha: true }, files: ['test/**/*.js'], rules: { 'sort-keys': 'off' } } ], parser: '@typescript-eslint/parser', parserOptions: { ecmaVersion: 2018, sourceType: 'module' }, plugins: ['@typescript-eslint'], rules: { '@typescript-eslint/consistent-type-assertions': [ 'error', { assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' } ], '@typescript-eslint/consistent-type-definitions': ['error', 'interface'], '@typescript-eslint/member-ordering': [ 'error', { default: { memberTypes: require('@typescript-eslint/eslint-plugin/dist/rules/member-ordering') .defaultOrder, 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': 'off', 'dot-notation': 'error', 'import/no-unresolved': [ 'error', { ignore: ['package.json', 'is-reference', 'help.md', 'types'] } ], '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 }] } }; rollup-2.61.1/.gitattributes000066400000000000000000000000141415504077600160150ustar00rootroot00000000000000*.js eol=lf rollup-2.61.1/.github/000077500000000000000000000000001415504077600144675ustar00rootroot00000000000000rollup-2.61.1/.github/FUNDING.yml000066400000000000000000000000301415504077600162750ustar00rootroot00000000000000open_collective: rollup rollup-2.61.1/.github/ISSUE_TEMPLATE.md000066400000000000000000000012731415504077600171770ustar00rootroot00000000000000 rollup-2.61.1/.github/ISSUE_TEMPLATE/000077500000000000000000000000001415504077600166525ustar00rootroot00000000000000rollup-2.61.1/.github/ISSUE_TEMPLATE/SUPPORT.md000066400000000000000000000011221415504077600203440ustar00rootroot00000000000000--- 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-2.61.1/.github/ISSUE_TEMPLATE/bug.yaml000066400000000000000000000044101415504077600203120ustar00rootroot00000000000000name: 🐞 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 REPL.it reproduction template at https://repl.it/@rollup/rollup-repro (allows full use of all rollup options and plugins), or 3. Provide a minimal repository link (Read https://git.io/fNzHA 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-2.61.1/.github/ISSUE_TEMPLATE/docs.yaml000066400000000000000000000023011415504077600204620ustar00rootroot00000000000000name: 📚 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-2.61.1/.github/ISSUE_TEMPLATE/feature.yaml000066400000000000000000000016331415504077600211740ustar00rootroot00000000000000name: ✨ 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-2.61.1/.github/ISSUE_TEMPLATE/modification.yaml000066400000000000000000000022171415504077600222050ustar00rootroot00000000000000name: 🔧 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-2.61.1/.github/PULL_REQUEST_TEMPLATE.md000066400000000000000000000027741415504077600203020ustar00rootroot00000000000000 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-2.61.1/.github/labels.json000066400000000000000000000046421415504077600166320ustar00rootroot00000000000000[ { "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-2.61.1/.github/workflows/000077500000000000000000000000001415504077600165245ustar00rootroot00000000000000rollup-2.61.1/.github/workflows/repl-artefacts.yml000066400000000000000000000053131415504077600221650ustar00rootroot00000000000000name: Upload REPL artefacts on: pull_request_target: types: [synchronize, opened, reopened, labeled] jobs: upload: 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@v2 with: ref: refs/pull/${{ github.event.number }}/merge - name: Setup Node uses: actions/setup-node@v2 with: node-version: 14 - name: Install dependencies run: npm ci --ignore-scripts - name: Build artefacts 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: 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: 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: Find Comment uses: peter-evans/find-comment@v1 id: fc 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@v1 with: comment-id: ${{ steps.fc.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 }} ``` or load it into the REPL: https://rollupjs.org/repl/?pr=${{ github.event.number }} rollup-2.61.1/.github/workflows/tests.yml000066400000000000000000000044461415504077600204210ustar00rootroot00000000000000name: Tests on: push: branches: - master pull_request: types: [synchronize, opened, reopened] jobs: linux16: runs-on: ubuntu-latest name: Node 16 + Coverage (Linux) steps: - name: Checkout Commit uses: actions/checkout@v2 with: ref: ${{ github.event.pull_request.head.sha }} - name: Setup Node uses: actions/setup-node@v2 with: node-version: '16' - name: Install dependencies run: npm ci --ignore-scripts - name: Run tests with coverage run: npm run ci:coverage env: CI: true - uses: codecov/codecov-action@v1 with: commit_parent: ${{ github.event.pull_request.head.sha }} linux14: runs-on: ubuntu-latest name: Node 14 + Extra Tests (Linux) steps: - name: Checkout Commit uses: actions/checkout@v2 - name: Setup Node uses: actions/setup-node@v2 with: node-version: '14' - name: Install dependencies run: npm ci --ignore-scripts - name: Lint run: npm run ci:lint - name: Vulnerabilities run: npm run security - name: Run all tests run: npm run ci:test env: CI: true linux: runs-on: ubuntu-latest strategy: matrix: node: ['10', '12'] name: Node ${{ matrix.node }} (Linux) steps: - name: Checkout Commit uses: actions/checkout@v2 - name: Setup Node uses: actions/setup-node@v2 with: node-version: ${{ matrix.node }} - name: Install dependencies run: npm ci --ignore-scripts - name: Run tests run: npm run ci:test:only env: CI: true windows: runs-on: windows-2019 strategy: matrix: node: ['10', '16'] name: Node ${{ matrix.node }} (Windows) steps: - name: Configure git line-breaks run: git config --global core.autocrlf false - name: Checkout Commit uses: actions/checkout@v2 - name: Setup Node uses: actions/setup-node@v2 with: node-version: ${{ matrix.node }} - name: Install dependencies run: npm ci --ignore-scripts - name: Run tests run: npm run ci:test:only env: CI: true rollup-2.61.1/.gitignore000066400000000000000000000002561415504077600151220ustar00rootroot00000000000000.DS_Store /node_modules .gobble* dist _actual _actual.js coverage .commithash .idea .eslintcache test/_tmp test/hooks/tmp test/tmp test/typescript/typings perf/ .nyc_output/ rollup-2.61.1/.husky/000077500000000000000000000000001415504077600143505ustar00rootroot00000000000000rollup-2.61.1/.husky/pre-commit000077500000000000000000000000721415504077600163510ustar00rootroot00000000000000#!/bin/sh . "$(dirname "$0")/_/husky.sh" npx lint-staged rollup-2.61.1/.lintstagedrc.js000066400000000000000000000002621415504077600162260ustar00rootroot00000000000000module.exports = { '.ts': ['eslint --fix --cache'], '!(test/**/*).js': ['eslint --fix --cache'], '{test/*,test/*/*,test/*/samples/**/_config}.js': ['eslint --fix --cache'] }; rollup-2.61.1/.nycrc000066400000000000000000000000661415504077600142500ustar00rootroot00000000000000{ "exclude": ["test"], "extension": [".ts", ""] } rollup-2.61.1/.prettierignore000066400000000000000000000000271415504077600161710ustar00rootroot00000000000000cli/help.md LICENSE.md rollup-2.61.1/.prettierrc.json000066400000000000000000000003711415504077600162640ustar00rootroot00000000000000{ "arrowParens": "avoid", "printWidth": 100, "singleQuote": true, "trailingComma": "none", "useTabs": true, "overrides": [ { "files": "*.md", "options": { "useTabs": false, "tabWidth": 2, "proseWrap": "never" } } ] } rollup-2.61.1/.vscode/000077500000000000000000000000001415504077600144705ustar00rootroot00000000000000rollup-2.61.1/.vscode/launch.json000066400000000000000000000007101415504077600166330ustar00rootroot00000000000000{ "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-2.61.1/.vscode/settings.json000066400000000000000000000003501415504077600172210ustar00rootroot00000000000000{ "typescript.format.insertSpaceBeforeFunctionParenthesis": true, "typescript.format.insertSpaceAfterConstructor": true, "typescript.format.enable": true, "editor.codeActionsOnSave": { "source.fixAll.eslint": true } } rollup-2.61.1/CHANGELOG.md000066400000000000000000006703031415504077600147510ustar00rootroot00000000000000# rollup changelog ## 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-2.61.1/CODE_OF_CONDUCT.md000066400000000000000000000062041415504077600157300ustar00rootroot00000000000000# 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-2.61.1/CONTRIBUTING.md000066400000000000000000000114211415504077600153570ustar00rootroot00000000000000# 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_ series, [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github). ## 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-2.61.1/LICENSE-CORE.md000066400000000000000000000021571415504077600152660ustar00rootroot00000000000000The 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-2.61.1/LICENSE.md000066400000000000000000001053571415504077600145460ustar00rootroot00000000000000# 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: ## @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-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. --------------------------------------- ## 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. --------------------------------------- ## 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. --------------------------------------- ## 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. --------------------------------------- ## hash.js License: MIT By: Fedor Indutny Repository: git@github.com:indutny/hash.js --------------------------------------- ## inherits License: ISC Repository: git://github.com/isaacs/inherits > The ISC License > > Copyright (c) Isaac Z. Schlueter > > 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: Rich-Harris/locate-character --------------------------------------- ## 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. --------------------------------------- ## minimalistic-assert License: ISC Repository: https://github.com/calvinmetcalf/minimalistic-assert.git > Copyright 2015 Calvin Metcalf > > 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. --------------------------------------- ## 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 (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 (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. --------------------------------------- ## require-relative License: MIT By: Valerio Proietti Repository: git://github.com/kamicane/require-relative.git --------------------------------------- ## signal-exit License: ISC By: Ben Coe Repository: https://github.com/tapjs/signal-exit.git > The ISC License > > Copyright (c) 2015, 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. --------------------------------------- ## sourcemap-codec License: MIT By: Rich Harris Repository: https://github.com/Rich-Harris/sourcemap-codec > 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. --------------------------------------- ## 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-2.61.1/README.md000066400000000000000000000212031415504077600144040ustar00rootroot00000000000000

npm version install size code coverage backers sponsors license dependency status 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-reference) with an optional configuration file, or else through its [JavaScript API](https://rollupjs.org/guide/en/#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/). ### 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 ``` Or alternatively, for SystemJS with `-f system`: ``` rollup src/main.js src/main2.js -f system -d dist ``` Install SystemJS via ``` 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-2.61.1/docs/05-plugin-development.md000066400000000000000000002237011415504077600204460ustar00rootroot00000000000000--- title: Plugin Development --- ### Plugins Overview A Rollup plugin is an object with one or more of the [properties](guide/en/#properties), [build hooks](guide/en/#build-hooks), and [output generation hooks](guide/en/#output-generation-hooks) described below, and which follows our [conventions](guide/en/#conventions). A plugin should be distributed as a package which exports a function that can be called with plugin specific options and returns such an object. Plugins allow you to customise Rollup's behaviour by, for example, transpiling code before bundling, or finding third-party modules in your `node_modules` folder. For an example on how to use them, see [Using plugins](guide/en/#using-plugins). A List of Plugins may be found at [github.com/rollup/awesome](https://github.com/rollup/awesome). If you would like to make a suggestion for a plugin, please submit a Pull Request. ### A Simple Example The following plugin will intercept any imports of `virtual-module` without accessing the file system. This is for instance necessary if you want to use Rollup in a browser. It can even be used to replace entry points as shown in the example. ```js // rollup-plugin-my-example.js export default function myExample () { return { name: 'my-example', // this name will show up in warnings and errors resolveId ( source ) { if (source === 'virtual-module') { return source; // this signals that rollup should not ask other plugins or check the file system to find this id } return null; // other ids should be handled as usually }, load ( id ) { if (id === 'virtual-module') { return 'export default "This is virtual!"'; // the source code for "virtual-module" } return null; // other ids should be handled as usually } }; } // rollup.config.js import myExample from './rollup-plugin-my-example.js'; export default ({ input: 'virtual-module', // resolved by our plugin plugins: [myExample()], output: [{ file: 'bundle.js', format: 'es' }] }); ``` ### Conventions - Plugins should have a clear name with `rollup-plugin-` prefix. - Include `rollup-plugin` keyword in `package.json`. - Plugins should be tested. We recommend [mocha](https://github.com/mochajs/mocha) or [ava](https://github.com/avajs/ava) which support promises out of the box. - Use asynchronous methods when it is possible. - Document your plugin in English. - Make sure your plugin outputs correct source mappings if appropriate. - If your plugin uses 'virtual modules' (e.g. for helper functions), prefix the module ID with `\0`. This prevents other plugins from trying to process it. ### Properties #### `name` **Type:** `string` The name of the plugin, for use in error messages and warnings. ### Build Hooks To interact with the build process, your plugin object includes 'hooks'. Hooks are functions which are called at various stages of the build. Hooks can affect how a build is run, provide information about a build, or modify a build once complete. There are different kinds of hooks: - `async`: The hook may also return a promise resolving to the same type of value; otherwise, the hook is marked as `sync`. - `first`: If several plugins implement this hook, the hooks are run sequentially until a hook returns a value other than `null` or `undefined`. - `sequential`: If several plugins implement this hook, all of them will be run in the specified plugin order. If a hook is async, subsequent hooks of this kind will wait until the current hook is resolved. - `parallel`: If several plugins implement this hook, all of them will be run in the specified plugin order. If a hook is async, subsequent hooks of this kind will be run in parallel and not wait for the current hook. Build hooks are run during the build phase, which is triggered by `rollup.rollup(inputOptions)`. They are mainly concerned with locating, providing and transforming input files before they are processed by Rollup. The first hook of the build phase is [`options`](guide/en/#options), the last one is always [`buildEnd`](guide/en/#buildend). If there is a build error, [`closeBundle`](guide/en/#closebundle) will be called after that. Additionally, in watch mode the [`watchChange`](guide/en/#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`](guide/en/#closewatcher) hook will be triggered. See [Output Generation Hooks](guide/en/#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 Hook:** [`moduleParsed`](guide/en/#moduleparsed), [`resolveId`](guide/en/#resolveid) or [`resolveDynamicImport`](guide/en/#resolvedynamicimport).
**Next Hook:** [`outputOptions`](guide/en/#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 Hook:** [`options`](guide/en/#options)
**Next Hook:** [`resolveId`](guide/en/#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`](guide/en/#options) hooks into account and also contains the right default values for unset options. #### `closeWatcher` **Type:** `() => void`
**Kind:** `sync, sequential`
**Previous/Next Hook:** 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`](guide/en/#watchchange) events will be triggered ever. Notifies a plugin when watcher process closes and all open resources should be closed too. This hook cannot be used by output plugins. #### `load` **Type:** `(id: string) => string | null | {code: string, map?: string | SourceMap, ast? : ESTree.Program, moduleSideEffects?: boolean | "no-treeshake" | null, syntheticNamedExports?: boolean | string | null, meta?: {[plugin: string]: any} | null}`
**Kind:** `async, first`
**Previous Hook:** [`resolveId`](guide/en/#resolveid) or [`resolveDynamicImport`](guide/en/#resolvedynamicimport) where the loaded id was resolved. Additionally, this hook can be triggered at any time from plugin hooks by calling [`this.load`](guide/en/#thisload) to preload the module corresponding to an id.
**Next Hook:** [`transform`](guide/en/#transform) to transform the loaded file. 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` option, or eventually default to `true`. The `transform` hook can override this. See [synthetic named exports](guide/en/#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](guide/en/#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`](guide/en/#thisgetmoduleinfo) to find out the previous values of `moduleSideEffects`, `syntheticNamedExports` and `meta` inside this hook. #### `moduleParsed` **Type:** `(moduleInfo: ModuleInfo) => void`
**Kind:** `async, parallel`
**Previous Hook:** [`transform`](guide/en/#transform) where the currently handled file was transformed.
NextHook: [`resolveId`](guide/en/#resolveid) and [`resolveDynamicImport`](guide/en/#resolvedynamicimport) to resolve all discovered static and dynamic imports in parallel if present, otherwise [`buildEnd`](guide/en/#buildend). This hook is called each time a module has been fully parsed by Rollup. See [`this.getModuleInfo`](guide/en/#thisgetmoduleinfo) for what information is passed to this hook. In contrast to the [`transform`](guide/en/#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` and `moduleInfo.dynamicallyImportedIds` 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`](guide/en/#buildend) hook. #### `options` **Type:** `(options: InputOptions) => InputOptions | null`
**Kind:** `async, sequential`
**Previous Hook:** This is the first hook of the build phase.
**Next Hook:** [`buildStart`](guide/en/#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`](guide/en/#buildstart) hook as that hook has access to the options after the transformations from all `options` hooks have been taken into account. This is the only hook that does not have access to most [plugin context](guide/en/#plugin-context) utility functions as it is run before rollup is fully configured. #### `resolveDynamicImport` **Type:** `(specifier: string | ESTree.Node, importer: string) => string | false | null | {id: string, external?: boolean}`
**Kind:** `async, first`
**Previous Hook:** [`moduleParsed`](guide/en/#moduleparsed) for the importing file.
**Next Hook:** [`load`](guide/en/#load) if the hook resolved with an id that has not yet been loaded, [`resolveId`](guide/en/#resolveid) if the dynamic import contains a string and was not resolved by the hook, otherwise [`buildEnd`](guide/en/#buildend). 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`](guide/en/#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. 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)`](guide/en/#thisresolve) on the plugin context. #### `resolveId` **Type:** `(source: string, importer: string | undefined, options: {isEntry: boolean, custom?: {[plugin: string]: any}) => string | false | null | {id: string, external?: boolean | "relative" | "absolute", moduleSideEffects?: boolean | "no-treeshake" | null, syntheticNamedExports?: boolean | string | null, meta?: {[plugin: string]: any} | null}`
**Kind:** `async, first`
**Previous Hook:** [`buildStart`](guide/en/#buildstart) if we are resolving an entry point, [`moduleParsed`](guide/en/#moduleparsed) if we are resolving an import, or as fallback for [`resolveDynamicImport`](guide/en/#resolvedynamicimport). Additionally, this hook can be triggered during the build phase from plugin hooks by calling [`this.emitFile`](guide/en/#thisemitfile) to emit an entry point or at any time by calling [`this.resolve`](guide/en/#thisresolve) to manually resolve an id.
**Next Hook:** [`load`](guide/en/#load) if the resolved id that has not yet been loaded, otherwise [`buildEnd`](guide/en/#buildend). 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`](guide/en/#thisemitfile) 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`](guide/en/#thisresolve) context function. You can use this for instance as a mechanism to define custom proxy modules for entry points. The following plugin will only expose the default export from entry points while still keeping named exports available for internal usage: ```js function onlyDefaultForEntriesPlugin() { return { name: 'only-default-for-entries', async resolveId(source, importer, options) { if (options.isEntry) { // We need to skip this plugin to avoid an infinite loop const resolution = await this.resolve(source, importer, { skipSelf: true, ...options }); // If it cannot be resolved, return `null` so that Rollup displays an error if (!resolution) return null; return `${resolution.id}?entry-proxy`; } return null; }, load(id) { if (id.endsWith('?entry-proxy')) { const importee = id.slice(0, -'?entry-proxy'.length); // Note that this will throw if there is no default export return `export {default} from '${importee}';`; } return null; } }; } ``` 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`](guide/en/#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` option or default to `true`. The `load` and `transform` hooks can override this. See [synthetic named exports](guide/en/#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](guide/en/#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`, `moduleSideEffects`, `syntheticNamedExports` or `meta` can only be set once before the module is loaded. The reason is that after this call, Rollup will continue with the [`load`](guide/en/#load) and [`transform`](guide/en/#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`](guide/en/#thisresolve), 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](guide/en/#custom-resolver-options). #### `transform` **Type:** `(code: string, id: string) => string | null | {code?: string, map?: string | SourceMap, ast? : ESTree.Program, moduleSideEffects?: boolean | "no-treeshake" | null, syntheticNamedExports?: boolean | string | null, meta?: {[plugin: string]: any} | null}`
**Kind:** `async, sequential`
**Previous Hook:** [`load`](guide/en/#load) where the currently handled file was loaded.
NextHook: [`moduleParsed`](guide/en/#moduleparsed) once the file has been processed and parsed. 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, 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. 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` option, or eventually default to `true`. See [synthetic named exports](guide/en/#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` option, or eventually default to `false`. See [custom module meta-data](guide/en/#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`](guide/en/#thisgetmoduleinfo) to find out the previous values of `moduleSideEffects`, `syntheticNamedExports` and `meta` inside this hook. #### `watchChange` **Type:** `watchChange: (id: string, change: {event: 'create' | 'update' | 'delete'}) => void`
**Kind:** `sync, sequential`
**Previous/Next Hook:** 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`](guide/en/#options). Notifies a plugin whenever rollup has detected a change to a monitored file in `--watch` mode. This hook cannot be used by output plugins. Second argument contains additional details of 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](guide/en/#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`](guide/en/#outputoptions), the last one is either [`generateBundle`](guide/en/#generatebundle) if the output was successfully generated via `bundle.generate(...)`, [`writeBundle`](guide/en/#writebundle) if the output was successfully generated via `bundle.write(...)`, or [`renderError`](guide/en/#rendererror) if an error occurred at any time during the output generation. Additionally, [`closeBundle`](guide/en/#closebundle) can be called as the very last hook, but it is the responsibility of the User to manually call [`bundle.close()`](guide/en/#rolluprollup) to trigger this. The CLI will always make sure this is the case. #### `augmentChunkHash` **Type:** `(chunkInfo: ChunkInfo) => string`
**Kind:** `sync, sequential`
**Previous Hook:** [`renderDynamicImport`](guide/en/#renderdynamicimport) for each dynamic import expression.
**Next Hook:** [`resolveFileUrl`](guide/en/#resolvefileurl) for each use of `import.meta.ROLLUP_FILE_URL_referenceId` and [`resolveImportMeta`](guide/en/#resolveimportmeta) for all other accesses to `import.meta`. 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`](guide/en/#generatebundle) without properties that rely on file names. The following plugin will invalidate the hash of chunk `foo` with the timestamp of the last build: ```js function augmentWithDatePlugin() { return { name: 'augment-with-date', augmentChunkHash(chunkInfo) { if (chunkInfo.name === 'foo') { return Date.now().toString(); } } }; } ``` #### `banner` **Type:** `string | (() => string)`
**Kind:** `async, parallel`
**Previous Hook:** [`renderStart`](guide/en/#renderstart)
**Next Hook:** [`renderDynamicImport`](guide/en/#renderdynamicimport) for each dynamic import expression. Cf. [`output.banner/output.footer`](guide/en/#outputbanneroutputfooter). #### `closeBundle` **Type:** `closeBundle: () => Promise | void`
**Kind:** `async, parallel`
**Previous Hook:** [`buildEnd`](guide/en/#buildend) if there was a build error, otherwise when [`bundle.close()`](guide/en/#rolluprollup) 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`](guide/en/#thismeta) in this hook and perform the necessary cleanup for watch mode in [`closeWatcher`](guide/en/#closewatcher). #### `footer` **Type:** `string | (() => string)`
**Kind:** `async, parallel`
**Previous Hook:** [`renderStart`](guide/en/#renderstart)
**Next Hook:** [`renderDynamicImport`](guide/en/#renderdynamicimport) for each dynamic import expression. Cf. [`output.banner/output.footer`](guide/en/#outputbanneroutputfooter). #### `generateBundle` **Type:** `(options: OutputOptions, bundle: { [fileName: string]: AssetInfo | ChunkInfo }, isWrite: boolean) => void`
**Kind:** `async, sequential`
**Previous Hook:** [`renderChunk`](guide/en/#renderchunk) for each chunk.
**Next Hook:** [`writeBundle`](guide/en/#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`](guide/en/#outputoptions) if another output is generated. 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`](guide/en/#writebundle) hook. `bundle` provides the full list of files being written or generated along with their details: ```ts type AssetInfo = { fileName: string; name?: string; source: string | Uint8Array; type: 'asset'; }; type 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; }; }; name: string; referencedFiles: string[]; type: 'chunk'; }; ``` 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`](guide/en/#thisemitfile) plugin context function. #### `intro` **Type:** `string | (() => string)`
**Kind:** `async, parallel`
**Previous Hook:** [`renderStart`](guide/en/#renderstart)
**Next Hook:** [`renderDynamicImport`](guide/en/#renderdynamicimport) for each dynamic import expression. Cf. [`output.intro/output.outro`](guide/en/#outputintrooutputoutro). #### `outputOptions` **Type:** `(outputOptions: OutputOptions) => OutputOptions | null`
**Kind:** `sync, sequential`
**Previous Hook:** [`buildEnd`](guide/en/#buildend) if this is the first time an output is generated, otherwise either [`generateBundle`](guide/en/#generatebundle), [`writeBundle`](guide/en/#writebundle) or [`renderError`](guide/en/#rendererror) depending on the previously generated output. This is the first hook of the output generation phase.
**Next Hook:** [`renderStart`](guide/en/#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`](guide/en/#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 | (() => string)`
**Kind:** `async, parallel`
**Previous Hook:** [`renderStart`](guide/en/#renderstart)
**Next Hook:** [`renderDynamicImport`](guide/en/#renderdynamicimport) for each dynamic import expression. Cf. [`output.intro/output.outro`](guide/en/#outputintrooutputoutro). #### `renderChunk` **Type:** `(code: string, chunk: ChunkInfo, options: OutputOptions) => string | { code: string, map: SourceMap } | null`
**Kind:** `async, sequential`
**Previous Hook:** [`resolveFileUrl`](guide/en/#resolvefileurl) for each use of `import.meta.ROLLUP_FILE_URL_referenceId` and [`resolveImportMeta`](guide/en/#resolveimportmeta) for all other accesses to `import.meta`.
**Next Hook:** [`generateBundle`](guide/en/#generatebundle). Can be used to transform individual chunks. Called for each Rollup output chunk file. Returning `null` will apply no transformations. #### `renderDynamicImport` **Type:** `({format: string, moduleId: string, targetModuleId: string | null, customResolution: string | null}) => {left: string, right: string} | null`
**Kind:** `sync, first`
**Previous Hook:** [`banner`](guide/en/#banner), [`footer`](guide/en/#footer), [`intro`](guide/en/#intro), [`outro`](guide/en/#outro).
**Next Hook:** [`augmentChunkHash`](guide/en/#augmentchunkhash) for each chunk that would contain a hash in the file name. 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`](guide/en/#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 Hook:** Any hook from [`renderStart`](guide/en/#renderstart) to [`renderChunk`](guide/en/#renderchunk).
**Next Hook:** If it is called, this is the last hook of the output generation phase and may again be followed by [`outputOptions`](guide/en/#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 Hook:** [`outputOptions`](guide/en/#outputoptions)
**Next Hook:** [`banner`](guide/en/#banner), [`footer`](guide/en/#footer), [`intro`](guide/en/#intro) and [`outro`](guide/en/#outro) run in parallel. 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`](guide/en/#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:** `({chunkId: string, fileName: string, format: string, moduleId: string, referenceId: string, relativePath: string}) => string | null`
**Kind:** `sync, first`
**Previous Hook:** [`augmentChunkHash`](guide/en/#augmentchunkhash) for each chunk that would contain a hash in the file name.
**Next Hook:** [`renderChunk`](guide/en/#renderchunk) for each chunk. 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. - `fileName`: The path and file name of the emitted asset, relative to `output.dir` without a leading `./`. - `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 `../`. Note that since this hook has access to the filename of the current chunk, its return value will not be considered when generating the hash of this chunk. 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 Hook:** [`augmentChunkHash`](guide/en/#augmentchunkhash) for each chunk that would contain a hash in the file name.
**Next Hook:** [`renderChunk`](guide/en/#renderchunk) for each 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; } }; } ``` Note that since this hook has access to the filename of the current chunk, its return value will not be considered when generating the hash of this chunk. #### `writeBundle` **Type:** `(options: OutputOptions, bundle: { [fileName: string]: AssetInfo | ChunkInfo }) => void`
**Kind:** `async, parallel`
**Previous Hook:** [`generateBundle`](guide/en/#generatebundle)
**Next Hook:** If it is called, this is the last hook of the output generation phase and may again be followed by [`outputOptions`](guide/en/#outputoptions) if another output is generated. Called only at the end of `bundle.write()` once all files have been written. Similar to the [`generateBundle`](guide/en/#generatebundle) hook, `bundle` provides the full list of files being written along with their details. ### Deprecated Hooks ☢️ These hooks have been deprecated and may be removed in a future Rollup version. - `resolveAssetUrl` - _**Use [`resolveFileUrl`](guide/en/#resolvefileurl)**_ - Function hook that allows to customize the generated code for asset URLs. More properties may be supported in the future, as and when they prove necessary. ### Plugin Context A number of utility functions and informational bits can be accessed from within most [hooks](guide/en/#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.emitFile` **Type:** `(emittedFile: EmittedChunk | EmittedAsset) => string` 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. `emittedFile` can have one of two forms: ```ts type EmittedChunk = { type: 'chunk'; id: string; name?: string; fileName?: string; implicitlyLoadedAfterOneOf?: string[]; importer?: string; preserveSignature?: 'strict' | 'allow-extension' | 'exports-only' | false; }; type EmittedAsset = { type: 'asset'; name?: string; fileName?: string; source?: string | Uint8Array; }; ``` In both cases, 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`](guide/en/#outputchunkfilenames) or [`output.assetFileNames`](guide/en/#outputassetfilenames) 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. You can reference the URL of an emitted file in any code returned by a [`load`](guide/en/#load) or [`transform`](guide/en/#transform) plugin hook via `import.meta.ROLLUP_FILE_URL_referenceId`. See [File URLs](guide/en/#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`](guide/en/#resolvefileurl) plugin hook. You can also use [`this.getFileName(referenceId)`](guide/en/#thisgetfilename) to determine the file name as soon as it is available 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`](guide/en/#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`](guide/en/#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`](guide/en/#outputchunkfilenames) 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 _`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)`](guide/en/#thissetassetsource) 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 such an asset is not deduplicated, the [`output.assetFileNames`](guide/en/#outputassetfilenames) name pattern will be used. #### `this.error` **Type:** `(error: string | Error, position?: number | { column: number; line: number }) => never` Structurally equivalent to `this.warn`, except that it will also abort the bundling process. #### `this.getCombinedSourcemap` **Type:** `() => SourceMap` Get the combined source maps of all previous plugins. This context function can only be used in the [`transform`](guide/en/#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`](guide/en/#thisemitfile). 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)` Returns additional information about the module in question in the form ```ts type 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 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 importedIds: string[]; // the module ids statically imported by this module importers: string[]; // the ids of all modules that statically import this module dynamicallyImportedIds: string[]; // the module ids imported by this module via dynamic import() 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 hasModuleSideEffects: boolean | 'no-treeshake'; // are imports of this module included if nothing is imported from it meta: { [plugin: string]: any }; // custom module meta-data syntheticNamedExports: boolean | string; // final value of synthetic named exports }; ``` During the build, this object represents currently available information about the module. Before the [`buildEnd`](guide/en/#buildend) hook, this information may be incomplete as e.g. the `importedIds` are not yet resolved or additional `importers` are discovered. 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.load` **Type:** `({id: string, moduleSideEffects?: boolean | 'no-treeshake' | null, syntheticNamedExports?: boolean | string | null, meta?: {[plugin: string]: any} | 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`](guide/en/#load), [`transform`](guide/en/#transform) and [`moduleParsed`](guide/en/#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`](guide/en/#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`](guide/en/#thisresolve) 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` and `dynamicallyImportedIds`. This helps to avoid deadlock situations when awaiting `this.load` in a `resolveId` hook. If you are interested in `importedIds` and `dynamicallyImportedIds`, you should implement a `moduleParsed` hook. Note that with regard to the `moduleSideEffects`, `syntheticNamedExports` and `meta` 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: ```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.indexOf('/* use proxy */') >= 0) { 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); return `console.log('proxy for ${importee}'); export * from ${JSON.stringify(importee)};`; } return null; } }; } ``` If the module was already loaded, this will just wait for the parsing to complete and then return its module information. If the module was not yet imported by another module, this 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. #### `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`](guide/en/#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:** `(source: string, importer?: string, options?: {skipSelf?: boolean, isEntry?: boolean, isEntry?: boolean, custom?: {[plugin: string]: any}}) => Promise<{id: string, external: boolean | "absolute", moduleSideEffects: boolean | 'no-treeshake', syntheticNamedExports: boolean | string, meta: {[plugin: string]: any}} | null>` 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`](guide/en/#makeabsoluteexternalsrelative) option or by explicit plugin choice in the [`resolveId`](guide/en/#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](guide/en/#custom-resolver-options) for details. The value for `isEntry` you pass here will be passed along to the [`resolveId`](guide/en/#resolveid) hooks handling this call, otherwise `false` will be passed if there is an importer and `true` if there is not. When calling this function from a `resolveId` hook, you should always check if it makes sense for you to pass along the `isEntry` and `custom` options. #### `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:** `(warning: string | RollupWarning, position?: number | { column: number; line: number }) => void` Using this method will queue warnings for a build. These warnings will be printed by the CLI just like internally generated warnings (except with the plugin name), or captured by custom `onwarn` handlers. 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...' }); ``` Use the second form if you need to add additional properties to your warning object. Rollup will augment the warning object with a `plugin` property containing the plugin name, `code` (`PLUGIN_WARNING`) and `id` (the file being transformed) properties. The `position` argument is a character index where the warning was raised. If present, Rollup will augment the warning object with `pos`, `loc` (a standard `{ file, line, column }` object) and `frame` (a snippet of code showing the error). ### Deprecated Context Functions ☢️ These context utility functions have been deprecated and may be removed in a future Rollup version. - `this.emitAsset(assetName: string, source: string) => string` - _**Use [`this.emitFile`](guide/en/#thisemitfile)**_ - Emits a custom file that is included in the build output, returning a `referenceId` that can be used to reference the emitted file. You can defer setting the source if you provide it later via [`this.setAssetSource(referenceId, source)`](guide/en/#thissetassetsource). A string or `Uint8Array`/`Buffer` source must be set for each asset through either method or an error will be thrown on generate completion. Emitted assets will follow the [`output.assetFileNames`](guide/en/#outputassetfilenames) naming scheme. You can reference the URL of the file in any code returned by a [`load`](guide/en/#load) or [`transform`](guide/en/#transform) plugin hook via `import.meta.ROLLUP_ASSET_URL_referenceId`. The generated code that replaces `import.meta.ROLLUP_ASSET_URL_referenceId` can be customized via the [`resolveFileUrl`](guide/en/#resolvefileurl) plugin hook. Once the asset has been finalized during `generate`, you can also use [`this.getFileName(referenceId)`](guide/en/#thisgetfilename) to determine the file name. - `this.emitChunk(moduleId: string, options?: {name?: string}) => string` - _**Use [`this.emitFile`](guide/en/#thisemitfile)**_ - Emits a new chunk with the given module as entry point. This will not result in duplicate modules in the graph, instead if necessary, existing chunks will be split. It returns a `referenceId` that can be used to later access the generated file name of the chunk. Emitted chunks will follow the [`output.chunkFileNames`](guide/en/#outputchunkfilenames), [`output.entryFileNames`](guide/en/#outputentryfilenames) naming scheme. If a `name` is provided, this will be used for the `[name]` file name placeholder, otherwise the name will be derived from the file name. If a `name` is provided, this name must not conflict with any other entry point names unless the entry points reference the same entry module. You can reference the URL of the emitted chunk in any code returned by a [`load`](guide/en/#load) or [`transform`](guide/en/#transform) plugin hook via `import.meta.ROLLUP_CHUNK_URL_referenceId`. The generated code that replaces `import.meta.ROLLUP_CHUNK_URL_referenceId` can be customized via the [`resolveFileUrl`](guide/en/#resolvefileurl) plugin hook. Once the chunk has been rendered during `generate`, you can also use [`this.getFileName(referenceId)`](guide/en/#thisgetfilename) to determine the file name. - `this.getAssetFileName(referenceId: string) => string` - _**Use [`this.getFileName`](guide/en/#thisgetfilename)**_ - Get the file name of an asset, according to the `assetFileNames` output option pattern. The file name will be relative to `outputOptions.dir`. - `this.getChunkFileName(referenceId: string) => string` - _**Use [`this.getFileName`](guide/en/#thisgetfilename)**_ - Get the file name of an emitted chunk. The file name will be relative to `outputOptions.dir`. - `this.isExternal(id: string, importer: string | undefined, isResolved: boolean) => boolean` - _**Use [`this.resolve`](guide/en/#thisresolve)**_ - Determine if a given module ID is external when imported by `importer`. When `isResolved` is false, Rollup will try to resolve the id before testing if it is external. - `this.moduleIds: IterableIterator` - _**Use [`this.getModuleIds`](guide/en/#thisgetmoduleids)**_ - 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)`. - `this.resolveId(source: string, importer?: string) => Promise` - _**Use [`this.resolve`](guide/en/#thisresolve)**_ - Resolve imports to module ids (i.e. file names) using the same plugins that Rollup uses. Returns `null` if an id cannot be resolved. ### 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); ``` 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). 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`](guide/en/#resolveid), [`load`](guide/en/#load) or [`transform`](guide/en/#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 accessed by themselves and other plugins via the [`resolveId`](guide/en/#resolveid), [`load`](guide/en/#load), and [`transform`](guide/en/#transform) hooks. 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. #### 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 = options.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-2.61.1/docs/06-faqs.md000077500000000000000000000227111415504077600155640ustar00rootroot00000000000000--- title: Frequently Asked Questions --- #### Why are ES modules better than CommonJS Modules? ES modules are an official standard and the clear path forward for JavaScript code structure, whereas CommonJS modules are an idiosyncratic legacy format that served as a stopgap solution before ES modules had been proposed. ES modules allow static analysis that helps with optimizations like tree-shaking and scope-hoisting, and provide advanced features like circular references and live bindings. #### What Is "tree-shaking?" Tree-shaking, also known as "live code inclusion", is Rollup's process of eliminating code that is not actually used in a given project. It is a [form of dead code elimination](https://medium.com/@Rich_Harris/tree-shaking-versus-dead-code-elimination-d3765df85c80#.jnypozs9n) but can be much more efficient than other approaches with regard to output size. The name is derived from the [abstract syntax tree](https://en.wikipedia.org/wiki/Abstract_syntax_tree) of the modules (not the module graph). The algorithm first marks all relevant statements and then "shakes the syntax tree" to remove all dead code. It is similar in idea to the [mark-and-sweep garbage collection algorithm](https://en.wikipedia.org/wiki/Tracing_garbage_collection). Even though this algorithm is not restricted to ES modules, they make it much more efficient as they allow Rollup to treat all modules together as a big abstract syntax tree with shared bindings. #### How do I use Rollup in Node.js with CommonJS modules? Rollup strives to implement the specification for ES modules, not necessarily the behaviors of Node.js, NPM, `require()`, and CommonJS. Consequently, loading of CommonJS modules and use of Node's module location resolution logic are both implemented as optional plugins, not included by default in the Rollup core. Just `npm install` the [commonjs](https://github.com/rollup/plugins/tree/master/packages/commonjs) and [node-resolve](https://github.com/rollup/plugins/tree/master/packages/node-resolve) plugins and then enable them using a `rollup.config.js` file and you should be all set. If the modules import JSON files, you will also need the [json](https://github.com/rollup/plugins/tree/master/packages/json) plugin. #### Why isn't node-resolve a built-in feature? There are two primary reasons: 1. Philosophically, it's because Rollup is essentially a [polyfill]() of sorts for native module loaders in both Node and browsers. In a browser, `import foo from 'foo'` won't work, because browsers don't use Node's resolution algorithm. 2. On a practical level, it's just much easier to develop software if these concerns are neatly separated with a good API. Rollup's core is quite large, and everything that stops it getting larger is a good thing. Meanwhile, it's easier to fix bugs and add features. By keeping Rollup lean, the potential for technical debt is small. Please see [this issue](https://github.com/rollup/rollup/issues/1555#issuecomment-322862209) for a more verbose explanation. #### Why do additional imports turn up in my entry chunks when code-splitting? By default when creating multiple chunks, imports of dependencies of entry chunks will be added as empty imports to the entry chunks themselves. [Example](https://rollupjs.org/repl/?shareable=JTdCJTIybW9kdWxlcyUyMiUzQSU1QiU3QiUyMm5hbWUlMjIlM0ElMjJtYWluLmpzJTIyJTJDJTIyY29kZSUyMiUzQSUyMmltcG9ydCUyMHZhbHVlJTIwZnJvbSUyMCcuJTJGb3RoZXItZW50cnkuanMnJTNCJTVDbmNvbnNvbGUubG9nKHZhbHVlKSUzQiUyMiUyQyUyMmlzRW50cnklMjIlM0F0cnVlJTdEJTJDJTdCJTIybmFtZSUyMiUzQSUyMm90aGVyLWVudHJ5LmpzJTIyJTJDJTIyY29kZSUyMiUzQSUyMmltcG9ydCUyMGV4dGVybmFsVmFsdWUlMjBmcm9tJTIwJ2V4dGVybmFsJyUzQiU1Q25leHBvcnQlMjBkZWZhdWx0JTIwMiUyMColMjBleHRlcm5hbFZhbHVlJTNCJTIyJTJDJTIyaXNFbnRyeSUyMiUzQXRydWUlN0QlNUQlMkMlMjJvcHRpb25zJTIyJTNBJTdCJTIyZm9ybWF0JTIyJTNBJTIyZXNtJTIyJTJDJTIybmFtZSUyMiUzQSUyMm15QnVuZGxlJTIyJTJDJTIyYW1kJTIyJTNBJTdCJTIyaWQlMjIlM0ElMjIlMjIlN0QlMkMlMjJnbG9iYWxzJTIyJTNBJTdCJTdEJTdEJTJDJTIyZXhhbXBsZSUyMiUzQW51bGwlN0Q=): ```js // input // main.js import value from './other-entry.js'; console.log(value); // other-entry.js import externalValue from 'external'; export default 2 * externalValue; // output // main.js import 'external'; // this import has been hoisted from other-entry.js import value from './other-entry.js'; console.log(value); // other-entry.js import externalValue from 'external'; var value = 2 * externalValue; export default value; ``` This does not affect code execution order or behaviour, but it will speed up how your code is loaded and parsed. Without this optimization, a JavaScript engine needs to perform the following steps to run `main.js`: 1. Load and parse `main.js`. At the end, an import to `other-entry.js` will be discovered. 2. Load and parse `other-entry.js`. At the end, an import to `external` will be discovered. 3. Load and parse `external`. 4. Execute `main.js`. With this optimization, a JavaScript engine will discover all transitive dependencies after parsing an entry module, avoiding the waterfall: 1. Load and parse `main.js`. At the end, imports to `other-entry.js` and `external` will be discovered. 2. Load and parse `other-entry.js` and `external`. The import of `external` from `other-entry.js` is already loaded and parsed. 3. Execute `main.js`. There may be situations where this optimization is not desired, in which case you can turn it off via the [`output.hoistTransitiveImports`](guide/en/#outputhoisttransitiveimports) option. This optimization is also never applied when using the [`output.preserveModules`](guide/en/#outputpreservemodules) option. #### How do I add polyfills to a Rollup bundle? Even though Rollup will usually try to maintain exact module execution order when bundling, there are two situations when this is not always the case: code-splitting and external dependencies. The problem is most obvious with external dependencies, see the following [example](https://rollupjs.org/repl/?shareable=JTdCJTIybW9kdWxlcyUyMiUzQSU1QiU3QiUyMm5hbWUlMjIlM0ElMjJtYWluLmpzJTIyJTJDJTIyY29kZSUyMiUzQSUyMmltcG9ydCUyMCcuJTJGcG9seWZpbGwuanMnJTNCJTVDbmltcG9ydCUyMCdleHRlcm5hbCclM0IlNUNuY29uc29sZS5sb2coJ21haW4nKSUzQiUyMiUyQyUyMmlzRW50cnklMjIlM0F0cnVlJTdEJTJDJTdCJTIybmFtZSUyMiUzQSUyMnBvbHlmaWxsLmpzJTIyJTJDJTIyY29kZSUyMiUzQSUyMmNvbnNvbGUubG9nKCdwb2x5ZmlsbCcpJTNCJTIyJTJDJTIyaXNFbnRyeSUyMiUzQWZhbHNlJTdEJTVEJTJDJTIyb3B0aW9ucyUyMiUzQSU3QiUyMmZvcm1hdCUyMiUzQSUyMmVzbSUyMiUyQyUyMm5hbWUlMjIlM0ElMjJteUJ1bmRsZSUyMiUyQyUyMmFtZCUyMiUzQSU3QiUyMmlkJTIyJTNBJTIyJTIyJTdEJTJDJTIyZ2xvYmFscyUyMiUzQSU3QiU3RCU3RCUyQyUyMmV4YW1wbGUlMjIlM0FudWxsJTdE): ```js // main.js import './polyfill.js'; import 'external'; console.log('main'); // polyfill.js console.log('polyfill'); ``` Here the execution order is `polyfill.js` → `external` → `main.js`. Now when you bundle the code, you will get ```js import 'external'; console.log('polyfill'); console.log('main'); ``` with the execution order `external` → `polyfill.js` → `main.js`. This is not a problem caused by Rollup putting the `import` at the top of the bundle—imports are always executed first, no matter where they are located in the file. This problem can be solved by creating more chunks: If `dep.js` ends up in a different chunk than `main.js`, [correct execution order will be preserved](https://rollupjs.org/repl/?shareable=JTdCJTIybW9kdWxlcyUyMiUzQSU1QiU3QiUyMm5hbWUlMjIlM0ElMjJtYWluLmpzJTIyJTJDJTIyY29kZSUyMiUzQSUyMmltcG9ydCUyMCcuJTJGcG9seWZpbGwuanMnJTNCJTVDbmltcG9ydCUyMCdleHRlcm5hbCclM0IlNUNuY29uc29sZS5sb2coJ21haW4nKSUzQiUyMiUyQyUyMmlzRW50cnklMjIlM0F0cnVlJTdEJTJDJTdCJTIybmFtZSUyMiUzQSUyMnBvbHlmaWxsLmpzJTIyJTJDJTIyY29kZSUyMiUzQSUyMmNvbnNvbGUubG9nKCdwb2x5ZmlsbCcpJTNCJTIyJTJDJTIyaXNFbnRyeSUyMiUzQXRydWUlN0QlNUQlMkMlMjJvcHRpb25zJTIyJTNBJTdCJTIyZm9ybWF0JTIyJTNBJTIyZXNtJTIyJTJDJTIybmFtZSUyMiUzQSUyMm15QnVuZGxlJTIyJTJDJTIyYW1kJTIyJTNBJTdCJTIyaWQlMjIlM0ElMjIlMjIlN0QlMkMlMjJnbG9iYWxzJTIyJTNBJTdCJTdEJTdEJTJDJTIyZXhhbXBsZSUyMiUzQW51bGwlN0Q=). However there is not yet an automatic way to do this in Rollup. For code-splitting, the situation is similar as Rollup is trying to create as few chunks as possible while making sure no code is executed that is not needed. For most code this is not a problem, because Rollup can guarantee: > If module A imports module B and there are no circular imports, then B will always be executed before A. This is however a problem for polyfills, as those usually need to be executed first but it is usually not desired to place an import of the polyfill in every single module. Luckily, this is not needed: 1. If there are no external dependencies that depend on the polyfill, it is enough to add an import of the polyfill as first statement to each static entry point. 2. Otherwise, additionally making the polyfill a separate entry or [manual chunk](guide/en/#outputmanualchunks) will always make sure it is executed first. #### Is Rollup meant for building libraries or applications? Rollup is already used by many major JavaScript libraries, and can also be used to build the vast majority of applications. However if you want to use code-splitting or dynamic imports with older browsers, you will need an additional runtime to handle loading missing chunks. We recommend using the [SystemJS Production Build](https://github.com/systemjs/systemjs#browser-production) as it integrates nicely with Rollup's system format output and is capable of properly handling all the ES module live bindings and re-export edge cases. Alternatively, an AMD loader can be used as well. #### Who made the Rollup logo? It's lovely. [Julian Lloyd](https://twitter.com/jlmakes)! rollup-2.61.1/docs/07-tools.md000077500000000000000000000162031415504077600157720ustar00rootroot00000000000000--- title: Integrating Rollup With Other Tools --- ### 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: ``` 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… ``` 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… ``` 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 times `@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 customResolveOptions: { moduleDirectory: '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: ``` 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: ``` 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](guide/en/#javascript-api): ```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 }); }); ``` rollup-2.61.1/docs/08-troubleshooting.md000066400000000000000000000162531415504077600200640ustar00rootroot00000000000000--- title: Troubleshooting --- 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/plugins/tree/master/packages/commonjs), which makes a reasonable attempt to generate named exports from the CommonJS code but won't always succeed, because the freewheeling nature of CommonJS is at odds with the rigorous approach we benefit from in JavaScript modules. It can be solved by using the [namedExports](https://github.com/rollup/plugins/tree/master/packages/commonjs#custom-named-exports) option, which allows you to manually fill in the information gaps. ### 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/snowpackjs/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/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. rollup-2.61.1/docs/999-big-list-of-options.md000077500000000000000000002254441415504077600205540ustar00rootroot00000000000000--- title: Big list of options --- ### Core functionality #### external Type: `(string | RegExp)[] | RegExp | string | (id: string, parentId: string, isResolved: boolean) => boolean`
CLI: `-e`/`--external ` Either a function that takes an `id` and returns `true` (external) or `false` (not external), or an `Array` of module IDs, or regular expressions to match module IDs, that should remain external to the bundle. Can also be just a single ID or regular expression. The matched IDs should be either: 1. the name of an external dependency, exactly the way it is written in the import statement. I.e. to mark `import "dependency.js"` as external, use `"dependency.js"` while to mark `import "dependency"` as external, use `"dependency"`. 2. a resolved ID (like an absolute path to a file). ```js // rollup.config.js import path from 'path'; export default { ..., external: [ 'some-externally-required-library', path.resolve( __dirname, 'src/some-local-file-that-should-not-be-bundled.js' ), /node_modules/ ] }; ``` Note that if you want to filter out package imports, e.g. `import {rollup} from 'rollup'`, via a `/node_modules/` regular expression, you need something like [@rollup/plugin-node-resolve](https://github.com/rollup/plugins/tree/master/packages/node-resolve) to resolve the imports to `node_modules` first. When given as a command line argument, it should be a comma-separated list of IDs: ```bash rollup -i src/main.js ... -e foo,bar,baz ``` When providing a function, it is called with three parameters `(id, parent, isResolved)` that can give you more fine-grained control: - `id` is the id of the module in question - `parent` is the id of the module doing the import - `isResolved` signals whether the `id` has been resolved by e.g. plugins When creating an `iife` or `umd` bundle, you will need to provide global variable names to replace your external imports via the `output.globals` option. If a relative import, i.e. starting with `./` or `../`, is marked as "external", rollup will internally resolve the id to an absolute file system location so that different imports of the external module can be merged. When the resulting bundle is written, the import will again be converted to a relative import. Example: ```js // input // src/main.js (entry point) import x from '../external.js'; import './nested/nested.js'; console.log(x); // src/nested/nested.js // the import would point to the same file if it existed import x from '../../external.js'; console.log(x); // output // the different imports are merged import x from '../external.js'; console.log(x); console.log(x); ``` The conversion back to a relative import is done as if `output.file` or `output.dir` were in the same location as the entry point or the common base directory of all entry points if there is more than one. #### input Type: `string | string [] | { [entryName: string]: string }`
CLI: `-i`/`--input ` The bundle's entry point(s) (e.g. your `main.js` or `app.js` or `index.js`). If you provide an array of entry points or an object mapping names to entry points, they will be bundled to separate output chunks. Unless the [`output.file`](guide/en/#outputfile) option is used, generated chunk names will follow the [`output.entryFileNames`](guide/en/#outputentryfilenames) option. When using the object form, the `[name]` portion of the file name will be the name of the object property while for the array form, it will be the file name of the entry point. Note that it is possible when using the object form to put entry points into different sub-folders by adding a `/` to the name. The following will generate at least two entry chunks with the names `entry-a.js` and `entry-b/index.js`, i.e. the file `index.js` is placed in the folder `entry-b`: ```js // rollup.config.js export default { ..., input: { a: 'src/main-a.js', 'b/index': 'src/main-b.js' }, output: { ..., entryFileNames: 'entry-[name].js' } }; ``` The option can be omitted if some plugin emits at least one chunk (using [`this.emitFile`](guide/en/#thisemitfile)) by the end of the [`buildStart`](guide/en/#buildstart) hook. When using the command line interface, multiple inputs can be provided by using the option multiple times. When provided as the first options, it is equivalent to not prefix them with `--input`: ```sh rollup --format es --input src/entry1.js --input src/entry2.js # is equivalent to rollup src/entry1.js src/entry2.js --format es ``` Chunks can be named by adding an `=` to the provided value: ```sh rollup main=src/entry1.js other=src/entry2.js --format es ``` File names containing spaces can be specified by using quotes: ```sh rollup "main entry"="src/entry 1.js" "src/other entry.js" --format es ``` #### output.dir Type: `string`
CLI: `-d`/`--dir ` The directory in which all generated chunks are placed. This option is required if more than one chunk is generated. Otherwise, the `file` option can be used instead. #### output.file Type: `string`
CLI: `-o`/`--file ` The file to write to. Will also be used to generate sourcemaps, if applicable. Can only be used if not more than one chunk is generated. #### output.format Type: `string`
CLI: `-f`/`--format `
Default: `"es"` Specifies the format of the generated bundle. One of the following: - `amd` – Asynchronous Module Definition, used with module loaders like RequireJS - `cjs` – CommonJS, suitable for Node and other bundlers (alias: `commonjs`) - `es` – Keep the bundle as an ES module file, suitable for other bundlers and inclusion as a ` rollup-2.61.1/test/chunking-form/samples/deprecated/emit-asset/index-es.html000066400000000000000000000002701415504077600270750ustar00rootroot00000000000000 Title rollup-2.61.1/test/chunking-form/samples/deprecated/emit-asset/index-system.html000066400000000000000000000004111415504077600300070ustar00rootroot00000000000000 SystemJS rollup-2.61.1/test/chunking-form/samples/deprecated/emit-asset/logo1.svg000066400000000000000000000064341415504077600262450ustar00rootroot00000000000000 rollup-2.61.1/test/chunking-form/samples/deprecated/emit-asset/logo2.svg000066400000000000000000000064341415504077600262460ustar00rootroot00000000000000 rollup-2.61.1/test/chunking-form/samples/deprecated/emit-asset/main.js000066400000000000000000000001631415504077600257560ustar00rootroot00000000000000import logo from './logo1.svg'; import { showImage } from './show-image'; showImage(logo); import('./nested.js'); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-asset/nested.js000066400000000000000000000001341415504077600263120ustar00rootroot00000000000000import logo from './logo2.svg'; import { showImage } from './show-image'; showImage(logo); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-asset/show-image.js000066400000000000000000000003071415504077600270720ustar00rootroot00000000000000export function showImage(url) { console.log(url); if (typeof document !== 'undefined') { const image = document.createElement('img'); image.src = url; document.body.appendChild(image); } } rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-existing/000077500000000000000000000000001415504077600263155ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-existing/_config.js000066400000000000000000000010511415504077600302540ustar00rootroot00000000000000module.exports = { description: 'allows adding modules already in the graph as entry points', expectedWarnings: ['DEPRECATED_FEATURE'], options: { strictDeprecations: false, input: { 'first-main': 'main1', 'second-main': 'main2' }, plugins: { buildStart() { // it should be possible to add existing entry points while not overriding their alias this.emitChunk('main1'); // if an existing dependency is added, all references should use the new name this.emitChunk('dep.js'); this.emitChunk('dep'); } } } }; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/000077500000000000000000000000001415504077600302555ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/amd/000077500000000000000000000000001415504077600310165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/amd/first-main.js000066400000000000000000000001371415504077600334260ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log('main1', dep); })); generated-dep.js000066400000000000000000000001141415504077600337750ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/amddefine((function () { 'use strict'; var value = 42; return value; })); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/amd/second-main.js000066400000000000000000000001371415504077600335520ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log('main1', dep); })); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/cjs/000077500000000000000000000000001415504077600310345ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/cjs/first-main.js000066400000000000000000000001241415504077600334400ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('main1', dep); generated-dep.js000066400000000000000000000000701415504077600340140ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/cjs'use strict'; var value = 42; module.exports = value; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/cjs/second-main.js000066400000000000000000000001241415504077600335640ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('main1', dep); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/es/000077500000000000000000000000001415504077600306645ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/es/first-main.js000066400000000000000000000001061415504077600332700ustar00rootroot00000000000000import value from './generated-dep.js'; console.log('main1', value); generated-dep.js000066400000000000000000000000561415504077600336500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/esvar value = 42; export { value as default }; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/es/second-main.js000066400000000000000000000001061415504077600334140ustar00rootroot00000000000000import value from './generated-dep.js'; console.log('main1', value); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/system/000077500000000000000000000000001415504077600316015ustar00rootroot00000000000000first-main.js000066400000000000000000000003521415504077600341310ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-existing/_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.js000066400000000000000000000002241415504077600345620ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var value = exports('default', 42); }) }; })); second-main.js000066400000000000000000000003521415504077600342550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-existing/_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-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-existing/dep.js000066400000000000000000000000231415504077600274160ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-existing/main1.js000066400000000000000000000000741415504077600276610ustar00rootroot00000000000000import value from './dep.js'; console.log('main1', value); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-existing/main2.js000066400000000000000000000000741415504077600276620ustar00rootroot00000000000000import value from './dep.js'; console.log('main1', value); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-facade/000077500000000000000000000000001415504077600256665ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-facade/_config.js000066400000000000000000000010201415504077600276210ustar00rootroot00000000000000const assert = require('assert'); let referenceId; module.exports = { description: 'retrieves the correct name of an emitted chunk in case a facade is created', expectedWarnings: ['DEPRECATED_FEATURE'], options: { strictDeprecations: false, input: 'main', manualChunks: { 'build-starter': ['buildStart'] }, plugins: { buildStart() { referenceId = this.emitChunk('buildStart'); }, renderChunk() { assert.strictEqual(this.getChunkFileName(referenceId), 'generated-buildStart.js'); } } } }; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/000077500000000000000000000000001415504077600276265ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/amd/000077500000000000000000000000001415504077600303675ustar00rootroot00000000000000generated-build-starter.js000066400000000000000000000003111415504077600353560ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/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.js000066400000000000000000000003341415504077600347170ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/amddefine(['exports', './generated-build-starter'], (function (exports, buildStarter) { 'use strict'; exports.buildStartValue = buildStarter.value; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/amd/main.js000066400000000000000000000002311415504077600316450ustar00rootroot00000000000000define(['./generated-build-starter'], (function (buildStarter) { 'use strict'; console.log('main', buildStarter.value, buildStarter.otherValue); })); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/cjs/000077500000000000000000000000001415504077600304055ustar00rootroot00000000000000generated-build-starter.js000066400000000000000000000002241415504077600353770ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/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.js000066400000000000000000000002741415504077600347400ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var buildStarter = require('./generated-build-starter.js'); exports.buildStartValue = buildStarter.value; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/cjs/main.js000066400000000000000000000002161415504077600316660ustar00rootroot00000000000000'use strict'; var buildStarter = require('./generated-build-starter.js'); console.log('main', buildStarter.value, buildStarter.otherValue); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/es/000077500000000000000000000000001415504077600302355ustar00rootroot00000000000000generated-build-starter.js000066400000000000000000000001651415504077600352330ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/esconst value = 42; const otherValue = 43; console.log('startBuild', value); export { otherValue as o, value as v }; generated-buildStart.js000066400000000000000000000001051415504077600345610ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/esexport { v as buildStartValue } from './generated-build-starter.js'; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/es/main.js000066400000000000000000000001651415504077600315210ustar00rootroot00000000000000import { v as value, o as otherValue } from './generated-build-starter.js'; console.log('main', value, otherValue); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/system/000077500000000000000000000000001415504077600311525ustar00rootroot00000000000000generated-build-starter.js000066400000000000000000000003361415504077600361500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/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.js000066400000000000000000000003331415504077600355010ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/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-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/system/main.js000066400000000000000000000004341415504077600324350ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-facade/buildStart.js000066400000000000000000000001511415504077600303360ustar00rootroot00000000000000import {value} from './dep.js'; console.log('startBuild', value); export { value as buildStartValue }; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-facade/dep.js000066400000000000000000000000671415504077600267770ustar00rootroot00000000000000export const value = 42; export const otherValue = 43; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-facade/main.js000066400000000000000000000001241415504077600271450ustar00rootroot00000000000000import { value, otherValue } from './dep'; console.log('main', value, otherValue); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/000077500000000000000000000000001415504077600255475ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_config.js000066400000000000000000000014541415504077600275150ustar00rootroot00000000000000const assert = require('assert'); let referenceIdBuildStart; let referenceIdTransform; module.exports = { description: 'allows naming emitted chunks', expectedWarnings: ['DEPRECATED_FEATURE'], options: { strictDeprecations: false, input: 'main', plugins: { buildStart() { referenceIdBuildStart = this.emitChunk('buildStart', { name: 'nested/build-start' }); }, transform(code, id) { if (id.endsWith('main.js')) { referenceIdTransform = this.emitChunk('transform', { name: 'nested/transform' }); } }, renderChunk() { assert.strictEqual( this.getChunkFileName(referenceIdBuildStart), 'generated-nested/build-start.js' ); assert.strictEqual( this.getChunkFileName(referenceIdTransform), 'generated-nested/transform.js' ); } } } }; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/000077500000000000000000000000001415504077600275075ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/amd/000077500000000000000000000000001415504077600302505ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/amd/generated-dep.js000066400000000000000000000001511415504077600333070ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var value = 42; exports.value = value; })); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/amd/generated-nested/000077500000000000000000000000001415504077600334665ustar00rootroot00000000000000build-start.js000066400000000000000000000001531415504077600361760ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/amd/generated-nesteddefine(['../generated-dep'], (function (dep) { 'use strict'; console.log('buildStart', dep.value); })); transform.js000066400000000000000000000001521415504077600357560ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/amd/generated-nesteddefine(['../generated-dep'], (function (dep) { 'use strict'; console.log('transform', dep.value); })); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/amd/main.js000066400000000000000000000001441415504077600315310ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log('main', dep.value); })); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/cjs/000077500000000000000000000000001415504077600302665ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/cjs/generated-dep.js000066400000000000000000000000671415504077600333330ustar00rootroot00000000000000'use strict'; var value = 42; exports.value = value; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/cjs/generated-nested/000077500000000000000000000000001415504077600335045ustar00rootroot00000000000000build-start.js000066400000000000000000000001401415504077600362100ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/cjs/generated-nested'use strict'; var dep = require('../generated-dep.js'); console.log('buildStart', dep.value); transform.js000066400000000000000000000001371415504077600357770ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/cjs/generated-nested'use strict'; var dep = require('../generated-dep.js'); console.log('transform', dep.value); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/cjs/main.js000066400000000000000000000001311415504077600315430ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('main', dep.value); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/es/000077500000000000000000000000001415504077600301165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/es/generated-dep.js000066400000000000000000000000501415504077600331530ustar00rootroot00000000000000var value = 42; export { value as v }; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/es/generated-nested/000077500000000000000000000000001415504077600333345ustar00rootroot00000000000000build-start.js000066400000000000000000000001251415504077600360430ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/es/generated-nestedimport { v as value } from '../generated-dep.js'; console.log('buildStart', value); transform.js000066400000000000000000000001241415504077600356230ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/es/generated-nestedimport { v as value } from '../generated-dep.js'; console.log('transform', value); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/es/main.js000066400000000000000000000001161415504077600313760ustar00rootroot00000000000000import { v as value } from './generated-dep.js'; console.log('main', value); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/system/000077500000000000000000000000001415504077600310335ustar00rootroot00000000000000generated-dep.js000066400000000000000000000002161415504077600340150ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var value = exports('v', 42); }) }; })); generated-nested/000077500000000000000000000000001415504077600341725ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/systembuild-start.js000066400000000000000000000003471415504077600367660ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/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('buildStart', value); }) }; })); transform.js000066400000000000000000000003461415504077600365460ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/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('transform', value); }) }; })); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/system/main.js000066400000000000000000000003401415504077600323120ustar00rootroot00000000000000System.register(['./generated-dep.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log('main', value); }) }; })); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/buildStart.js000066400000000000000000000001011415504077600302120ustar00rootroot00000000000000import value from './dep.js'; console.log('buildStart', value); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/dep.js000066400000000000000000000000231415504077600266500ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/main.js000066400000000000000000000000731415504077600270310ustar00rootroot00000000000000import value from './dep.js'; console.log('main', value); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-named/transform.js000066400000000000000000000001001415504077600301070ustar00rootroot00000000000000import value from './dep.js'; console.log('transform', value); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/000077500000000000000000000000001415504077600257745ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_config.js000066400000000000000000000027561415504077600277500ustar00rootroot00000000000000const path = require('path'); let workerId; let proxyId; module.exports = { description: 'allows adding additional chunks to be used in workers', expectedWarnings: ['DEPRECATED_FEATURE'], options: { strictDeprecations: false, input: 'main', output: { chunkFileNames: 'chunks/[name].js' }, plugins: { load(id) { if (id === 'merged' || id === 'nested') { if (!workerId) { workerId = this.emitChunk('worker'); proxyId = this.emitChunk('worker-proxy'); } return ` export const getWorkerMessage = () => new Promise(resolve => { const worker = new Worker(import.meta.ROLLUP_CHUNK_URL_${proxyId}); worker.onmessage = resolve; });`; } if (id === 'worker-proxy') { return `PLACEHOLDER(import.meta.ROLLUP_CHUNK_URL_${workerId})`; } }, renderChunk(code, chunk, options) { if (chunk.facadeModuleId === 'worker-proxy') { const chunkFileName = `./${path.relative( path.dirname(chunk.fileName), this.getChunkFileName(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-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/000077500000000000000000000000001415504077600277345ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/amd/000077500000000000000000000000001415504077600304755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/amd/chunks/000077500000000000000000000000001415504077600317705ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/amd/chunks/nested.js000066400000000000000000000005061415504077600336110ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/amd/chunks/shared.js000066400000000000000000000001641415504077600335750ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const shared = 'shared'; exports.shared = shared; })); worker-proxy.js000066400000000000000000000001451415504077600347370ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/amd/chunksimportScripts('../../../../../../../node_modules/requirejs/require.js'); requirejs(['./worker.js']); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/amd/chunks/worker.js000066400000000000000000000001561415504077600336410ustar00rootroot00000000000000define(['./shared'], (function (shared) { 'use strict'; postMessage(`from worker: ${shared.shared}`); })); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/amd/main.js000066400000000000000000000012441415504077600317600ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/cjs/000077500000000000000000000000001415504077600305135ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/cjs/chunks/000077500000000000000000000000001415504077600320065ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/cjs/chunks/nested.js000066400000000000000000000006221415504077600336260ustar00rootroot00000000000000'use strict'; const getWorkerMessage = () => new Promise(resolve => { const worker = new Worker((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __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-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/cjs/chunks/shared.js000066400000000000000000000001021415504077600336030ustar00rootroot00000000000000'use strict'; const shared = 'shared'; exports.shared = shared; worker-proxy.js000066400000000000000000000003561415504077600347610ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/cjs/chunks'use strict'; PLACEHOLDER((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/worker.js').href : new URL('worker.js', document.currentScript && document.currentScript.src || document.baseURI).href)); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/cjs/chunks/worker.js000066400000000000000000000001431415504077600336530ustar00rootroot00000000000000'use strict'; var shared = require('./shared.js'); postMessage(`from worker: ${shared.shared}`); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/cjs/main.js000066400000000000000000000014101415504077600317710ustar00rootroot00000000000000'use strict'; var shared = require('./chunks/shared.js'); const getWorkerMessage = () => new Promise(resolve => { const worker = new Worker((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __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-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/es/000077500000000000000000000000001415504077600303435ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/es/chunks/000077500000000000000000000000001415504077600316365ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/es/chunks/nested.js000066400000000000000000000003071415504077600334560ustar00rootroot00000000000000const getWorkerMessage = () => new Promise(resolve => { const worker = new Worker(new URL('worker-proxy.js', import.meta.url).href); worker.onmessage = resolve; }); export { getWorkerMessage }; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/es/chunks/shared.js000066400000000000000000000000621415504077600334400ustar00rootroot00000000000000const shared = 'shared'; export { shared as s }; worker-proxy.js000066400000000000000000000000711415504077600346030ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/es/chunksPLACEHOLDER(new URL('worker.js', import.meta.url).href); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/es/chunks/worker.js000066400000000000000000000001231415504077600335010ustar00rootroot00000000000000import { s as shared } from './shared.js'; postMessage(`from worker: ${shared}`); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/es/main.js000066400000000000000000000010241415504077600316220ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/system/000077500000000000000000000000001415504077600312605ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/system/chunks/000077500000000000000000000000001415504077600325535ustar00rootroot00000000000000nested.js000066400000000000000000000005321415504077600343140ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/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.js000066400000000000000000000002271415504077600343010ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/system/chunksSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const shared = exports('s', 'shared'); }) }; })); worker-proxy.js000066400000000000000000000001521415504077600355200ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/system/chunksimportScripts('../../../../../../../node_modules/systemjs/dist/system.js'); System.import('./worker.js'); worker.js000066400000000000000000000003461415504077600343460ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/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-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/system/main.js000066400000000000000000000013771415504077600325520ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/index-amd.html000066400000000000000000000003431415504077600305300ustar00rootroot00000000000000 AMD rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/index-system.html000066400000000000000000000004061415504077600313130ustar00rootroot00000000000000 SystemJS rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/main.js000066400000000000000000000005631415504077600272620ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/shared.js000066400000000000000000000000401415504077600275720ustar00rootroot00000000000000export const shared = 'shared'; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worker/worker.js000066400000000000000000000001111415504077600276340ustar00rootroot00000000000000import {shared} from './shared'; postMessage(`from worker: ${shared}`); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worklet/000077500000000000000000000000001415504077600261525ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worklet/_config.js000066400000000000000000000014001415504077600301070ustar00rootroot00000000000000const REGISTER_WORKLET = 'register-paint-worklet:'; module.exports = { description: 'allows adding additional chunks to be used in worklets', expectedWarnings: ['DEPRECATED_FEATURE'], options: { strictDeprecations: false, input: 'main', output: { chunkFileNames: 'chunks/[name].js' }, plugins: { load(id) { if (id.startsWith(REGISTER_WORKLET)) { return `CSS.paintWorklet.addModule(import.meta.ROLLUP_CHUNK_URL_${this.emitChunk( 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-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/000077500000000000000000000000001415504077600301125ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/amd/000077500000000000000000000000001415504077600306535ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/amd/chunks/000077500000000000000000000000001415504077600321465ustar00rootroot00000000000000shared.js000066400000000000000000000002351415504077600336730ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/amd/chunksdefine(['exports'], (function (exports) { 'use strict'; const color = 'greenyellow'; const size = 6; exports.color = color; exports.size = size; })); worklet.js000066400000000000000000000005141415504077600341140ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/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-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/amd/main.js000066400000000000000000000005041415504077600321340ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/cjs/000077500000000000000000000000001415504077600306715ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/cjs/chunks/000077500000000000000000000000001415504077600321645ustar00rootroot00000000000000shared.js000066400000000000000000000001511415504077600337060ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/cjs/chunks'use strict'; const color = 'greenyellow'; const size = 6; exports.color = color; exports.size = size; worklet.js000066400000000000000000000004651415504077600341370ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/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-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/cjs/main.js000066400000000000000000000007001415504077600321500ustar00rootroot00000000000000'use strict'; var shared = require('./chunks/shared.js'); CSS.paintWorklet.addModule((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __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-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/es/000077500000000000000000000000001415504077600305215ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/es/chunks/000077500000000000000000000000001415504077600320145ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/es/chunks/shared.js000066400000000000000000000001201415504077600336110ustar00rootroot00000000000000const color = 'greenyellow'; const size = 6; export { color as c, size as s }; worklet.js000066400000000000000000000004411415504077600337610ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/es/chunksimport { 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-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/es/main.js000066400000000000000000000004051415504077600320020ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/system/000077500000000000000000000000001415504077600314365ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/system/chunks/000077500000000000000000000000001415504077600327315ustar00rootroot00000000000000shared.js000066400000000000000000000002741415504077600344610ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/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.js000066400000000000000000000007461415504077600347060ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/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-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/system/main.js000066400000000000000000000006701415504077600327230ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worklet/index-es.html000066400000000000000000000002651415504077600305570ustar00rootroot00000000000000 ES rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worklet/main.js000066400000000000000000000003161415504077600274340ustar00rootroot00000000000000import 'register-paint-worklet:./worklet.js'; import { color, size } from './shared'; document.body.innerHTML += `

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

`; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worklet/shared.js000066400000000000000000000000731415504077600277560ustar00rootroot00000000000000export const color = 'greenyellow'; export const size = 6; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk-worklet/worklet.js000066400000000000000000000004241415504077600301770ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/deprecated/emit-chunk/000077500000000000000000000000001415504077600244655ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk/_config.js000066400000000000000000000007121415504077600264270ustar00rootroot00000000000000const assert = require('assert'); let referenceId; module.exports = { description: 'allows adding additional chunks and retrieving their file name', expectedWarnings: ['DEPRECATED_FEATURE'], options: { strictDeprecations: false, input: 'main', plugins: { buildStart() { referenceId = this.emitChunk('buildStart'); }, renderChunk() { assert.strictEqual(this.getChunkFileName(referenceId), 'generated-buildStart.js'); } } } }; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk/_expected/000077500000000000000000000000001415504077600264255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk/_expected/amd/000077500000000000000000000000001415504077600271665ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk/_expected/amd/generated-buildStart.js000066400000000000000000000001521415504077600335730ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log('startBuild', dep.value); })); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk/_expected/amd/generated-dep.js000066400000000000000000000001511415504077600322250ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var value = 42; exports.value = value; })); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk/_expected/amd/main.js000066400000000000000000000001441415504077600304470ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log('main', dep.value); })); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk/_expected/cjs/000077500000000000000000000000001415504077600272045ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk/_expected/cjs/generated-buildStart.js000066400000000000000000000001371415504077600336140ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('startBuild', dep.value); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk/_expected/cjs/generated-dep.js000066400000000000000000000000671415504077600322510ustar00rootroot00000000000000'use strict'; var value = 42; exports.value = value; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk/_expected/cjs/main.js000066400000000000000000000001311415504077600304610ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('main', dep.value); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk/_expected/es/000077500000000000000000000000001415504077600270345ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk/_expected/es/generated-buildStart.js000066400000000000000000000001241415504077600334400ustar00rootroot00000000000000import { v as value } from './generated-dep.js'; console.log('startBuild', value); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk/_expected/es/generated-dep.js000066400000000000000000000000501415504077600320710ustar00rootroot00000000000000var value = 42; export { value as v }; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk/_expected/es/main.js000066400000000000000000000001161415504077600303140ustar00rootroot00000000000000import { v as value } from './generated-dep.js'; console.log('main', value); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk/_expected/system/000077500000000000000000000000001415504077600277515ustar00rootroot00000000000000generated-buildStart.js000066400000000000000000000003461415504077600343040ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/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-2.61.1/test/chunking-form/samples/deprecated/emit-chunk/_expected/system/generated-dep.js000066400000000000000000000002161415504077600330120ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var value = exports('v', 42); }) }; })); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk/_expected/system/main.js000066400000000000000000000003401415504077600312300ustar00rootroot00000000000000System.register(['./generated-dep.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log('main', value); }) }; })); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk/buildStart.js000066400000000000000000000001011415504077600271300ustar00rootroot00000000000000import value from './dep.js'; console.log('startBuild', value); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk/dep.js000066400000000000000000000000231415504077600255660ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-chunk/main.js000066400000000000000000000000731415504077600257470ustar00rootroot00000000000000import value from './dep.js'; console.log('main', value); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-file-chunk-facade/000077500000000000000000000000001415504077600266035ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_config.js000066400000000000000000000007661415504077600305560ustar00rootroot00000000000000const assert = require('assert'); let referenceId; module.exports = { 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'); } } } }; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/000077500000000000000000000000001415504077600305435ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/amd/000077500000000000000000000000001415504077600313045ustar00rootroot00000000000000generated-build-starter.js000066400000000000000000000003111415504077600362730ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003341415504077600356340ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/amddefine(['exports', './generated-build-starter'], (function (exports, buildStarter) { 'use strict'; exports.buildStartValue = buildStarter.value; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/amd/main.js000066400000000000000000000002311415504077600325620ustar00rootroot00000000000000define(['./generated-build-starter'], (function (buildStarter) { 'use strict'; console.log('main', buildStarter.value, buildStarter.otherValue); })); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/cjs/000077500000000000000000000000001415504077600313225ustar00rootroot00000000000000generated-build-starter.js000066400000000000000000000002241415504077600363140ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002741415504077600356550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var buildStarter = require('./generated-build-starter.js'); exports.buildStartValue = buildStarter.value; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/cjs/main.js000066400000000000000000000002161415504077600326030ustar00rootroot00000000000000'use strict'; var buildStarter = require('./generated-build-starter.js'); console.log('main', buildStarter.value, buildStarter.otherValue); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/es/000077500000000000000000000000001415504077600311525ustar00rootroot00000000000000generated-build-starter.js000066400000000000000000000001651415504077600361500ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001051415504077600354760ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/esexport { v as buildStartValue } from './generated-build-starter.js'; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/es/main.js000066400000000000000000000001651415504077600324360ustar00rootroot00000000000000import { v as value, o as otherValue } from './generated-build-starter.js'; console.log('main', value, otherValue); rollup-2.61.1/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/system/000077500000000000000000000000001415504077600320675ustar00rootroot00000000000000generated-build-starter.js000066400000000000000000000003361415504077600370650ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003331415504077600364160ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_expected/system/main.js000066400000000000000000000004341415504077600333520ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/deprecated/emit-file-chunk-facade/buildStart.js000066400000000000000000000001511415504077600312530ustar00rootroot00000000000000import {value} from './dep.js'; console.log('startBuild', value); export { value as buildStartValue }; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-file-chunk-facade/dep.js000066400000000000000000000000671415504077600277140ustar00rootroot00000000000000export const value = 42; export const otherValue = 43; rollup-2.61.1/test/chunking-form/samples/deprecated/emit-file-chunk-facade/main.js000066400000000000000000000001241415504077600300620ustar00rootroot00000000000000import { value, otherValue } from './dep'; console.log('main', value, otherValue); rollup-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/000077500000000000000000000000001415504077600315525ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_config.js000066400000000000000000000003501415504077600335120ustar00rootroot00000000000000module.exports = { description: 'does not drop indirect reexports when preserving modules', expectedWarnings: ['MIXED_EXPORTS'], options: { strictDeprecations: false, output: { name: 'bundle' }, preserveModules: true } }; rollup-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/000077500000000000000000000000001415504077600335125ustar00rootroot00000000000000amd/000077500000000000000000000000001415504077600341745ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expectedcomponents/000077500000000000000000000000001415504077600363615ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/amdindex.js000066400000000000000000000003551415504077600400310ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); sub/000077500000000000000000000000001415504077600371525ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/amd/componentsindex.js000066400000000000000000000003311415504077600406140ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003701415504077600354560ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); cjs/000077500000000000000000000000001415504077600342125ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expectedcomponents/000077500000000000000000000000001415504077600363775ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjsindex.js000066400000000000000000000003131415504077600400410ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjs/components'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var index = require('./sub/index.js'); const baz = { bar: index["default"] }; exports.foo = index.foo; exports.baz = baz; sub/000077500000000000000000000000001415504077600371705ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjs/componentsindex.js000066400000000000000000000002441415504077600406350ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003501415504077600354720ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var index = require('./components/index.js'); var index$1 = require('./components/sub/index.js'); exports.baz = index.baz; exports.foo = index$1.foo; es/000077500000000000000000000000001415504077600340425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expectedcomponents/000077500000000000000000000000001415504077600362275ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/esindex.js000066400000000000000000000001571415504077600376770ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600370205ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/es/componentsindex.js000066400000000000000000000001101415504077600404550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/es/components/subconst foo = 'bar'; var bar = () => {}; export { bar as default, foo }; main.js000066400000000000000000000001361415504077600353240ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/esexport { baz } from './components/index.js'; export { foo } from './components/sub/index.js'; system/000077500000000000000000000000001415504077600347575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expectedcomponents/000077500000000000000000000000001415504077600371445ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/systemindex.js000066400000000000000000000004321415504077600406100ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600377355ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_expected/system/componentsindex.js000066400000000000000000000003101415504077600413740ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000004511415504077600362410ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/components/000077500000000000000000000000001415504077600337375ustar00rootroot00000000000000index.js000066400000000000000000000001251415504077600353230ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/componentsimport bar, { foo } from './sub/index'; export const baz = { bar }; export { foo }; sub/000077500000000000000000000000001415504077600344515ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/componentsindex.js000066400000000000000000000000751415504077600361200ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/components/subconst foo = 'bar'; export { foo }; export default () => {}; rollup-2.61.1/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/main.js000066400000000000000000000001051415504077600330300ustar00rootroot00000000000000import { baz, foo } from './components/index'; export { baz, foo }; interop-per-reexported-default-dependency-boolean/000077500000000000000000000000001415504077600341405ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated_config.js000066400000000000000000000005301415504077600361000ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/interop-per-reexported-default-dependency-booleanmodule.exports = { description: 'allows to configure the interop type per reexported default from an external dependency for boolean values', options: { strictDeprecations: false, input: ['false', 'true'], external: id => id.startsWith('external'), output: { interop(id) { return JSON.parse(id.split('-')[1]); } } } }; _expected/000077500000000000000000000000001415504077600361005ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/interop-per-reexported-default-dependency-booleanamd/000077500000000000000000000000001415504077600366415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/interop-per-reexported-default-dependency-boolean/_expectedfalse.js000066400000000000000000000001451415504077600402710ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/interop-per-reexported-default-dependency-boolean/_expected/amddefine(['external-false'], (function (externalFalse) { 'use strict'; return externalFalse; })); true.js000066400000000000000000000004731415504077600401620ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/interop-per-reexported-default-dependency-boolean/_expected/amddefine(['external-true'], (function (externalTrue) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var externalTrue__default = /*#__PURE__*/_interopDefaultLegacy(externalTrue); return externalTrue__default["default"]; })); cjs/000077500000000000000000000000001415504077600366575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/interop-per-reexported-default-dependency-boolean/_expectedfalse.js000066400000000000000000000001411415504077600403030ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/interop-per-reexported-default-dependency-boolean/_expected/cjs'use strict'; var externalFalse = require('external-false'); module.exports = externalFalse; true.js000066400000000000000000000004651415504077600402010ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/interop-per-reexported-default-dependency-boolean/_expected/cjs'use strict'; var externalTrue = require('external-true'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var externalTrue__default = /*#__PURE__*/_interopDefaultLegacy(externalTrue); module.exports = externalTrue__default["default"]; es/000077500000000000000000000000001415504077600365075ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/interop-per-reexported-default-dependency-boolean/_expectedfalse.js000066400000000000000000000000521415504077600401340ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/interop-per-reexported-default-dependency-boolean/_expected/esexport { default } from 'external-false'; true.js000066400000000000000000000000511415504077600400200ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/interop-per-reexported-default-dependency-boolean/_expected/esexport { default } from 'external-true'; system/000077500000000000000000000000001415504077600374245ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/interop-per-reexported-default-dependency-boolean/_expectedfalse.js000066400000000000000000000003161415504077600410540ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/interop-per-reexported-default-dependency-boolean/_expected/systemSystem.register(['external-false'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('default', module["default"]); }], execute: (function () { }) }; })); true.js000066400000000000000000000003151415504077600407400ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/interop-per-reexported-default-dependency-boolean/_expected/systemSystem.register(['external-true'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('default', module["default"]); }], execute: (function () { }) }; })); false.js000066400000000000000000000000521415504077600355650ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/interop-per-reexported-default-dependency-booleanexport { default } from 'external-false'; true.js000066400000000000000000000000511415504077600354510ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/interop-per-reexported-default-dependency-booleanexport { default } from 'external-true'; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/000077500000000000000000000000001415504077600273055ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_config.js000066400000000000000000000003161415504077600312470ustar00rootroot00000000000000module.exports = { description: 'avoid facades if possible when using manual chunks', options: { strictDeprecations: false, input: ['main1', 'main2'], manualChunks: { manual: ['main2'] } } }; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/000077500000000000000000000000001415504077600312455ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/amd/000077500000000000000000000000001415504077600320065ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/amd/main1.js000066400000000000000000000001471415504077600333530ustar00rootroot00000000000000define(['./main2'], (function (manual) { 'use strict'; console.log('main', manual.reexported); })); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/amd/main2.js000066400000000000000000000003201415504077600333450ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const value = 42; console.log('main2', value); exports.reexported = value; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/cjs/000077500000000000000000000000001415504077600320245ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/cjs/main1.js000066400000000000000000000001341415504077600333650ustar00rootroot00000000000000'use strict'; var manual = require('./main2.js'); console.log('main', manual.reexported); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/cjs/main2.js000066400000000000000000000002341415504077600333670ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const value = 42; console.log('main2', value); exports.reexported = value; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/es/000077500000000000000000000000001415504077600316545ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/es/main1.js000066400000000000000000000001171415504077600332160ustar00rootroot00000000000000import { reexported as value } from './main2.js'; console.log('main', value); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/es/main2.js000066400000000000000000000001211415504077600332120ustar00rootroot00000000000000const value = 42; console.log('main2', value); export { value as reexported }; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_expected/system/000077500000000000000000000000001415504077600325715ustar00rootroot00000000000000main1.js000066400000000000000000000003411415504077600340530ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002721415504077600340570ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/dep.js000066400000000000000000000000311415504077600304050ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/main1.js000066400000000000000000000000741415504077600306510ustar00rootroot00000000000000import { value } from './dep'; console.log('main', value); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/main2.js000066400000000000000000000001371415504077600306520ustar00rootroot00000000000000import {value} from './dep.js'; console.log('main2', value); export { value as reexported }; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/000077500000000000000000000000001415504077600315565ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_config.js000066400000000000000000000004021415504077600335140ustar00rootroot00000000000000module.exports = { 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'] } } }; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/000077500000000000000000000000001415504077600335165ustar00rootroot00000000000000amd/000077500000000000000000000000001415504077600342005ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expectedmain.js000066400000000000000000000003311415504077600354570ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); main2.js000066400000000000000000000000751415504077600355460ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/amddefine(['./main'], (function (outer) { 'use strict'; })); cjs/000077500000000000000000000000001415504077600342165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expectedmain.js000066400000000000000000000002441415504077600355000ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); console.log('dep'); console.log('main'); const value = 42; exports.value = value; main2.js000066400000000000000000000000461415504077600355620ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/cjs'use strict'; require('./main.js'); es/000077500000000000000000000000001415504077600340465ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expectedmain.js000066400000000000000000000001201415504077600353210ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/esconsole.log('dep'); console.log('main'); const value = 42; export { value }; main2.js000066400000000000000000000000241415504077600354060ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/esimport './main.js'; system/000077500000000000000000000000001415504077600347635ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expectedmain.js000066400000000000000000000003051415504077600362430ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002171415504077600363270ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_expected/systemSystem.register(['./main.js'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/dep.js000066400000000000000000000000241415504077600326600ustar00rootroot00000000000000console.log('dep'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/main.js000066400000000000000000000001031415504077600330320ustar00rootroot00000000000000import './dep.js'; console.log('main'); export const value = 42; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/main2.js000066400000000000000000000000231415504077600331150ustar00rootroot00000000000000import './dep.js'; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/outer.js000066400000000000000000000000501415504077600332450ustar00rootroot00000000000000import './main'; console.log('outer'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/000077500000000000000000000000001415504077600310515ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_config.js000066400000000000000000000003701415504077600330130ustar00rootroot00000000000000module.exports = { 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'] } } }; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/000077500000000000000000000000001415504077600330115ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/amd/000077500000000000000000000000001415504077600335525ustar00rootroot00000000000000main.js000066400000000000000000000003311415504077600347520ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/cjs/000077500000000000000000000000001415504077600335705ustar00rootroot00000000000000main.js000066400000000000000000000002441415504077600347730ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); console.log('dep'); console.log('main'); const value = 42; exports.value = value; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/es/000077500000000000000000000000001415504077600334205ustar00rootroot00000000000000main.js000066400000000000000000000001201415504077600346140ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expected/esconsole.log('dep'); console.log('main'); const value = 42; export { value }; system/000077500000000000000000000000001415504077600342565ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_expectedmain.js000066400000000000000000000003051415504077600355360ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/dep.js000066400000000000000000000000241415504077600321530ustar00rootroot00000000000000console.log('dep'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/main.js000066400000000000000000000001031415504077600323250ustar00rootroot00000000000000import './dep.js'; console.log('main'); export const value = 42; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/outer.js000066400000000000000000000000501415504077600325400ustar00rootroot00000000000000import './main'; console.log('outer'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/000077500000000000000000000000001415504077600303535ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_config.js000066400000000000000000000003751415504077600323220ustar00rootroot00000000000000module.exports = { 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'] } } }; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/000077500000000000000000000000001415504077600323135ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/amd/000077500000000000000000000000001415504077600330545ustar00rootroot00000000000000main.js000066400000000000000000000003311415504077600342540ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); main2.js000066400000000000000000000000751415504077600343430ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/amddefine(['./main'], (function (other) { 'use strict'; })); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/cjs/000077500000000000000000000000001415504077600330725ustar00rootroot00000000000000main.js000066400000000000000000000002441415504077600342750ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); console.log('dep'); console.log('main'); const value = 42; exports.value = value; main2.js000066400000000000000000000000461415504077600343570ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/cjs'use strict'; require('./main.js'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/es/000077500000000000000000000000001415504077600327225ustar00rootroot00000000000000main.js000066400000000000000000000001201415504077600341160ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/esconsole.log('dep'); console.log('main'); const value = 42; export { value }; main2.js000066400000000000000000000000241415504077600342030ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/esimport './main.js'; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/system/000077500000000000000000000000001415504077600336375ustar00rootroot00000000000000main.js000066400000000000000000000003051415504077600350400ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002171415504077600351240ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_expected/systemSystem.register(['./main.js'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/dep.js000066400000000000000000000000241415504077600314550ustar00rootroot00000000000000console.log('dep'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/main.js000066400000000000000000000001031415504077600316270ustar00rootroot00000000000000import './dep.js'; console.log('main'); export const value = 42; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/main2.js000066400000000000000000000000231415504077600317120ustar00rootroot00000000000000import './dep.js'; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/000077500000000000000000000000001415504077600276465ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_config.js000066400000000000000000000003761415504077600316160ustar00rootroot00000000000000module.exports = { 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'] } } }; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/000077500000000000000000000000001415504077600316065ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/amd/000077500000000000000000000000001415504077600323475ustar00rootroot00000000000000main.js000066400000000000000000000003311415504077600335470ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/cjs/000077500000000000000000000000001415504077600323655ustar00rootroot00000000000000main.js000066400000000000000000000002441415504077600335700ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); console.log('dep'); console.log('main'); const value = 42; exports.value = value; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/es/000077500000000000000000000000001415504077600322155ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/es/main.js000066400000000000000000000001201415504077600334700ustar00rootroot00000000000000console.log('dep'); console.log('main'); const value = 42; export { value }; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_expected/system/000077500000000000000000000000001415504077600331325ustar00rootroot00000000000000main.js000066400000000000000000000003051415504077600343330ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/dep.js000066400000000000000000000000241415504077600307500ustar00rootroot00000000000000console.log('dep'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/main.js000066400000000000000000000001031415504077600311220ustar00rootroot00000000000000import './dep.js'; console.log('main'); export const value = 42; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-different-nested/000077500000000000000000000000001415504077600304135ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_config.js000066400000000000000000000004361415504077600323600ustar00rootroot00000000000000module.exports = { 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'] } } }; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/000077500000000000000000000000001415504077600323535ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amd/000077500000000000000000000000001415504077600331145ustar00rootroot00000000000000generated-manual-inner.js000066400000000000000000000001021415504077600377060ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amddefine((function () { 'use strict'; console.log('inner'); })); generated-manual-middle.js000066400000000000000000000001541415504077600400400ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amddefine(['./generated-manual-inner'], (function (manualInner) { 'use strict'; console.log('middle'); })); generated-manual-outer.js000066400000000000000000000001551415504077600377410ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/amddefine(['./generated-manual-middle'], (function (manualMiddle) { 'use strict'; console.log('outer'); })); main.js000066400000000000000000000002761415504077600343240ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs/000077500000000000000000000000001415504077600331325ustar00rootroot00000000000000generated-manual-inner.js000066400000000000000000000000451415504077600377320ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs'use strict'; console.log('inner'); generated-manual-middle.js000066400000000000000000000001171415504077600400550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs'use strict'; require('./generated-manual-inner.js'); console.log('middle'); generated-manual-outer.js000066400000000000000000000001171415504077600377550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/cjs'use strict'; require('./generated-manual-middle.js'); console.log('outer'); main.js000066400000000000000000000002361415504077600343360ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/es/000077500000000000000000000000001415504077600327625ustar00rootroot00000000000000generated-manual-inner.js000066400000000000000000000000261415504077600375610ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/esconsole.log('inner'); generated-manual-middle.js000066400000000000000000000000761415504077600377110ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/esimport './generated-manual-inner.js'; console.log('middle'); generated-manual-outer.js000066400000000000000000000000761415504077600376110ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/esimport './generated-manual-middle.js'; console.log('outer'); main.js000066400000000000000000000002111415504077600341570ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/system/000077500000000000000000000000001415504077600336775ustar00rootroot00000000000000generated-manual-inner.js000066400000000000000000000001771415504077600405050ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('inner'); }) }; })); generated-manual-middle.js000066400000000000000000000002721415504077600406240ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/systemSystem.register(['./generated-manual-inner.js'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { console.log('middle'); }) }; })); generated-manual-outer.js000066400000000000000000000002721415504077600405240ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_expected/systemSystem.register(['./generated-manual-middle.js'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { console.log('outer'); }) }; })); main.js000066400000000000000000000004271415504077600351050ustar00rootroot00000000000000rollup-2.61.1/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: [function () {}, function () {}, function () {}], execute: (function () { console.log('main'); }) }; })); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-different-nested/inner.js000066400000000000000000000000261415504077600320620ustar00rootroot00000000000000console.log('inner'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-different-nested/main.js000066400000000000000000000000531415504077600316730ustar00rootroot00000000000000import './outer.js'; console.log('main'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-different-nested/middle.js000066400000000000000000000000551415504077600322070ustar00rootroot00000000000000import './inner.js'; console.log('middle'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-different-nested/outer.js000066400000000000000000000000551415504077600321070ustar00rootroot00000000000000import './middle.js'; console.log('outer'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/000077500000000000000000000000001415504077600301755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_config.js000066400000000000000000000003221415504077600321340ustar00rootroot00000000000000module.exports = { description: 'creates facades for dynamic manual chunks if necessary', options: { strictDeprecations: false, input: ['main.js'], manualChunks: { dynamic: ['dynamic1.js'] } } }; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/000077500000000000000000000000001415504077600321355ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/amd/000077500000000000000000000000001415504077600326765ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000011701415504077600365340ustar00rootroot00000000000000rollup-2.61.1/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, DYNAMIC_1: DYNAMIC_1, DEP: DEP, DYNAMIC_2: DYNAMIC_2, DYNAMIC_3: DYNAMIC_3 }); exports.DEP = DEP; exports.dynamic1 = dynamic1; exports.dynamic2 = dynamic2; exports.dynamic3 = dynamic3; })); main.js000066400000000000000000000011051415504077600340760ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/cjs/000077500000000000000000000000001415504077600327145ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000010611415504077600365510ustar00rootroot00000000000000rollup-2.61.1/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, DYNAMIC_1: DYNAMIC_1, DEP: DEP, DYNAMIC_2: DYNAMIC_2, DYNAMIC_3: DYNAMIC_3 }); exports.DEP = DEP; exports.dynamic1 = dynamic1; exports.dynamic2 = dynamic2; exports.dynamic3 = dynamic3; main.js000066400000000000000000000007751415504077600341300ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/es/000077500000000000000000000000001415504077600325445ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000007721415504077600364110ustar00rootroot00000000000000rollup-2.61.1/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, DYNAMIC_1: DYNAMIC_1, DEP: DEP, DYNAMIC_2: DYNAMIC_2, DYNAMIC_3: DYNAMIC_3 }); export { DEP as D, dynamic3 as a, dynamic1 as b, dynamic2 as d }; main.js000066400000000000000000000005001415504077600337420ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_expected/system/000077500000000000000000000000001415504077600334615ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000012741415504077600373240ustar00rootroot00000000000000rollup-2.61.1/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, DYNAMIC_1: DYNAMIC_1, DEP: DEP, DYNAMIC_2: DYNAMIC_2, DYNAMIC_3: DYNAMIC_3 }); exports('b', dynamic1); }) }; })); main.js000066400000000000000000000007721415504077600346720ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dep.js000066400000000000000000000000321415504077600312760ustar00rootroot00000000000000export const DEP = 'DEP'; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dynamic1.js000066400000000000000000000001761415504077600322440ustar00rootroot00000000000000export * from './dep.js'; export * from './dynamic2.js'; export * from './dynamic3.js'; export const DYNAMIC_1 = 'DYNAMIC_1'; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dynamic2.js000066400000000000000000000000461415504077600322410ustar00rootroot00000000000000export const DYNAMIC_2 = 'DYNAMIC_2'; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/dynamic3.js000066400000000000000000000000461415504077600322420ustar00rootroot00000000000000export const DYNAMIC_3 = 'DYNAMIC_3'; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/main.js000066400000000000000000000002461415504077600314610ustar00rootroot00000000000000import { DEP } from './dep'; Promise.all([import('./dynamic1.js'), import('./dynamic2.js'), import('./dynamic3.js')]).then( results => console.log(results, DEP) ); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/000077500000000000000000000000001415504077600313265ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_config.js000066400000000000000000000003031415504077600332640ustar00rootroot00000000000000module.exports = { description: 'handles name conflicts in manual chunks', options: { strictDeprecations: false, input: ['main.js'], manualChunks: { dynamic: ['dynamic1.js'] } } }; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expected/000077500000000000000000000000001415504077600332665ustar00rootroot00000000000000amd/000077500000000000000000000000001415504077600337505ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expectedgenerated-dynamic.js000066400000000000000000000007341415504077600376720ustar00rootroot00000000000000rollup-2.61.1/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_B: DYNAMIC_A, DYNAMIC_A: DYNAMIC_B }); exports.dynamic1 = dynamic1; exports.dynamic2 = dynamic2; })); main.js000066400000000000000000000006351415504077600352360ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600337665ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expectedgenerated-dynamic.js000066400000000000000000000006341415504077600377070ustar00rootroot00000000000000rollup-2.61.1/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_B: DYNAMIC_A, DYNAMIC_A: DYNAMIC_B }); exports.dynamic1 = dynamic1; exports.dynamic2 = dynamic2; main.js000066400000000000000000000005211415504077600352460ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600336165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expectedgenerated-dynamic.js000066400000000000000000000005741415504077600375420ustar00rootroot00000000000000rollup-2.61.1/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_B: DYNAMIC_A, DYNAMIC_A: DYNAMIC_B }); export { dynamic1 as a, dynamic2 as d }; main.js000066400000000000000000000003221415504077600350750ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600345335ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_expectedgenerated-dynamic.js000066400000000000000000000010371415504077600404520ustar00rootroot00000000000000rollup-2.61.1/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_B: DYNAMIC_A, DYNAMIC_A: DYNAMIC_B }); exports('a', dynamic1); }) }; })); main.js000066400000000000000000000005331415504077600360160ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/dynamic1.js000066400000000000000000000001471415504077600333730ustar00rootroot00000000000000console.log('dynamic1'); export { DYNAMIC_A as DYNAMIC_B, DYNAMIC_B as DYNAMIC_A } from './dynamic2'; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/dynamic2.js000066400000000000000000000001461415504077600333730ustar00rootroot00000000000000console.log('dynamic2'); export const DYNAMIC_A = 'DYNAMIC_A'; export const DYNAMIC_B = 'DYNAMIC_B'; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/main.js000066400000000000000000000001721415504077600326100ustar00rootroot00000000000000import('./dynamic1.js').then(result => console.log(result)); import('./dynamic2.js').then(result => console.log(result)); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic/000077500000000000000000000000001415504077600266115ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_config.js000066400000000000000000000002711415504077600305530ustar00rootroot00000000000000module.exports = { description: 'supports dynamic manual chunks', options: { strictDeprecations: false, input: ['main.js'], manualChunks: { dynamic: ['dynamic.js'] } } }; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/000077500000000000000000000000001415504077600305515ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/amd/000077500000000000000000000000001415504077600313125ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000002401415504077600351450ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/amd/main.js000066400000000000000000000003361415504077600325760ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/cjs/000077500000000000000000000000001415504077600313305ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001561415504077600351710ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/cjs/main.js000066400000000000000000000002401415504077600326060ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(({DYNAMIC_USED_BY_A}) => console.log(DYNAMIC_USED_BY_A)); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/es/000077500000000000000000000000001415504077600311605ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001161415504077600350150ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/esconst DYNAMIC_USED_BY_A = 'DYNAMIC_USED_BY_A'; export { DYNAMIC_USED_BY_A }; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/es/main.js000066400000000000000000000001401415504077600324350ustar00rootroot00000000000000import('./generated-dynamic.js').then(({DYNAMIC_USED_BY_A}) => console.log(DYNAMIC_USED_BY_A)); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/system/000077500000000000000000000000001415504077600320755ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000002751415504077600357400ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_expected/system/main.js000066400000000000000000000003371415504077600333620ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic/dynamic.js000066400000000000000000000000651415504077600305740ustar00rootroot00000000000000export const DYNAMIC_USED_BY_A = 'DYNAMIC_USED_BY_A';rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-dynamic/main.js000066400000000000000000000001261415504077600300720ustar00rootroot00000000000000import('./dynamic.js').then(({DYNAMIC_USED_BY_A}) => console.log(DYNAMIC_USED_BY_A)); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/000077500000000000000000000000001415504077600270125ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/_config.js000066400000000000000000000004011415504077600307470ustar00rootroot00000000000000module.exports = { 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]}`; } } } }; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/000077500000000000000000000000001415504077600307525ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amd/000077500000000000000000000000001415504077600315135ustar00rootroot00000000000000generated-chunk-b.js000066400000000000000000000001311415504077600352500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amddefine((function () { 'use strict'; console.log('dep2'); console.log('dep-b'); })); generated-chunk-c.js000066400000000000000000000001411415504077600352520ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amddefine(['./generated-chunk-b'], (function (chunkB) { 'use strict'; console.log('dep-c'); })); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/amd/main-a.js000066400000000000000000000002601415504077600332110ustar00rootroot00000000000000define(['./generated-chunk-c', './generated-chunk-b'], (function (chunkC, chunkB) { 'use strict'; console.log('dep1'); console.log('dep-a'); console.log('main-a'); })); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs/000077500000000000000000000000001415504077600315315ustar00rootroot00000000000000generated-chunk-b.js000066400000000000000000000000731415504077600352730ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs'use strict'; console.log('dep2'); console.log('dep-b'); generated-chunk-c.js000066400000000000000000000001111415504077600352650ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs'use strict'; require('./generated-chunk-b.js'); console.log('dep-c'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/cjs/main-a.js000066400000000000000000000002321415504077600332260ustar00rootroot00000000000000'use strict'; require('./generated-chunk-c.js'); require('./generated-chunk-b.js'); console.log('dep1'); console.log('dep-a'); console.log('main-a'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/es/000077500000000000000000000000001415504077600313615ustar00rootroot00000000000000generated-chunk-b.js000066400000000000000000000000541415504077600351220ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/esconsole.log('dep2'); console.log('dep-b'); generated-chunk-c.js000066400000000000000000000000701415504077600351210ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/esimport './generated-chunk-b.js'; console.log('dep-c'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/es/main-a.js000066400000000000000000000002071415504077600330600ustar00rootroot00000000000000import './generated-chunk-c.js'; import './generated-chunk-b.js'; console.log('dep1'); console.log('dep-a'); console.log('main-a'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/system/000077500000000000000000000000001415504077600322765ustar00rootroot00000000000000generated-chunk-b.js000066400000000000000000000002301415504077600360330ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002641415504077600360430ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/systemSystem.register(['./generated-chunk-b.js'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { console.log('dep-c'); }) }; })); main-a.js000066400000000000000000000004221415504077600337150ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/_expected/systemSystem.register(['./generated-chunk-c.js', './generated-chunk-b.js'], (function () { 'use strict'; return { setters: [function () {}, function () {}], execute: (function () { console.log('dep1'); console.log('dep-a'); console.log('main-a'); }) }; })); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/dep-a.js000066400000000000000000000000721415504077600303350ustar00rootroot00000000000000import './dep-c'; import './dep1'; console.log('dep-a'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/dep-b.js000066400000000000000000000000501415504077600303320ustar00rootroot00000000000000import './dep2'; console.log('dep-b'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/dep-c.js000066400000000000000000000000501415504077600303330ustar00rootroot00000000000000import './dep2'; console.log('dep-c'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/dep1.js000066400000000000000000000000251415504077600301760ustar00rootroot00000000000000console.log('dep1'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/dep2.js000066400000000000000000000000251415504077600301770ustar00rootroot00000000000000console.log('dep2'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-function/main-a.js000066400000000000000000000000741415504077600305130ustar00rootroot00000000000000import './dep-a'; import './dep-b'; console.log('main-a'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-nested/000077500000000000000000000000001415504077600264475ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-nested/_config.js000066400000000000000000000003311415504077600304060ustar00rootroot00000000000000module.exports = { description: 'manual chunks can contain nested modules', options: { strictDeprecations: false, input: ['main.js'], manualChunks: { manual: ['middle.js', 'inner.js', 'outer.js'] } } }; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/000077500000000000000000000000001415504077600304075ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/amd/000077500000000000000000000000001415504077600311505ustar00rootroot00000000000000generated-manual.js000066400000000000000000000001631415504077600346400ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/amddefine((function () { 'use strict'; console.log('inner'); console.log('middle'); console.log('outer'); })); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/amd/main.js000066400000000000000000000001371415504077600324330ustar00rootroot00000000000000define(['./generated-manual'], (function (manual) { 'use strict'; console.log('main'); })); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/cjs/000077500000000000000000000000001415504077600311665ustar00rootroot00000000000000generated-manual.js000066400000000000000000000001241415504077600346530ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/cjs'use strict'; console.log('inner'); console.log('middle'); console.log('outer'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/cjs/main.js000066400000000000000000000001071415504077600324460ustar00rootroot00000000000000'use strict'; require('./generated-manual.js'); console.log('main'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/es/000077500000000000000000000000001415504077600310165ustar00rootroot00000000000000generated-manual.js000066400000000000000000000001051415504077600345020ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/esconsole.log('inner'); console.log('middle'); console.log('outer'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/es/main.js000066400000000000000000000000661415504077600323020ustar00rootroot00000000000000import './generated-manual.js'; console.log('main'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/system/000077500000000000000000000000001415504077600317335ustar00rootroot00000000000000generated-manual.js000066400000000000000000000002641415504077600354250ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-nested/_expected/system/main.js000066400000000000000000000002621415504077600332150ustar00rootroot00000000000000System.register(['./generated-manual.js'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { console.log('main'); }) }; })); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-nested/inner.js000066400000000000000000000000261415504077600301160ustar00rootroot00000000000000console.log('inner'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-nested/main.js000066400000000000000000000000531415504077600277270ustar00rootroot00000000000000import './outer.js'; console.log('main'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-nested/middle.js000066400000000000000000000000551415504077600302430ustar00rootroot00000000000000import './inner.js'; console.log('middle'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks-nested/outer.js000066400000000000000000000000551415504077600301430ustar00rootroot00000000000000import './middle.js'; console.log('outer'); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks/000077500000000000000000000000001415504077600251675ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks/_config.js000066400000000000000000000003201415504077600271240ustar00rootroot00000000000000module.exports = { description: 'manual chunks support', options: { strictDeprecations: false, input: ['main.js'], manualChunks: { lib1: ['lib1.js'], deps2and3: ['dep2.js', 'dep3.js'] } } }; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks/_expected/000077500000000000000000000000001415504077600271275ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks/_expected/amd/000077500000000000000000000000001415504077600276705ustar00rootroot00000000000000generated-deps2and3.js000066400000000000000000000004761415504077600336750ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/manual-chunks/_expected/amd/generated-lib1.js000066400000000000000000000002061415504077600330070ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function fn () { console.log('lib1 fn'); } exports.fn = fn; })); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks/_expected/amd/main.js000066400000000000000000000004251415504077600311530ustar00rootroot00000000000000define(['./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-2.61.1/test/chunking-form/samples/deprecated/manual-chunks/_expected/cjs/000077500000000000000000000000001415504077600277065ustar00rootroot00000000000000generated-deps2and3.js000066400000000000000000000004061415504077600337040ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/manual-chunks/_expected/cjs/generated-lib1.js000066400000000000000000000001161415504077600330250ustar00rootroot00000000000000'use strict'; function fn () { console.log('lib1 fn'); } exports.fn = fn; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks/_expected/cjs/main.js000066400000000000000000000004051415504077600311670ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/deprecated/manual-chunks/_expected/es/000077500000000000000000000000001415504077600275365ustar00rootroot00000000000000generated-deps2and3.js000066400000000000000000000003631415504077600335360ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/manual-chunks/_expected/es/generated-lib1.js000066400000000000000000000001021415504077600326500ustar00rootroot00000000000000function fn () { console.log('lib1 fn'); } export { fn as f }; rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks/_expected/es/main.js000066400000000000000000000003631415504077600310220ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/deprecated/manual-chunks/_expected/system/000077500000000000000000000000001415504077600304535ustar00rootroot00000000000000generated-deps2and3.js000066400000000000000000000007631415504077600344570ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/manual-chunks/_expected/system/generated-lib1.js000066400000000000000000000003141415504077600335720ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('f', fn); function fn () { console.log('lib1 fn'); } }) }; })); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks/_expected/system/main.js000066400000000000000000000007531415504077600317420ustar00rootroot00000000000000System.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; }, function () {}], execute: (function () { function fn () { console.log('dep1 fn'); } class Main { constructor () { fn(); fn$1(); fn$2(); } } exports('default', Main); }) }; })); rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks/dep1.js000066400000000000000000000000631415504077600263550ustar00rootroot00000000000000export function fn () { console.log('dep1 fn'); }rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks/dep2.js000066400000000000000000000001501415504077600263530ustar00rootroot00000000000000import { fn as libfn } from './lib2.js'; export function fn () { libfn(); console.log('dep2 fn'); }rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks/dep3.js000066400000000000000000000002201415504077600263520ustar00rootroot00000000000000import { fn as libfn, treeshaked } from './lib1.js'; export function fn () { libfn(); console.log('dep3 fn'); } export default treeshaked;rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks/lib1.js000066400000000000000000000001751415504077600263570ustar00rootroot00000000000000export function fn () { console.log('lib1 fn'); } export function treeshaked () { console.log('this is tree shaken!'); }rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks/lib2.js000066400000000000000000000000631415504077600263540ustar00rootroot00000000000000export function fn () { console.log('lib2 fn'); }rollup-2.61.1/test/chunking-form/samples/deprecated/manual-chunks/main.js000066400000000000000000000003721415504077600264530ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/000077500000000000000000000000001415504077600315045ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_config.js000066400000000000000000000004001415504077600334400ustar00rootroot00000000000000module.exports = { description: 'handles using dependencies with shimmed missing exports as ', expectedWarnings: ['SHIMMED_EXPORT'], options: { strictDeprecations: false, input: ['main.js'], preserveModules: true, shimMissingExports: true } }; rollup-2.61.1/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/000077500000000000000000000000001415504077600334445ustar00rootroot00000000000000amd/000077500000000000000000000000001415504077600341265ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expecteddep1.js000066400000000000000000000006441415504077600353210ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); dep2.js000066400000000000000000000006251415504077600353210ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); main.js000066400000000000000000000002231415504077600354050ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600341445ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expecteddep1.js000066400000000000000000000005521415504077600353350ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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.js000066400000000000000000000005361415504077600353400ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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.js000066400000000000000000000002311415504077600354220ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600337745ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expecteddep1.js000066400000000000000000000004371415504077600351670ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000004141415504077600351630ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003671415504077600352640ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600347115ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_expecteddep1.js000066400000000000000000000006451415504077600361050ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000005711415504077600361040ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000007361415504077600362010ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/dep1.js000066400000000000000000000003211415504077600326670ustar00rootroot00000000000000console.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-2.61.1/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/dep2.js000066400000000000000000000003011415504077600326660ustar00rootroot00000000000000console.log('This is the output when a missing export is reexported'); var _missingExportShim = void 0; console.log(_missingExportShim); export {_missingExportShim as previousShimmedExport} rollup-2.61.1/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/main.js000066400000000000000000000002341415504077600327650ustar00rootroot00000000000000import { missing1 } from './dep1.js'; import { missing2, previousShimmedExport } from './dep2.js'; console.log(missing1, missing2, previousShimmedExport); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/000077500000000000000000000000001415504077600311315ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_config.js000066400000000000000000000003001415504077600330640ustar00rootroot00000000000000module.exports = { description: 'Uses entry point semantics for all files when preserving modules', options: { strictDeprecations: false, input: 'main.js', preserveModules: true } }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/000077500000000000000000000000001415504077600330715ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/amd/000077500000000000000000000000001415504077600336325ustar00rootroot00000000000000default.js000066400000000000000000000001171415504077600355340ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/amddefine((function () { 'use strict'; var foo = 'default'; return foo; })); main.js000066400000000000000000000011141415504077600350320ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002611415504077600351740ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value = 'named'; exports.value = value; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/cjs/000077500000000000000000000000001415504077600336505ustar00rootroot00000000000000default.js000066400000000000000000000000731415504077600355530ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/cjs'use strict'; var foo = 'default'; module.exports = foo; main.js000066400000000000000000000010251415504077600350510ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001761415504077600352170ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const value = 'named'; exports.value = value; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/es/000077500000000000000000000000001415504077600335005ustar00rootroot00000000000000default.js000066400000000000000000000000611415504077600354000ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/esvar foo = 'default'; export { foo as default }; main.js000066400000000000000000000004131415504077600347010ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/esimport foo from './default.js'; export { default } 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)); named.js000066400000000000000000000000521415504077600350400ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expected/esconst value = 'named'; export { value }; system/000077500000000000000000000000001415504077600343365ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_expecteddefault.js000066400000000000000000000002311415504077600363140ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000007651415504077600356300ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002311415504077600357540ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/default.js000066400000000000000000000000321415504077600331060ustar00rootroot00000000000000export default 'default'; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/main.js000066400000000000000000000004051415504077600324120ustar00rootroot00000000000000import 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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/named.js000066400000000000000000000000361415504077600325520ustar00rootroot00000000000000export const value = 'named'; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/000077500000000000000000000000001415504077600275455ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_config.js000066400000000000000000000004721415504077600315120ustar00rootroot00000000000000const commonjs = require('@rollup/plugin-commonjs'); module.exports = { description: 'Handles output from @rollup/plugin-commonjs', expectedWarnings: ['MIXED_EXPORTS'], options: { strictDeprecations: false, input: 'main.js', preserveModules: true, external: ['external'], plugins: [commonjs()] } }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/000077500000000000000000000000001415504077600315055ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/000077500000000000000000000000001415504077600322465ustar00rootroot00000000000000_virtual/000077500000000000000000000000001415504077600340145ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amdother.js_commonjs-exports.js000066400000000000000000000002561415504077600415200ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/_virtualdefine(['exports'], (function (exports) { 'use strict'; var other = {}; exports.__exports = other; Object.defineProperty(exports, '__esModule', { value: true }); })); commonjs.js000066400000000000000000000007451415504077600343600ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amddefine(['external', './other', './_virtual/other.js_commonjs-exports'], (function (require$$0, other$1, other) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); const external = require$$0__default["default"]; const { value } = other.__exports; console.log(external, value); var commonjs = 42; return commonjs; })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/main.js000066400000000000000000000005241415504077600335310ustar00rootroot00000000000000define(['./commonjs', 'external'], (function (commonjs, require$$0) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); console.log(commonjs, require$$0__default["default"]); })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/amd/other.js000066400000000000000000000002211415504077600337200ustar00rootroot00000000000000define(['./_virtual/other.js_commonjs-exports'], (function (other) { 'use strict'; other.__exports.value = 43; return other.__exports; })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/000077500000000000000000000000001415504077600322645ustar00rootroot00000000000000_virtual/000077500000000000000000000000001415504077600340325ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjsother.js_commonjs-exports.js000066400000000000000000000001731415504077600415340ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/_virtual'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var other = {}; exports.__exports = other; commonjs.js000066400000000000000000000007571415504077600344010ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs'use strict'; var require$$0 = require('external'); require('./other.js'); var other = require('./_virtual/other.js_commonjs-exports.js'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); const external = require$$0__default["default"]; const { value } = other.__exports; console.log(external, value); var commonjs = 42; module.exports = commonjs; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/main.js000066400000000000000000000005251415504077600335500ustar00rootroot00000000000000'use strict'; var commonjs = require('./commonjs.js'); var require$$0 = require('external'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); console.log(commonjs, require$$0__default["default"]); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/cjs/other.js000066400000000000000000000002171415504077600337430ustar00rootroot00000000000000'use strict'; var other = require('./_virtual/other.js_commonjs-exports.js'); other.__exports.value = 43; module.exports = other.__exports; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/000077500000000000000000000000001415504077600321145ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/_virtual/000077500000000000000000000000001415504077600337415ustar00rootroot00000000000000other.js_commonjs-exports.js000066400000000000000000000000601415504077600413570ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/_virtualvar other = {}; export { other as __exports }; commonjs.js000066400000000000000000000004211415504077600342150ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/esimport require$$0 from 'external'; import './other.js'; import { __exports as other } from './_virtual/other.js_commonjs-exports.js'; const external = require$$0; const { value } = other; console.log(external, value); var commonjs = 42; export { commonjs as default }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/main.js000066400000000000000000000001551415504077600333770ustar00rootroot00000000000000import commonjs from './commonjs.js'; import require$$0 from 'external'; console.log(commonjs, require$$0); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/es/other.js000066400000000000000000000002611415504077600335720ustar00rootroot00000000000000import { __exports as other } from './_virtual/other.js_commonjs-exports.js'; export { __exports as default } from './_virtual/other.js_commonjs-exports.js'; other.value = 43; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/000077500000000000000000000000001415504077600330315ustar00rootroot00000000000000_virtual/000077500000000000000000000000001415504077600345775ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/systemother.js_commonjs-exports.js000066400000000000000000000002261415504077600423000ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/system/_virtualSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var other = exports('__exports', {}); }) }; })); commonjs.js000066400000000000000000000007401415504077600351360ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/systemSystem.register(['external', './other.js', './_virtual/other.js_commonjs-exports.js'], (function (exports) { 'use strict'; var require$$0, other; return { setters: [function (module) { require$$0 = module["default"]; }, function () {}, function (module) { other = module.__exports; }], execute: (function () { const external = require$$0; const { value } = other; console.log(external, value); var commonjs = exports('default', 42); }) }; })); main.js000066400000000000000000000005051415504077600342340ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/systemSystem.register(['./commonjs.js', 'external'], (function () { 'use strict'; var commonjs, require$$0; return { setters: [function (module) { commonjs = module["default"]; }, function (module) { require$$0 = module["default"]; }], execute: (function () { console.log(commonjs, require$$0); }) }; })); other.js000066400000000000000000000004431415504077600344320ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_expected/systemSystem.register(['./_virtual/other.js_commonjs-exports.js'], (function (exports) { 'use strict'; var other; return { setters: [function (module) { other = module.__exports; exports('default', module.__exports); }], execute: (function () { other.value = 43; }) }; })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/commonjs.js000066400000000000000000000002011415504077600317210ustar00rootroot00000000000000const external = require('external'); const { value } = require('./other'); console.log(external, value); module.exports = 42; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/main.js000066400000000000000000000001411415504077600310230ustar00rootroot00000000000000import value from './commonjs'; import external from 'external'; console.log(value, external); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-commonjs/other.js000066400000000000000000000000241415504077600312200ustar00rootroot00000000000000exports.value = 43; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/000077500000000000000000000000001415504077600310375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_config.js000066400000000000000000000002771415504077600330070ustar00rootroot00000000000000module.exports = { description: 'dynamic imports are handled correctly when preserving modules', options: { strictDeprecations: false, input: ['main.js'], preserveModules: true } }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/000077500000000000000000000000001415504077600327775ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/amd/000077500000000000000000000000001415504077600335405ustar00rootroot00000000000000dynamic-included.js000066400000000000000000000002641415504077600372320ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value = 'included'; exports.value = value; Object.defineProperty(exports, '__esModule', { value: true }); })); main.js000066400000000000000000000003031415504077600347370ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/cjs/000077500000000000000000000000001415504077600335565ustar00rootroot00000000000000dynamic-included.js000066400000000000000000000002011415504077600372370ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const value = 'included'; exports.value = value; main.js000066400000000000000000000002051415504077600347560ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/es/000077500000000000000000000000001415504077600334065ustar00rootroot00000000000000dynamic-included.js000066400000000000000000000000551415504077600370760ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/esconst value = 'included'; export { value }; main.js000066400000000000000000000001051415504077600346050ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expected/esimport('./dynamic-included.js').then(result => console.log(result)); system/000077500000000000000000000000001415504077600342445ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_expecteddynamic-included.js000066400000000000000000000002341415504077600400120ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003041415504077600355230ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000411415504077600345220ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-importsexport const value = 'included'; dynamic-removed.js000066400000000000000000000000401415504077600343730ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-importsexport const value = 'removed'; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/main.js000066400000000000000000000002551415504077600323230ustar00rootroot00000000000000import('./dynamic-included').then(result => console.log(result)); const include = false; if (include) { import('./dynamic-removed').then(result => console.log(result)); } rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/000077500000000000000000000000001415504077600312765ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_config.js000066400000000000000000000003061415504077600332370ustar00rootroot00000000000000module.exports = { description: 'Preserve modules properly handles internal namespace imports (#2576)', options: { strictDeprecations: false, input: ['main.js'], preserveModules: true } }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/000077500000000000000000000000001415504077600332365ustar00rootroot00000000000000amd/000077500000000000000000000000001415504077600337205ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expectedm1.js000066400000000000000000000002761415504077600346000ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); m2.js000066400000000000000000000001111415504077600345650ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/amddefine((function () { 'use strict'; var m2 = {a:1}; return m2; })); m3.js000066400000000000000000000001111415504077600345660ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/amddefine((function () { 'use strict'; var m3 = {b:2}; return m3; })); main.js000066400000000000000000000001111415504077600351730ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/amddefine(['./m1'], (function (m1) { 'use strict'; console.log(m1); })); cjs/000077500000000000000000000000001415504077600337365ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expectedm1.js000066400000000000000000000002561415504077600346140ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var m2 = require('./m2.js'); var m3 = require('./m3.js'); exports.m2 = m2; exports.m3 = m3; m2.js000066400000000000000000000000651415504077600346130ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs'use strict'; var m2 = {a:1}; module.exports = m2; m3.js000066400000000000000000000000651415504077600346140ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs'use strict'; var m3 = {b:2}; module.exports = m3; main.js000066400000000000000000000000761415504077600352230ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/cjs'use strict'; var m1 = require('./m1.js'); console.log(m1); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/es/000077500000000000000000000000001415504077600336455ustar00rootroot00000000000000m1.js000066400000000000000000000001221415504077600344340ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000531415504077600344400ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/esvar m2 = {a:1}; export { m2 as default }; m3.js000066400000000000000000000000531415504077600344410ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/esvar m3 = {b:2}; export { m3 as default }; main.js000066400000000000000000000000611415504077600350450ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expected/esimport * as m1 from './m1.js'; console.log(m1); system/000077500000000000000000000000001415504077600345035ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_expectedm1.js000066400000000000000000000004131415504077600353540ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002241415504077600353550ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002241415504077600353560ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003021415504077600357600ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/m1.js000066400000000000000000000001361415504077600321510ustar00rootroot00000000000000import m2 from './m2.js'; import m3 from './m3.js'; // console.log('m1'); export { m2, m3 }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/m2.js000066400000000000000000000000431415504077600321470ustar00rootroot00000000000000var m2 = {a:1}; export default m2; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/m3.js000066400000000000000000000000431415504077600321500ustar00rootroot00000000000000var m3 = {b:2}; export default m3; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/main.js000066400000000000000000000000611415504077600325550ustar00rootroot00000000000000import * as ms from './m1.js'; console.log(ms); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-empty/000077500000000000000000000000001415504077600270565ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-empty/_config.js000066400000000000000000000002521415504077600310170ustar00rootroot00000000000000module.exports = { description: 'Preserve modules remove empty dependencies', options: { strictDeprecations: false, input: 'main.js', preserveModules: true } }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/000077500000000000000000000000001415504077600310165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/amd/000077500000000000000000000000001415504077600315575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/amd/main.js000066400000000000000000000001231415504077600330350ustar00rootroot00000000000000define(['./two'], (function (two) { 'use strict'; window.APP = { a: two }; })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/amd/two.js000066400000000000000000000001041415504077600327210ustar00rootroot00000000000000define((function () { 'use strict'; var a = {}; return a; })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/cjs/000077500000000000000000000000001415504077600315755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/cjs/main.js000066400000000000000000000001101415504077600330470ustar00rootroot00000000000000'use strict'; var two = require('./two.js'); window.APP = { a: two }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/cjs/two.js000066400000000000000000000000601415504077600327400ustar00rootroot00000000000000'use strict'; var a = {}; module.exports = a; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/es/000077500000000000000000000000001415504077600314255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/es/main.js000066400000000000000000000000571415504077600327110ustar00rootroot00000000000000import a from './two.js'; window.APP = { a }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/es/two.js000066400000000000000000000000461415504077600325740ustar00rootroot00000000000000var a = {}; export { a as default }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/system/000077500000000000000000000000001415504077600323425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/system/main.js000066400000000000000000000003171415504077600336250ustar00rootroot00000000000000System.register(['./two.js'], (function () { 'use strict'; var a; return { setters: [function (module) { a = module["default"]; }], execute: (function () { window.APP = { a }; }) }; })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-empty/_expected/system/two.js000066400000000000000000000002201415504077600335030ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var a = exports('default', {}); }) }; })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-empty/main.js000066400000000000000000000000571415504077600303420ustar00rootroot00000000000000import { a } from './one'; window.APP = { a };rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-empty/one.js000066400000000000000000000001151415504077600301720ustar00rootroot00000000000000export { default as a } from './two'; export { default as b } from './three';rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-empty/three.js000066400000000000000000000000221415504077600305150ustar00rootroot00000000000000export default {};rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-empty/two.js000066400000000000000000000000221415504077600302170ustar00rootroot00000000000000export default {};rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-export-alias/000077500000000000000000000000001415504077600303305ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_config.js000066400000000000000000000002761415504077600322770ustar00rootroot00000000000000module.exports = { description: 'confirm export aliases are preserved in modules', options: { strictDeprecations: false, input: ['main1.js', 'main2.js'], preserveModules: true } }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/000077500000000000000000000000001415504077600322705ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/amd/000077500000000000000000000000001415504077600330315ustar00rootroot00000000000000dep.js000066400000000000000000000002711415504077600340600ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); main1.js000066400000000000000000000003001415504077600343060ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); main2.js000066400000000000000000000002501415504077600343130ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/amddefine(['exports', './dep'], (function (exports, dep) { 'use strict'; exports.bar = dep.foo; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/cjs/000077500000000000000000000000001415504077600330475ustar00rootroot00000000000000dep.js000066400000000000000000000002051415504077600340730ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const foo = 1; exports.bar = foo; exports.foo = foo; main1.js000066400000000000000000000002371415504077600343350ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var dep = require('./dep.js'); exports.bar = dep.foo; exports.foo = dep.foo; main2.js000066400000000000000000000002101415504077600343250ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var dep = require('./dep.js'); exports.bar = dep.foo; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/es/000077500000000000000000000000001415504077600326775ustar00rootroot00000000000000dep.js000066400000000000000000000000541415504077600337250ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/esconst foo = 1; export { foo as bar, foo }; main1.js000066400000000000000000000000541415504077600341620ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/esexport { foo as bar, foo } from './dep.js'; main2.js000066400000000000000000000000471415504077600341650ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/esexport { foo as bar } from './dep.js'; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_expected/system/000077500000000000000000000000001415504077600336145ustar00rootroot00000000000000dep.js000066400000000000000000000002401415504077600346370ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003201415504077600350730ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002751415504077600351050ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-export-alias/dep.js000066400000000000000000000000531415504077600314340ustar00rootroot00000000000000const foo = 1; export { foo, foo as bar };rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-export-alias/main1.js000066400000000000000000000000411415504077600316660ustar00rootroot00000000000000export { foo, bar } from './dep';rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-export-alias/main2.js000066400000000000000000000000341415504077600316710ustar00rootroot00000000000000export { bar } from './dep';rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/000077500000000000000000000000001415504077600311535ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_config.js000066400000000000000000000004261415504077600331170ustar00rootroot00000000000000module.exports = { description: 'entryFileNames pattern supported in combination with preserveModules', options: { strictDeprecations: false, input: 'src/main.ts', output: { entryFileNames: 'entry-[name]-[format]-[ext][extname].js' }, preserveModules: true } }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/000077500000000000000000000000001415504077600331135ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/000077500000000000000000000000001415504077600336545ustar00rootroot00000000000000entry-foo-amd-ts.ts.js000066400000000000000000000001101415504077600376550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amddefine((function () { 'use strict'; var foo = 42; return foo; })); entry-main-amd-ts.ts.js000066400000000000000000000005341415504077600400300ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amddefine(['exports', './entry-foo-amd-ts.ts', './nested/entry-bar-amd-ts.ts', './nested/entry-baz-amd-ts.ts', './entry-no-ext-amd-'], (function (exports, foo, bar, baz, noExt) { 'use strict'; exports.foo = foo; exports.bar = bar; exports.baz = baz; exports.noExt = noExt; Object.defineProperty(exports, '__esModule', { value: true }); })); entry-no-ext-amd-.js000066400000000000000000000001221415504077600373130ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amddefine((function () { 'use strict'; var noExt = 'no-ext'; return noExt; })); nested/000077500000000000000000000000001415504077600350575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amdentry-bar-amd-ts.ts.js000066400000000000000000000001161415504077600411260ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/nesteddefine((function () { 'use strict'; var bar = 'banana'; return bar; })); entry-baz-amd-ts.ts.js000066400000000000000000000001201415504077600411310ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/amd/nesteddefine((function () { 'use strict'; var baz = 'whatever'; return baz; })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/000077500000000000000000000000001415504077600336725ustar00rootroot00000000000000entry-foo-cjs-ts.ts.js000066400000000000000000000000641415504077600377210ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs'use strict'; var foo = 42; module.exports = foo; entry-main-cjs-ts.ts.js000066400000000000000000000005541415504077600400660ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var foo = require('./entry-foo-cjs-ts.ts.js'); var bar = require('./nested/entry-bar-cjs-ts.ts.js'); var baz = require('./nested/entry-baz-cjs-ts.ts.js'); var noExt = require('./entry-no-ext-cjs-.js'); exports.foo = foo; exports.bar = bar; exports.baz = baz; exports.noExt = noExt; entry-no-ext-cjs-.js000066400000000000000000000000761415504077600373570ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs'use strict'; var noExt = 'no-ext'; module.exports = noExt; nested/000077500000000000000000000000001415504077600350755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjsentry-bar-cjs-ts.ts.js000066400000000000000000000000721415504077600411630ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/nested'use strict'; var bar = 'banana'; module.exports = bar; entry-baz-cjs-ts.ts.js000066400000000000000000000000741415504077600411750ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/cjs/nested'use strict'; var baz = 'whatever'; module.exports = baz; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/000077500000000000000000000000001415504077600335225ustar00rootroot00000000000000entry-foo-es-ts.ts.js000066400000000000000000000000521415504077600373760ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/esvar foo = 42; export { foo as default }; entry-main-es-ts.ts.js000066400000000000000000000003661415504077600375470ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/esexport { default as foo } from './entry-foo-es-ts.ts.js'; export { default as bar } from './nested/entry-bar-es-ts.ts.js'; export { default as baz } from './nested/entry-baz-es-ts.ts.js'; export { default as noExt } from './entry-no-ext-es-.js'; entry-no-ext-es-.js000066400000000000000000000000641415504077600370340ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/esvar noExt = 'no-ext'; export { noExt as default }; nested/000077500000000000000000000000001415504077600347255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/esentry-bar-es-ts.ts.js000066400000000000000000000000601415504077600406400ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/nestedvar bar = 'banana'; export { bar as default }; entry-baz-es-ts.ts.js000066400000000000000000000000621415504077600406520ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/es/nestedvar baz = 'whatever'; export { baz as default }; system/000077500000000000000000000000001415504077600343605ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expectedentry-foo-system-ts.ts.js000066400000000000000000000002221415504077600412270ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var foo = exports('default', 42); }) }; })); entry-main-system-ts.ts.js000066400000000000000000000007771415504077600414070ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/systemSystem.register(['./entry-foo-system-ts.ts.js', './nested/entry-bar-system-ts.ts.js', './nested/entry-baz-system-ts.ts.js', './entry-no-ext-system-.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 () { }) }; })); entry-no-ext-system-.js000066400000000000000000000002321415504077600406630ustar00rootroot00000000000000rollup-2.61.1/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'); }) }; })); nested/000077500000000000000000000000001415504077600356425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_expected/systementry-bar-system-ts.ts.js000066400000000000000000000002301415504077600424710ustar00rootroot00000000000000rollup-2.61.1/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'); }) }; })); entry-baz-system-ts.ts.js000066400000000000000000000002321415504077600425030ustar00rootroot00000000000000rollup-2.61.1/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'); }) }; })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/000077500000000000000000000000001415504077600317425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/foo.ts000066400000000000000000000000231415504077600330700ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/main.ts000066400000000000000000000003641415504077600332410ustar00rootroot00000000000000// @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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/nested/000077500000000000000000000000001415504077600332245ustar00rootroot00000000000000bar.ts000066400000000000000000000000311415504077600342530ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/nestedexport default 'banana'; baz.ts000066400000000000000000000000331415504077600342650ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/nestedexport default 'whatever'; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/src/no-ext000066400000000000000000000000301415504077600330700ustar00rootroot00000000000000export default 'no-ext' rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/000077500000000000000000000000001415504077600312345ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_config.js000066400000000000000000000006401415504077600331760ustar00rootroot00000000000000module.exports = { 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', '')}'`; } } } ] } }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/000077500000000000000000000000001415504077600331745ustar00rootroot00000000000000amd/000077500000000000000000000000001415504077600336565ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected_virtual/000077500000000000000000000000001415504077600355035ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd_One1.js000066400000000000000000000001131415504077600367750ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd/_virtualdefine((function () { 'use strict'; var c = 'One1.js'; return c; })); _One2.js000066400000000000000000000001121415504077600367750ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd/_virtualdefine((function () { 'use strict'; var b = 'One.js'; return b; })); _one.js000066400000000000000000000001121415504077600367530ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/amd/_virtualdefine((function () { 'use strict'; var a = 'one.js'; return a; })); main.js000066400000000000000000000002471415504077600351430ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600336745ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected_virtual/000077500000000000000000000000001415504077600355215ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs_One1.js000066400000000000000000000000671415504077600370230ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs/_virtual'use strict'; var c = 'One1.js'; module.exports = c; _One2.js000066400000000000000000000000661415504077600370230ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs/_virtual'use strict'; var b = 'One.js'; module.exports = b; _one.js000066400000000000000000000000661415504077600370010ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/cjs/_virtual'use strict'; var a = 'one.js'; module.exports = a; main.js000066400000000000000000000002761415504077600351630ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/000077500000000000000000000000001415504077600336035ustar00rootroot00000000000000_virtual/000077500000000000000000000000001415504077600353515ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es_One1.js000066400000000000000000000000551415504077600366500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/_virtualvar c = 'One1.js'; export { c as default }; _One2.js000066400000000000000000000000541415504077600366500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/_virtualvar b = 'One.js'; export { b as default }; _one.js000066400000000000000000000000541415504077600366260ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/es/_virtualvar a = 'one.js'; export { a as default }; main.js000066400000000000000000000002111415504077600350000ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600344415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected_virtual/000077500000000000000000000000001415504077600362665ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_expected/system_One1.js000066400000000000000000000002271415504077600375660ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002261415504077600375660ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002261415504077600375440ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000005711415504077600357260ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/main.js000066400000000000000000000001521415504077600325140ustar00rootroot00000000000000import a from '\0one.js'; import b from '\0One.js'; import c from '\0One1.js'; window.APP = { a, b, c }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/000077500000000000000000000000001415504077600312455ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_config.js000066400000000000000000000003471415504077600332130ustar00rootroot00000000000000module.exports = { description: 'respects "named" export mode in all chunks when preserving modules', options: { strictDeprecations: false, input: 'main.js', preserveModules: true, output: { exports: 'named' } } }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/000077500000000000000000000000001415504077600332055ustar00rootroot00000000000000amd/000077500000000000000000000000001415504077600336675ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expecteddefault.js000066400000000000000000000002621415504077600356510ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000010341415504077600351470ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002611415504077600353100ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value = 'named'; exports.value = value; Object.defineProperty(exports, '__esModule', { value: true }); })); cjs/000077500000000000000000000000001415504077600337055ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expecteddefault.js000066400000000000000000000001771415504077600356740ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000007341415504077600351730ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001761415504077600353330ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const value = 'named'; exports.value = value; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/es/000077500000000000000000000000001415504077600336145ustar00rootroot00000000000000default.js000066400000000000000000000000611415504077600355140ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/esvar foo = 'default'; export { foo as default }; main.js000066400000000000000000000004131415504077600350150ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/esimport foo from './default.js'; export { default } 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)); named.js000066400000000000000000000000521415504077600351540ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expected/esconst value = 'named'; export { value }; system/000077500000000000000000000000001415504077600344525ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_expecteddefault.js000066400000000000000000000002311415504077600364300ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000007651415504077600357440ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002311415504077600360700ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/default.js000066400000000000000000000000321415504077600332220ustar00rootroot00000000000000export default 'default'; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/main.js000066400000000000000000000004051415504077600325260ustar00rootroot00000000000000import 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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/named.js000066400000000000000000000000361415504077600326660ustar00rootroot00000000000000export const value = 'named'; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/000077500000000000000000000000001415504077600323735ustar00rootroot00000000000000_config.js000066400000000000000000000003041415504077600342530ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-exportmodule.exports = { description: 'confirm exports are deconflicted when exporting nested index aliases', options: { strictDeprecations: false, input: 'main.js', preserveModules: true } }; _expected/000077500000000000000000000000001415504077600342545ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-exportamd/000077500000000000000000000000001415504077600350155ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expectedmain.js000066400000000000000000000003741415504077600363030ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); module-a/000077500000000000000000000000001415504077600365205ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/amdv1/000077500000000000000000000000001415504077600370465ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/amd/module-aindex.js000066400000000000000000000003051415504077600405110ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); module-b/000077500000000000000000000000001415504077600365215ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/amdv1/000077500000000000000000000000001415504077600370475ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/amd/module-bindex.js000066400000000000000000000003051415504077600405120ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); cjs/000077500000000000000000000000001415504077600350335ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expectedmain.js000066400000000000000000000003541415504077600363170ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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/000077500000000000000000000000001415504077600365365ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjsv1/000077500000000000000000000000001415504077600370645ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjs/module-aindex.js000066400000000000000000000002221415504077600405250ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjs/module-a/v1'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const TEST_MODULE_A = 'A'; exports.TEST_MODULE_A = TEST_MODULE_A; module-b/000077500000000000000000000000001415504077600365375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjsv1/000077500000000000000000000000001415504077600370655ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjs/module-bindex.js000066400000000000000000000002221415504077600405260ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/cjs/module-b/v1'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const TEST_MODULE_B = 'A'; exports.TEST_MODULE_B = TEST_MODULE_B; es/000077500000000000000000000000001415504077600346635ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expectedmain.js000066400000000000000000000002461415504077600361470ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600363665ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/esv1/000077500000000000000000000000001415504077600367145ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/es/module-aindex.js000066400000000000000000000000661415504077600403630ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600363675ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/esv1/000077500000000000000000000000001415504077600367155ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/es/module-bindex.js000066400000000000000000000000661415504077600403640ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600356005ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expectedmain.js000066400000000000000000000004431415504077600370630ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600373035ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/systemv1/000077500000000000000000000000001415504077600376315ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/system/module-aindex.js000066400000000000000000000002451415504077600412770ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600373045ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/systemv1/000077500000000000000000000000001415504077600376325ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_expected/system/module-bindex.js000066400000000000000000000002451415504077600413000ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/main.js000066400000000000000000000001011415504077600336450ustar00rootroot00000000000000export * from './module-a/index' export * from './module-b/index'module-a/000077500000000000000000000000001415504077600340175ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-exportindex.js000066400000000000000000000000771415504077600354700ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-aimport * as ModuleA_V1 from './v1/index' export { ModuleA_V1 }v1/000077500000000000000000000000001415504077600343455ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-aindex.js000066400000000000000000000000401415504077600360040ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-a/v1export const TEST_MODULE_A = 'A'module-b/000077500000000000000000000000001415504077600340205ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-exportindex.js000066400000000000000000000000771415504077600354710ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-bimport * as ModuleB_V1 from './v1/index' export { ModuleB_V1 }v1/000077500000000000000000000000001415504077600343465ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-bindex.js000066400000000000000000000000401415504077600360050ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/module-b/v1export const TEST_MODULE_B = 'A'rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/000077500000000000000000000000001415504077600305215ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_config.js000066400000000000000000000002651415504077600324660ustar00rootroot00000000000000module.exports = { description: 'confirm exports are preserved when exporting a module', options: { strictDeprecations: false, input: 'main.js', preserveModules: true } }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/000077500000000000000000000000001415504077600324615ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/amd/000077500000000000000000000000001415504077600332225ustar00rootroot00000000000000inner/000077500000000000000000000000001415504077600342565ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/amdmore_inner/000077500000000000000000000000001415504077600364135ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/amd/innersomething.js000066400000000000000000000003031415504077600407420ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); some_effect.js000066400000000000000000000001101415504077600370630ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/amd/innerdefine((function () { 'use strict'; console.log('side-effect'); })); main.js000066400000000000000000000003731415504077600344300ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjs/000077500000000000000000000000001415504077600332405ustar00rootroot00000000000000inner/000077500000000000000000000000001415504077600342745ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjsmore_inner/000077500000000000000000000000001415504077600364315ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjs/innersomething.js000066400000000000000000000002201415504077600407560ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjs/inner/more_inner'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const Something = 'Hello World'; exports.Something = Something; some_effect.js000066400000000000000000000000531415504077600371070ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjs/inner'use strict'; console.log('side-effect'); main.js000066400000000000000000000003321415504077600344410ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var something = require('./inner/more_inner/something.js'); require('./inner/some_effect.js'); exports.Something = something.Something; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/es/000077500000000000000000000000001415504077600330705ustar00rootroot00000000000000inner/000077500000000000000000000000001415504077600341245ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/esmore_inner/000077500000000000000000000000001415504077600362615ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/es/innersomething.js000066400000000000000000000000701415504077600406110ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/es/inner/more_innerconst Something = 'Hello World'; export { Something }; some_effect.js000066400000000000000000000000341415504077600367360ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/es/innerconsole.log('side-effect'); main.js000066400000000000000000000001361415504077600342730ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/esexport { Something } from './inner/more_inner/something.js'; import './inner/some_effect.js'; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/system/000077500000000000000000000000001415504077600340055ustar00rootroot00000000000000inner/000077500000000000000000000000001415504077600350415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/systemmore_inner/000077500000000000000000000000001415504077600371765ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/system/innersomething.js000066400000000000000000000002471415504077600415340ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002051415504077600376530ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_expected/system/innerSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('side-effect'); }) }; })); main.js000066400000000000000000000004121415504077600352050ustar00rootroot00000000000000rollup-2.61.1/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); }, function () {}], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/000077500000000000000000000000001415504077600316345ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/index.js000066400000000000000000000000741415504077600333020ustar00rootroot00000000000000export * from './more_inner/index'; import './some_effect'; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/more_inner/000077500000000000000000000000001415504077600337715ustar00rootroot00000000000000index.js000066400000000000000000000000351415504077600353550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/more_innerexport * from './something'; something.js000066400000000000000000000000501415504077600362400ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/inner/more_innerexport const Something = 'Hello World'; some_effect.js000066400000000000000000000000341415504077600343670ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/innerconsole.log('side-effect'); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-nested-export/main.js000066400000000000000000000000371415504077600320030ustar00rootroot00000000000000export * from './inner/index'; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/000077500000000000000000000000001415504077600313445ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_config.js000066400000000000000000000002631415504077600333070ustar00rootroot00000000000000module.exports = { description: 'imports and exports of non-entry points are tracked', options: { strictDeprecations: false, input: 'main.js', preserveModules: true } }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/000077500000000000000000000000001415504077600333045ustar00rootroot00000000000000amd/000077500000000000000000000000001415504077600337665ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expecteddep2.js000066400000000000000000000001141415504077600351520ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/amddefine((function () { 'use strict'; function foo() {} return foo; })); main.js000066400000000000000000000001131415504077600352430ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/amddefine(['./dep2'], (function (dep2) { 'use strict'; return dep2; })); cjs/000077500000000000000000000000001415504077600340045ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expecteddep2.js000066400000000000000000000000701415504077600351710ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/cjs'use strict'; function foo() {} module.exports = foo; main.js000066400000000000000000000001121415504077600352600ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/cjs'use strict'; var dep2 = require('./dep2.js'); module.exports = dep2; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/es/000077500000000000000000000000001415504077600337135ustar00rootroot00000000000000dep2.js000066400000000000000000000000561415504077600350250ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/esfunction foo() {} export { foo as default }; main.js000066400000000000000000000001021415504077600351070ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expected/esimport foo from './dep2.js'; export { default } from './dep2.js'; system/000077500000000000000000000000001415504077600345515ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_expecteddep2.js000066400000000000000000000002371415504077600357430ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003571415504077600360400ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/dep1.js000066400000000000000000000000411415504077600325260ustar00rootroot00000000000000export { default } from './dep2';rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/dep2.js000066400000000000000000000000351415504077600325320ustar00rootroot00000000000000export default function() {};rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/main.js000066400000000000000000000000561415504077600326270ustar00rootroot00000000000000import foo from './dep1'; export default foo;rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/000077500000000000000000000000001415504077600304115ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_config.js000066400000000000000000000003351415504077600323540ustar00rootroot00000000000000module.exports = { description: 'correctly resolves imports via a proxy module as direct imports when preserving modules', options: { strictDeprecations: false, preserveModules: true, external: 'external' } }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/000077500000000000000000000000001415504077600323515ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/amd/000077500000000000000000000000001415504077600331125ustar00rootroot00000000000000main.js000066400000000000000000000005561415504077600343230ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/amddefine(['external'], (function (path) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var path__default = /*#__PURE__*/_interopDefaultLegacy(path); console.log(path__default["default"].normalize('foo\\bar')); console.log(path__default["default"].normalize('foo\\bar')); })); proxy.js000066400000000000000000000004261415504077600345540ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/amddefine(['external'], (function (path) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var path__default = /*#__PURE__*/_interopDefaultLegacy(path); return path__default["default"]; })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/cjs/000077500000000000000000000000001415504077600331305ustar00rootroot00000000000000main.js000066400000000000000000000005351415504077600343360ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/cjs'use strict'; var path = require('external'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var path__default = /*#__PURE__*/_interopDefaultLegacy(path); console.log(path__default["default"].normalize('foo\\bar')); console.log(path__default["default"].normalize('foo\\bar')); proxy.js000066400000000000000000000004201415504077600345640ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/cjs'use strict'; var path = require('external'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var path__default = /*#__PURE__*/_interopDefaultLegacy(path); module.exports = path__default["default"]; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/es/000077500000000000000000000000001415504077600327605ustar00rootroot00000000000000main.js000066400000000000000000000001601415504077600341600ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001011415504077600344100ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/esimport path from 'external'; export { default } from 'external'; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_expected/system/000077500000000000000000000000001415504077600336755ustar00rootroot00000000000000main.js000066400000000000000000000004261415504077600351020ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003601415504077600353340ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/main.js000066400000000000000000000002261415504077600316730ustar00rootroot00000000000000import path from 'external'; import proxyPath from './proxy'; console.log(path.normalize('foo\\bar')); console.log(proxyPath.normalize('foo\\bar')); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/proxy.js000066400000000000000000000000621415504077600321260ustar00rootroot00000000000000import path from 'external'; export default path; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/000077500000000000000000000000001415504077600311525ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_config.js000066400000000000000000000002451415504077600331150ustar00rootroot00000000000000module.exports = { description: 'change the module destination', options: { strictDeprecations: false, input: 'src/lib/main.js', preserveModules: true } }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/000077500000000000000000000000001415504077600331125ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/amd/000077500000000000000000000000001415504077600336535ustar00rootroot00000000000000dep.js000066400000000000000000000003071415504077600347020ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); lib/000077500000000000000000000000001415504077600343425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/amdmain.js000066400000000000000000000002101415504077600356150ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/cjs/000077500000000000000000000000001415504077600336715ustar00rootroot00000000000000dep.js000066400000000000000000000002151415504077600347160ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function fn () { console.log('dep fn'); } exports.fn = fn; lib/000077500000000000000000000000001415504077600343605ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/cjsmain.js000066400000000000000000000001741415504077600356440ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/es/000077500000000000000000000000001415504077600335215ustar00rootroot00000000000000dep.js000066400000000000000000000000741415504077600345510ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/esfunction fn () { console.log('dep fn'); } export { fn }; lib/000077500000000000000000000000001415504077600342105ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/esmain.js000066400000000000000000000001561415504077600354740ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600343575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expecteddep.js000066400000000000000000000003141415504077600354630ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600351255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_expected/systemmain.js000066400000000000000000000004611415504077600364100ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/src/000077500000000000000000000000001415504077600317415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/src/dep.js000066400000000000000000000000621415504077600330450ustar00rootroot00000000000000export function fn () { console.log('dep fn'); }rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/src/lib/000077500000000000000000000000001415504077600325075ustar00rootroot00000000000000main.js000066400000000000000000000001341415504077600337100ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/src/libimport { fn } from '../dep'; export default class Main { constructor () { fn(); } }rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/000077500000000000000000000000001415504077600315255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_config.js000066400000000000000000000011631415504077600334700ustar00rootroot00000000000000const path = require('path'); module.exports = { 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; } } } ] } }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/000077500000000000000000000000001415504077600334655ustar00rootroot00000000000000amd/000077500000000000000000000000001415504077600341475ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expectedanswer.num.js000066400000000000000000000001161415504077600366000ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/amddefine((function () { 'use strict'; var answer = 42; return answer; })); lorem.str.js000066400000000000000000000010111415504077600364230ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000004151415504077600354310ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); no-ext.js000066400000000000000000000001361415504077600357170ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/amddefine((function () { 'use strict'; var noExt = "COULDN'T TRANSFORM"; return noExt; })); cjs/000077500000000000000000000000001415504077600341655ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expectedanswer.num.js000066400000000000000000000000721415504077600366170ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/cjs'use strict'; var answer = 42; module.exports = answer; lorem.str.js000066400000000000000000000007651415504077600364600ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000004151415504077600354470ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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.js000066400000000000000000000001121415504077600357270ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/cjs'use strict'; var noExt = "COULDN'T TRANSFORM"; module.exports = noExt; es/000077500000000000000000000000001415504077600340155ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expectedanswer.num.js000066400000000000000000000000601415504077600364440ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/esvar answer = 42; export { answer as default }; lorem.str.js000066400000000000000000000007531415504077600363050ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002301415504077600352720ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001001415504077600355540ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expected/esvar noExt = "COULDN'T TRANSFORM"; export { noExt as default }; system/000077500000000000000000000000001415504077600347325ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_expectedanswer.num.js000066400000000000000000000002251415504077600373640ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000011211415504077600372100ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000005611415504077600362160ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002461415504077600365040ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src/000077500000000000000000000000001415504077600323145ustar00rootroot00000000000000answer.num000066400000000000000000000000031415504077600342460ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src42 lorem.str000066400000000000000000000006761415504077600341160ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src/main.js000066400000000000000000000002171415504077600335760ustar00rootroot00000000000000export { default as answer } from './answer.num'; export { default as lorem } from './lorem.str'; export { default as noExt } from './no-ext'; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/src/no-ext000066400000000000000000000000111415504077600334410ustar00rootroot00000000000000WHATEVER rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-single-entry/000077500000000000000000000000001415504077600303405ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_config.js000066400000000000000000000002411415504077600322770ustar00rootroot00000000000000module.exports = { description: 'single entry names file correctly', options: { strictDeprecations: false, input: 'main.js', preserveModules: true } }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/000077500000000000000000000000001415504077600323005ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/amd/000077500000000000000000000000001415504077600330415ustar00rootroot00000000000000main.js000066400000000000000000000000731415504077600342440ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/amddefine((function () { 'use strict'; console.log(); })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/cjs/000077500000000000000000000000001415504077600330575ustar00rootroot00000000000000main.js000066400000000000000000000000361415504077600342610ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/cjs'use strict'; console.log(); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/es/000077500000000000000000000000001415504077600327075ustar00rootroot00000000000000main.js000066400000000000000000000000171415504077600341100ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/esconsole.log(); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/system/000077500000000000000000000000001415504077600336245ustar00rootroot00000000000000main.js000066400000000000000000000001701415504077600350250ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log(); }) }; })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-single-entry/main.js000066400000000000000000000000151415504077600316160ustar00rootroot00000000000000console.log()rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/000077500000000000000000000000001415504077600310545ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_config.js000066400000000000000000000010621415504077600330150ustar00rootroot00000000000000module.exports = { 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; } } ] } }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/000077500000000000000000000000001415504077600330145ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/amd/000077500000000000000000000000001415504077600335555ustar00rootroot00000000000000_virtual/000077500000000000000000000000001415504077600353235ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/amd_virtualModule.js000066400000000000000000000002721415504077600406550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/amd/_virtualdefine(['exports'], (function (exports) { 'use strict'; const virtual = "Virtual!"; exports.virtual = virtual; Object.defineProperty(exports, '__esModule', { value: true }); })); main.js000066400000000000000000000002131415504077600347540ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/amddefine(['./_virtual/_virtualModule'], (function (_virtualModule) { 'use strict'; assert.equal(_virtualModule.virtual, 'Virtual!'); })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/cjs/000077500000000000000000000000001415504077600335735ustar00rootroot00000000000000_virtual/000077500000000000000000000000001415504077600353415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/cjs_virtualModule.js000066400000000000000000000002071415504077600406710ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/cjs/_virtual'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const virtual = "Virtual!"; exports.virtual = virtual; main.js000066400000000000000000000002001415504077600347660ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/es/000077500000000000000000000000001415504077600334235ustar00rootroot00000000000000_virtual/000077500000000000000000000000001415504077600351715ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/es_virtualModule.js000066400000000000000000000000611415504077600405170ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/es/_virtualconst virtual = "Virtual!"; export { virtual }; main.js000066400000000000000000000001341415504077600346240ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/esimport { virtual } from './_virtual/_virtualModule.js'; assert.equal(virtual, 'Virtual!'); system/000077500000000000000000000000001415504077600342615ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected_virtual/000077500000000000000000000000001415504077600361065ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_expected/system_virtualModule.js000066400000000000000000000002401415504077600414330ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003731415504077600355460ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/main.js000066400000000000000000000000431415504077600323330ustar00rootroot00000000000000assert.equal(virtual, 'Virtual!'); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/000077500000000000000000000000001415504077600257225ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_config.js000066400000000000000000000002471415504077600276670ustar00rootroot00000000000000module.exports = { description: 'Rewrite modules in-place', options: { strictDeprecations: false, input: ['main1.js', 'main2.js'], preserveModules: true } }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/000077500000000000000000000000001415504077600276625ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/000077500000000000000000000000001415504077600304235ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/deps/000077500000000000000000000000001415504077600313565ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/deps/dep1.js000066400000000000000000000003101415504077600325370ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function fn () { console.log('dep1 fn'); } exports.fn = fn; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/deps/dep2.js000066400000000000000000000003541415504077600325500ustar00rootroot00000000000000define(['exports', '../lib/lib2'], (function (exports, lib2) { 'use strict'; function fn () { lib2.fn(); console.log('dep2 fn'); } exports.fn = fn; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/deps/dep3.js000066400000000000000000000003541415504077600325510ustar00rootroot00000000000000define(['exports', '../lib/lib1'], (function (exports, lib1) { 'use strict'; function fn () { lib1.fn(); console.log('dep3 fn'); } exports.fn = fn; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/lib/000077500000000000000000000000001415504077600311715ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/lib/lib1.js000066400000000000000000000003101415504077600323500ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function fn () { console.log('lib1 fn'); } exports.fn = fn; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/lib/lib2.js000066400000000000000000000003101415504077600323510ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function fn () { console.log('lib2 fn'); } exports.fn = fn; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/main1.js000066400000000000000000000002671415504077600317730ustar00rootroot00000000000000define(['./deps/dep1', './deps/dep2'], (function (dep1, dep2) { 'use strict'; class Main1 { constructor () { dep1.fn(); dep2.fn(); } } return Main1; })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/amd/main2.js000066400000000000000000000002671415504077600317740ustar00rootroot00000000000000define(['./deps/dep2', './deps/dep3'], (function (dep2, dep3) { 'use strict'; class Main2 { constructor () { dep3.fn(); dep2.fn(); } } return Main2; })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/000077500000000000000000000000001415504077600304415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/deps/000077500000000000000000000000001415504077600313745ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/deps/dep1.js000066400000000000000000000002161415504077600325620ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function fn () { console.log('dep1 fn'); } exports.fn = fn; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/deps/dep2.js000066400000000000000000000003021415504077600325570ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var lib2 = require('../lib/lib2.js'); function fn () { lib2.fn(); console.log('dep2 fn'); } exports.fn = fn; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/deps/dep3.js000066400000000000000000000003021415504077600325600ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var lib1 = require('../lib/lib1.js'); function fn () { lib1.fn(); console.log('dep3 fn'); } exports.fn = fn; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/lib/000077500000000000000000000000001415504077600312075ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/lib/lib1.js000066400000000000000000000002161415504077600323730ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function fn () { console.log('lib1 fn'); } exports.fn = fn; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/lib/lib2.js000066400000000000000000000002161415504077600323740ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function fn () { console.log('lib2 fn'); } exports.fn = fn; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/main1.js000066400000000000000000000002721415504077600320050ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/cjs/main2.js000066400000000000000000000002721415504077600320060ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/000077500000000000000000000000001415504077600302715ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/deps/000077500000000000000000000000001415504077600312245ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/deps/dep1.js000066400000000000000000000000751415504077600324150ustar00rootroot00000000000000function fn () { console.log('dep1 fn'); } export { fn }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/deps/dep2.js000066400000000000000000000001651415504077600324160ustar00rootroot00000000000000import { fn as fn$1 } from '../lib/lib2.js'; function fn () { fn$1(); console.log('dep2 fn'); } export { fn }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/deps/dep3.js000066400000000000000000000001651415504077600324170ustar00rootroot00000000000000import { fn as fn$1 } from '../lib/lib1.js'; function fn () { fn$1(); console.log('dep3 fn'); } export { fn }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/lib/000077500000000000000000000000001415504077600310375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/lib/lib1.js000066400000000000000000000000751415504077600322260ustar00rootroot00000000000000function fn () { console.log('lib1 fn'); } export { fn }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/lib/lib2.js000066400000000000000000000000751415504077600322270ustar00rootroot00000000000000function fn () { console.log('lib2 fn'); } export { fn }; rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/main1.js000066400000000000000000000002561415504077600316370ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/es/main2.js000066400000000000000000000002561415504077600316400ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/000077500000000000000000000000001415504077600312065ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/deps/000077500000000000000000000000001415504077600321415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/deps/dep1.js000066400000000000000000000003151415504077600333270ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('fn', fn); function fn () { console.log('dep1 fn'); } }) }; })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/deps/dep2.js000066400000000000000000000004731415504077600333350ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/deps/dep3.js000066400000000000000000000004731415504077600333360ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/lib/000077500000000000000000000000001415504077600317545ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/lib/lib1.js000066400000000000000000000003151415504077600331400ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('fn', fn); function fn () { console.log('lib1 fn'); } }) }; })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/lib/lib2.js000066400000000000000000000003151415504077600331410ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('fn', fn); function fn () { console.log('lib2 fn'); } }) }; })); rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/main1.js000066400000000000000000000006251415504077600325540ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/_expected/system/main2.js000066400000000000000000000006251415504077600325550ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/deps/000077500000000000000000000000001415504077600266555ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/deps/dep1.js000066400000000000000000000000631415504077600300430ustar00rootroot00000000000000export function fn () { console.log('dep1 fn'); }rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/deps/dep2.js000066400000000000000000000001551415504077600300460ustar00rootroot00000000000000import { fn as libfn } from '../lib/lib2.js'; export function fn () { libfn(); console.log('dep2 fn'); }rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/deps/dep3.js000066400000000000000000000002251415504077600300450ustar00rootroot00000000000000import { fn as libfn, treeshaked } from '../lib/lib1.js'; export function fn () { libfn(); console.log('dep3 fn'); } export default treeshaked;rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/lib/000077500000000000000000000000001415504077600264705ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/lib/lib1.js000066400000000000000000000001751415504077600276600ustar00rootroot00000000000000export function fn () { console.log('lib1 fn'); } export function treeshaked () { console.log('this is tree shaken!'); }rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/lib/lib2.js000066400000000000000000000000631415504077600276550ustar00rootroot00000000000000export function fn () { console.log('lib2 fn'); }rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/main1.js000066400000000000000000000002341415504077600272640ustar00rootroot00000000000000import { fn } from './deps/dep1.js'; import { fn as fn2 } from './deps/dep2.js'; export default class Main1 { constructor () { fn(); fn2(); } }rollup-2.61.1/test/chunking-form/samples/deprecated/preserve-modules/main2.js000066400000000000000000000003231415504077600272640ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/dynamic-import-chained/000077500000000000000000000000001415504077600246465ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-chained/_config.js000066400000000000000000000001521415504077600266060ustar00rootroot00000000000000module.exports = { description: 'includes chained dynamic imports', options: { input: 'main.js' } }; rollup-2.61.1/test/chunking-form/samples/dynamic-import-chained/_expected/000077500000000000000000000000001415504077600266065ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-chained/_expected/amd/000077500000000000000000000000001415504077600273475ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-chained/_expected/amd/generated-dep1.js000066400000000000000000000002631415504077600324730ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; console.log('dep1'); new Promise(function (resolve, reject) { require(['./generated-dep2'], resolve, reject); }); })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-chained/_expected/amd/generated-dep2.js000066400000000000000000000001011415504077600324630ustar00rootroot00000000000000define((function () { 'use strict'; console.log('dep2'); })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-chained/_expected/amd/main.js000066400000000000000000000002631415504077600306320ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; console.log('main'); new Promise(function (resolve, reject) { require(['./generated-dep1'], resolve, reject); }); })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-chained/_expected/cjs/000077500000000000000000000000001415504077600273655ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-chained/_expected/cjs/generated-dep1.js000066400000000000000000000001641415504077600325110ustar00rootroot00000000000000'use strict'; console.log('dep1'); Promise.resolve().then(function () { return require('./generated-dep2.js'); }); rollup-2.61.1/test/chunking-form/samples/dynamic-import-chained/_expected/cjs/generated-dep2.js000066400000000000000000000000441415504077600325070ustar00rootroot00000000000000'use strict'; console.log('dep2'); rollup-2.61.1/test/chunking-form/samples/dynamic-import-chained/_expected/cjs/main.js000066400000000000000000000001641415504077600306500ustar00rootroot00000000000000'use strict'; console.log('main'); Promise.resolve().then(function () { return require('./generated-dep1.js'); }); rollup-2.61.1/test/chunking-form/samples/dynamic-import-chained/_expected/es/000077500000000000000000000000001415504077600272155ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-chained/_expected/es/generated-dep1.js000066400000000000000000000000641415504077600323400ustar00rootroot00000000000000console.log('dep1'); import('./generated-dep2.js'); rollup-2.61.1/test/chunking-form/samples/dynamic-import-chained/_expected/es/generated-dep2.js000066400000000000000000000000251415504077600323360ustar00rootroot00000000000000console.log('dep2'); rollup-2.61.1/test/chunking-form/samples/dynamic-import-chained/_expected/es/main.js000066400000000000000000000000641415504077600304770ustar00rootroot00000000000000console.log('main'); import('./generated-dep1.js'); rollup-2.61.1/test/chunking-form/samples/dynamic-import-chained/_expected/system/000077500000000000000000000000001415504077600301325ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-chained/_expected/system/generated-dep1.js000066400000000000000000000002661415504077600332610ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { console.log('dep1'); module.import('./generated-dep2.js'); }) }; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-chained/_expected/system/generated-dep2.js000066400000000000000000000001761415504077600332620ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('dep2'); }) }; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-chained/_expected/system/main.js000066400000000000000000000002661415504077600314200ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { console.log('main'); module.import('./generated-dep1.js'); }) }; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-chained/dep1.js000066400000000000000000000000521415504077600260320ustar00rootroot00000000000000console.log('dep1'); import('./dep2.js'); rollup-2.61.1/test/chunking-form/samples/dynamic-import-chained/dep2.js000066400000000000000000000000251415504077600260330ustar00rootroot00000000000000console.log('dep2'); rollup-2.61.1/test/chunking-form/samples/dynamic-import-chained/main.js000066400000000000000000000001651415504077600261320ustar00rootroot00000000000000console.log('main'); // to mess up the internal execution order if (false) import('./dep2.js') import('./dep1.js'); rollup-2.61.1/test/chunking-form/samples/dynamic-import-chunking/000077500000000000000000000000001415504077600250615ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-chunking/_config.js000066400000000000000000000002231415504077600270200ustar00rootroot00000000000000module.exports = { description: 'Code splitting with dynamic import', options: { input: ['main.js'], preserveEntrySignatures: 'strict' } }; rollup-2.61.1/test/chunking-form/samples/dynamic-import-chunking/_expected/000077500000000000000000000000001415504077600270215ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-chunking/_expected/amd/000077500000000000000000000000001415504077600275625ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-chunking/_expected/amd/generated-dep2.js000066400000000000000000000002571415504077600327120ustar00rootroot00000000000000define(['exports', './generated-main'], (function (exports, main) { 'use strict'; function mult (num) { return num + main.multiplier; } exports.mult = mult; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-chunking/_expected/amd/generated-main.js000066400000000000000000000010161415504077600327760ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/dynamic-import-chunking/_expected/amd/main.js000066400000000000000000000001061415504077600310410ustar00rootroot00000000000000define(['./generated-main'], (function (main) { 'use strict'; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-chunking/_expected/cjs/000077500000000000000000000000001415504077600276005ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-chunking/_expected/cjs/generated-dep2.js000066400000000000000000000002111415504077600327160ustar00rootroot00000000000000'use strict'; var main = require('./generated-main.js'); function mult (num) { return num + main.multiplier; } exports.mult = mult; rollup-2.61.1/test/chunking-form/samples/dynamic-import-chunking/_expected/cjs/generated-main.js000066400000000000000000000006311415504077600330160ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/dynamic-import-chunking/_expected/cjs/main.js000066400000000000000000000000601415504077600310560ustar00rootroot00000000000000'use strict'; require('./generated-main.js'); rollup-2.61.1/test/chunking-form/samples/dynamic-import-chunking/_expected/es/000077500000000000000000000000001415504077600274305ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-chunking/_expected/es/generated-dep2.js000066400000000000000000000001751415504077600325570ustar00rootroot00000000000000import { m as multiplier } from './generated-main.js'; function mult (num) { return num + multiplier; } export { mult }; rollup-2.61.1/test/chunking-form/samples/dynamic-import-chunking/_expected/es/generated-main.js000066400000000000000000000005241415504077600326470ustar00rootroot00000000000000var 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-2.61.1/test/chunking-form/samples/dynamic-import-chunking/_expected/es/main.js000066400000000000000000000000361415504077600307110ustar00rootroot00000000000000import './generated-main.js'; rollup-2.61.1/test/chunking-form/samples/dynamic-import-chunking/_expected/system/000077500000000000000000000000001415504077600303455ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-chunking/_expected/system/generated-dep2.js000066400000000000000000000005051415504077600334710ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/dynamic-import-chunking/_expected/system/generated-main.js000066400000000000000000000010561415504077600335650ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/dynamic-import-chunking/_expected/system/main.js000066400000000000000000000002311415504077600316230ustar00rootroot00000000000000System.register(['./generated-main.js'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-chunking/dep1.js000066400000000000000000000003141415504077600262460ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/dynamic-import-chunking/dep2.js000066400000000000000000000001421415504077600262460ustar00rootroot00000000000000import { multiplier } from './dep4.js'; export function mult (num) { return num + multiplier; }rollup-2.61.1/test/chunking-form/samples/dynamic-import-chunking/dep3.js000066400000000000000000000001421415504077600262470ustar00rootroot00000000000000import { multiplier } from './dep4.js'; export function calc (num) { return num * multiplier; }rollup-2.61.1/test/chunking-form/samples/dynamic-import-chunking/dep4.js000066400000000000000000000000321415504077600262460ustar00rootroot00000000000000export var multiplier = 7;rollup-2.61.1/test/chunking-form/samples/dynamic-import-chunking/main.js000066400000000000000000000001611415504077600263410ustar00rootroot00000000000000import { fn, dynamic } from './dep1.js'; console.log(fn(5)); dynamic(10).then(num => { console.log(num); }); rollup-2.61.1/test/chunking-form/samples/dynamic-import-comments/000077500000000000000000000000001415504077600251005ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-comments/_config.js000066400000000000000000000004411415504077600270410ustar00rootroot00000000000000module.exports = { description: 'does not remove inline comments inside dynamic imports', options: { input: 'main.js', onwarn() {}, plugins: { renderDynamicImport() { return { left: 'foobar(', right: ')' }; }, resolveDynamicImport() { return false; } } } }; rollup-2.61.1/test/chunking-form/samples/dynamic-import-comments/_expected/000077500000000000000000000000001415504077600270405ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-comments/_expected/amd/000077500000000000000000000000001415504077600276015ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-comments/_expected/amd/main.js000066400000000000000000000002031415504077600310560ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; foobar( /* webpackChunkName: "chunk-name" */ './foo'/*suffix*/); })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-comments/_expected/cjs/000077500000000000000000000000001415504077600276175ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-comments/_expected/cjs/main.js000066400000000000000000000001231415504077600310750ustar00rootroot00000000000000'use strict'; foobar( /* webpackChunkName: "chunk-name" */ './foo.js'/*suffix*/); rollup-2.61.1/test/chunking-form/samples/dynamic-import-comments/_expected/es/000077500000000000000000000000001415504077600274475ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-comments/_expected/es/main.js000066400000000000000000000001041415504077600307240ustar00rootroot00000000000000foobar( /* webpackChunkName: "chunk-name" */ './foo.js'/*suffix*/); rollup-2.61.1/test/chunking-form/samples/dynamic-import-comments/_expected/system/000077500000000000000000000000001415504077600303645ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-comments/_expected/system/main.js000066400000000000000000000003021415504077600316410ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { foobar( /* webpackChunkName: "chunk-name" */ './foo.js'/*suffix*/); }) }; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-comments/main.js000066400000000000000000000001431415504077600263600ustar00rootroot00000000000000import /* () should not break */ ( /* webpackChunkName: "chunk-name" */ './foo.js'/*suffix*/); rollup-2.61.1/test/chunking-form/samples/dynamic-import-dynamic/000077500000000000000000000000001415504077600246775ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-dynamic/_config.js000066400000000000000000000001561415504077600266430ustar00rootroot00000000000000module.exports = { description: 'Code splitting with dynamic import', options: { input: ['main.js'] } }; rollup-2.61.1/test/chunking-form/samples/dynamic-import-dynamic/_expected/000077500000000000000000000000001415504077600266375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-dynamic/_expected/amd/000077500000000000000000000000001415504077600274005ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-dynamic/_expected/amd/main.js000066400000000000000000000012261415504077600306630ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; 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 dep = 'dep'; (function (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }); })(dep); })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-dynamic/_expected/cjs/000077500000000000000000000000001415504077600274165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-dynamic/_expected/cjs/main.js000066400000000000000000000010561415504077600307020ustar00rootroot00000000000000'use strict'; 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 dep = 'dep'; (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(dep); rollup-2.61.1/test/chunking-form/samples/dynamic-import-dynamic/_expected/es/000077500000000000000000000000001415504077600272465ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-dynamic/_expected/es/main.js000066400000000000000000000000371415504077600305300ustar00rootroot00000000000000var dep = 'dep'; import(dep); rollup-2.61.1/test/chunking-form/samples/dynamic-import-dynamic/_expected/system/000077500000000000000000000000001415504077600301635ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-dynamic/_expected/system/main.js000066400000000000000000000002411415504077600314420ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { var dep = 'dep'; module.import(dep); }) }; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-dynamic/dep.js000066400000000000000000000000301415504077600257760ustar00rootroot00000000000000export var dep = 'dep'; rollup-2.61.1/test/chunking-form/samples/dynamic-import-dynamic/main.js000066400000000000000000000000521415504077600261560ustar00rootroot00000000000000import { dep } from './dep'; import(dep);rollup-2.61.1/test/chunking-form/samples/dynamic-import-external/000077500000000000000000000000001415504077600250755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-external/_config.js000066400000000000000000000003301415504077600270330ustar00rootroot00000000000000module.exports = { description: 'marks dynamic imports as external when resolveDynamicImport returns false', options: { input: 'main.js', plugins: { resolveDynamicImport() { return false; } } } }; rollup-2.61.1/test/chunking-form/samples/dynamic-import-external/_expected/000077500000000000000000000000001415504077600270355ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-external/_expected/amd/000077500000000000000000000000001415504077600275765ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-external/_expected/amd/main.js000066400000000000000000000011511415504077600310560ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; 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); } new Promise(function (resolve, reject) { require(['./foo'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }); })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-external/_expected/cjs/000077500000000000000000000000001415504077600276145ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-external/_expected/cjs/main.js000066400000000000000000000010051415504077600310720ustar00rootroot00000000000000'use strict'; 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); } Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('./foo.js')); }); rollup-2.61.1/test/chunking-form/samples/dynamic-import-external/_expected/es/000077500000000000000000000000001415504077600274445ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-external/_expected/es/main.js000066400000000000000000000000241415504077600307220ustar00rootroot00000000000000import('./foo.js'); rollup-2.61.1/test/chunking-form/samples/dynamic-import-external/_expected/system/000077500000000000000000000000001415504077600303615ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-external/_expected/system/main.js000066400000000000000000000002231415504077600316400ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./foo.js'); }) }; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-external/foo.js000066400000000000000000000000241415504077600262120ustar00rootroot00000000000000console.log('foo'); rollup-2.61.1/test/chunking-form/samples/dynamic-import-external/main.js000066400000000000000000000000241415504077600263530ustar00rootroot00000000000000import('./foo.js'); rollup-2.61.1/test/chunking-form/samples/dynamic-import-facade/000077500000000000000000000000001415504077600244565ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-facade/_config.js000066400000000000000000000002021415504077600264120ustar00rootroot00000000000000module.exports = { description: 'makes sure dynamic chunks are not tainted', options: { input: ['main1.js', 'main2.js'] } }; rollup-2.61.1/test/chunking-form/samples/dynamic-import-facade/_expected/000077500000000000000000000000001415504077600264165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-facade/_expected/amd/000077500000000000000000000000001415504077600271575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-facade/_expected/amd/generated-dynamic.js000066400000000000000000000005171415504077600331000ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/dynamic-import-facade/_expected/amd/main1.js000066400000000000000000000003761415504077600305300ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/dynamic-import-facade/_expected/amd/main2.js000066400000000000000000000002001415504077600305130ustar00rootroot00000000000000define(['./generated-dynamic'], (function (dynamic) { 'use strict'; console.log('main2', dynamic.dynamic, dynamic.dep); })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-facade/_expected/cjs/000077500000000000000000000000001415504077600271755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-facade/_expected/cjs/generated-dynamic.js000066400000000000000000000004241415504077600331130ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/dynamic-import-facade/_expected/cjs/main1.js000066400000000000000000000003001415504077600305310ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/dynamic-import-facade/_expected/cjs/main2.js000066400000000000000000000001651415504077600305430ustar00rootroot00000000000000'use strict'; var dynamic = require('./generated-dynamic.js'); console.log('main2', dynamic.dynamic, dynamic.dep); rollup-2.61.1/test/chunking-form/samples/dynamic-import-facade/_expected/es/000077500000000000000000000000001415504077600270255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-facade/_expected/es/generated-dynamic.js000066400000000000000000000003531415504077600327440ustar00rootroot00000000000000console.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-2.61.1/test/chunking-form/samples/dynamic-import-facade/_expected/es/main1.js000066400000000000000000000001701415504077600303660ustar00rootroot00000000000000import('./generated-dynamic.js').then(function (n) { return n.b; }).then(({dynamic}) => console.log('main1', dynamic)); rollup-2.61.1/test/chunking-form/samples/dynamic-import-facade/_expected/es/main2.js000066400000000000000000000001461415504077600303720ustar00rootroot00000000000000import { d as dynamic, a as dep } from './generated-dynamic.js'; console.log('main2', dynamic, dep); rollup-2.61.1/test/chunking-form/samples/dynamic-import-facade/_expected/system/000077500000000000000000000000001415504077600277425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-facade/_expected/system/generated-dynamic.js000066400000000000000000000005641415504077600336650ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/dynamic-import-facade/_expected/system/main1.js000066400000000000000000000003671415504077600313130ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/dynamic-import-facade/_expected/system/main2.js000066400000000000000000000004101415504077600313010ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/dynamic-import-facade/dep.js000066400000000000000000000000571415504077600255660ustar00rootroot00000000000000console.log('dep'); export const dep = 'dep'; rollup-2.61.1/test/chunking-form/samples/dynamic-import-facade/dynamic.js000066400000000000000000000001331415504077600264350ustar00rootroot00000000000000import {dep} from './dep'; console.log('dynamic', dep); export const dynamic = 'dynamic'; rollup-2.61.1/test/chunking-form/samples/dynamic-import-facade/main1.js000066400000000000000000000001131415504077600260140ustar00rootroot00000000000000import('./dynamic.js').then(({dynamic}) => console.log('main1', dynamic)); rollup-2.61.1/test/chunking-form/samples/dynamic-import-facade/main2.js000066400000000000000000000001551415504077600260230ustar00rootroot00000000000000import { dep } from './dep.js'; import { dynamic } from './dynamic.js'; console.log('main2', dynamic, dep); rollup-2.61.1/test/chunking-form/samples/dynamic-import-inline-colouring/000077500000000000000000000000001415504077600265305ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-inline-colouring/_config.js000066400000000000000000000002171415504077600304720ustar00rootroot00000000000000module.exports = { description: 'Handle dynamic imports that are part of a static graph', options: { input: ['main1.js', 'main2.js'] } }; rollup-2.61.1/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/000077500000000000000000000000001415504077600304705ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/amd/000077500000000000000000000000001415504077600312315ustar00rootroot00000000000000generated-separate.js000066400000000000000000000002641415504077600352520ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/amd/main1.js000066400000000000000000000011341415504077600325730ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/amd/main2.js000066400000000000000000000004461415504077600326010ustar00rootroot00000000000000define(['require', 'exports'], (function (require, exports) { 'use strict'; const separate = new Promise(function (resolve, reject) { require(['./generated-separate'], resolve, reject); }); exports.separate = separate; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/cjs/000077500000000000000000000000001415504077600312475ustar00rootroot00000000000000generated-separate.js000066400000000000000000000001771415504077600352730ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/cjs/main1.js000066400000000000000000000007771415504077600326250ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/cjs/main2.js000066400000000000000000000003221415504077600326100ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const separate = Promise.resolve().then(function () { return require('./generated-separate.js'); }); exports.separate = separate; rollup-2.61.1/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/es/000077500000000000000000000000001415504077600310775ustar00rootroot00000000000000generated-separate.js000066400000000000000000000001451415504077600351160ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/esvar separate = 'separate'; const x = 2; console.log('separate'); export { separate as default, x }; rollup-2.61.1/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/es/main1.js000066400000000000000000000005431415504077600324440ustar00rootroot00000000000000import './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-2.61.1/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/es/main2.js000066400000000000000000000001121415504077600324350ustar00rootroot00000000000000const separate = import('./generated-separate.js'); export { separate }; rollup-2.61.1/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/system/000077500000000000000000000000001415504077600320145ustar00rootroot00000000000000generated-separate.js000066400000000000000000000003311415504077600360300ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/system/main1.js000066400000000000000000000010321415504077600333530ustar00rootroot00000000000000System.register(['./generated-separate.js'], (function (exports, module) { 'use strict'; return { setters: [function () {}], 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-2.61.1/test/chunking-form/samples/dynamic-import-inline-colouring/_expected/system/main2.js000066400000000000000000000003101415504077600333520ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const separate = exports('separate', module.import('./generated-separate.js')); }) }; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-inline-colouring/inlined.js000066400000000000000000000001061415504077600305050ustar00rootroot00000000000000export default 'inlined'; export const x = 1; console.log('inlined'); rollup-2.61.1/test/chunking-form/samples/dynamic-import-inline-colouring/main1.js000066400000000000000000000002201415504077600300650ustar00rootroot00000000000000import './inlined.js'; import './separate.js'; export const inlined = import('./inlined.js'); export const separate = import('./separate.js'); rollup-2.61.1/test/chunking-form/samples/dynamic-import-inline-colouring/main2.js000066400000000000000000000000611415504077600300710ustar00rootroot00000000000000export const separate = import('./separate.js'); rollup-2.61.1/test/chunking-form/samples/dynamic-import-inline-colouring/separate.js000066400000000000000000000001101415504077600306620ustar00rootroot00000000000000export default 'separate'; export const x = 2; console.log('separate'); rollup-2.61.1/test/chunking-form/samples/dynamic-import-inlining-object/000077500000000000000000000000001415504077600263265ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-inlining-object/_config.js000066400000000000000000000003001415504077600302610ustar00rootroot00000000000000module.exports = { description: 'supports an object with a single entry when inlining dynamic imports', options: { output: { inlineDynamicImports: true }, input: { entry: 'main' } } }; rollup-2.61.1/test/chunking-form/samples/dynamic-import-inlining-object/_expected/000077500000000000000000000000001415504077600302665ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-inlining-object/_expected/amd/000077500000000000000000000000001415504077600310275ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-inlining-object/_expected/amd/entry.js000066400000000000000000000004741415504077600325330ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const bar = 2; Promise.resolve().then(function () { return foo$1; }); const foo = 1; var foo$1 = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo }); exports.bar = bar; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-inlining-object/_expected/cjs/000077500000000000000000000000001415504077600310455ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-inlining-object/_expected/cjs/entry.js000066400000000000000000000004031415504077600325410ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const bar = 2; Promise.resolve().then(function () { return foo$1; }); const foo = 1; var foo$1 = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo }); exports.bar = bar; rollup-2.61.1/test/chunking-form/samples/dynamic-import-inlining-object/_expected/es/000077500000000000000000000000001415504077600306755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-inlining-object/_expected/es/entry.js000066400000000000000000000002611415504077600323730ustar00rootroot00000000000000const bar = 2; Promise.resolve().then(function () { return foo$1; }); const foo = 1; var foo$1 = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo }); export { bar }; rollup-2.61.1/test/chunking-form/samples/dynamic-import-inlining-object/_expected/system/000077500000000000000000000000001415504077600316125ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-inlining-object/_expected/system/entry.js000066400000000000000000000004621415504077600333130ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const bar = exports('bar', 2); Promise.resolve().then(function () { return foo$1; }); const foo = 1; var foo$1 = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo }); }) }; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-inlining-object/foo.js000066400000000000000000000000251415504077600274440ustar00rootroot00000000000000export const foo = 1;rollup-2.61.1/test/chunking-form/samples/dynamic-import-inlining-object/main.js000066400000000000000000000000521415504077600276050ustar00rootroot00000000000000export const bar = 2; import('./foo.js'); rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-default/000077500000000000000000000000001415504077600256565ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-default/_config.js000066400000000000000000000002721415504077600276210ustar00rootroot00000000000000module.exports = { description: 'correctly imports dynamic namespaces with only a default export from entry- and non-entry-point chunks', options: { input: ['main', 'entry'] } }; rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-default/_expected/000077500000000000000000000000001415504077600276165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-default/_expected/amd/000077500000000000000000000000001415504077600303575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-default/_expected/amd/entry.js000066400000000000000000000001141415504077600320520ustar00rootroot00000000000000define((function () { 'use strict'; var entry = 42; return entry; })); generated-other.js000066400000000000000000000001561415504077600337150ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-default/_expected/amddefine(['exports'], (function (exports) { 'use strict'; var other = 42; exports["default"] = other; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-default/_expected/amd/main.js000066400000000000000000000007041415504077600316420ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/dynamic-import-only-default/_expected/cjs/000077500000000000000000000000001415504077600303755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-default/_expected/cjs/entry.js000066400000000000000000000000701415504077600320710ustar00rootroot00000000000000'use strict'; var entry = 42; module.exports = entry; generated-other.js000066400000000000000000000000741415504077600337320ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-default/_expected/cjs'use strict'; var other = 42; exports["default"] = other; rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-default/_expected/cjs/main.js000066400000000000000000000005541415504077600316630ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/dynamic-import-only-default/_expected/es/000077500000000000000000000000001415504077600302255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-default/_expected/es/entry.js000066400000000000000000000000561415504077600317250ustar00rootroot00000000000000var entry = 42; export { entry as default }; rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-default/_expected/es/generated-other.js000066400000000000000000000000561415504077600336410ustar00rootroot00000000000000var other = 42; export { other as default }; rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-default/_expected/es/main.js000066400000000000000000000001551415504077600315100ustar00rootroot00000000000000var main = Promise.all([import('./entry.js'), import('./generated-other.js')]); export { main as default }; rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-default/_expected/system/000077500000000000000000000000001415504077600311425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-default/_expected/system/entry.js000066400000000000000000000002241415504077600326370ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var entry = exports('default', 42); }) }; })); generated-other.js000066400000000000000000000002241415504077600344740ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-default/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var other = exports('default', 42); }) }; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-default/_expected/system/main.js000066400000000000000000000003521415504077600324240ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/dynamic-import-only-default/entry.js000066400000000000000000000000231415504077600273500ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-default/main.js000066400000000000000000000001121415504077600271320ustar00rootroot00000000000000export default Promise.all([import('./entry.js'), import('./other.js')]); rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-default/other.js000066400000000000000000000000231415504077600273300ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-reexports/000077500000000000000000000000001415504077600262655ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-reexports/_config.js000066400000000000000000000002331415504077600302250ustar00rootroot00000000000000module.exports = { description: 'handles dynamic imports when the imported module only reexports from other modules', options: { input: ['main'] } }; rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-reexports/_expected/000077500000000000000000000000001415504077600302255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-reexports/_expected/amd/000077500000000000000000000000001415504077600307665ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001531415504077600346240ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-reexports/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value = 42; exports.value = value; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-reexports/_expected/amd/main.js000066400000000000000000000003101415504077600322420ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic'], resolve, reject); }).then(({ value }) => console.log(value)); })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-reexports/_expected/cjs/000077500000000000000000000000001415504077600310045ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000000711415504077600346410ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-reexports/_expected/cjs'use strict'; const value = 42; exports.value = value; rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-reexports/_expected/cjs/main.js000066400000000000000000000002121415504077600322610ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(({ value }) => console.log(value)); rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-reexports/_expected/es/000077500000000000000000000000001415504077600306345ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000000451415504077600344720ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-reexports/_expected/esconst value = 42; export { value }; rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-reexports/_expected/es/main.js000066400000000000000000000001121415504077600321100ustar00rootroot00000000000000import('./generated-dynamic.js').then(({ value }) => console.log(value)); rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-reexports/_expected/system/000077500000000000000000000000001415504077600315515ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000002241415504077600354060ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-reexports/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('value', 42); }) }; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-reexports/_expected/system/main.js000066400000000000000000000003111415504077600330260ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dynamic.js').then(({ value }) => console.log(value)); }) }; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-reexports/dep.js000066400000000000000000000000311415504077600273650ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-reexports/dynamic.js000066400000000000000000000000351415504077600302450ustar00rootroot00000000000000export {value} from './dep'; rollup-2.61.1/test/chunking-form/samples/dynamic-import-only-reexports/main.js000066400000000000000000000000751415504077600275510ustar00rootroot00000000000000import('./dynamic').then(({ value }) => console.log(value)); rollup-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported-2/000077500000000000000000000000001415504077600274045ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported-2/_config.js000066400000000000000000000003151415504077600313450ustar00rootroot00000000000000module.exports = { description: 'handles dynamic imports of previously statically imported chunks that are also dynamically imported by other chunks', options: { input: ['main.js', 'main2.js'] } }; rollup-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/000077500000000000000000000000001415504077600313445ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/amd/000077500000000000000000000000001415504077600321055ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000005651415504077600351570ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/amd/main.js000066400000000000000000000001531415504077600333660ustar00rootroot00000000000000define(['./generated-dep1'], (function (dep1) { 'use strict'; console.log(dep1.foo(), dep1.bar()); })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/amd/main2.js000066400000000000000000000003511415504077600334500ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/cjs/000077500000000000000000000000001415504077600321235ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000004671415504077600351760ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/cjs/main.js000066400000000000000000000001401415504077600334000ustar00rootroot00000000000000'use strict'; var dep1 = require('./generated-dep1.js'); console.log(dep1.foo(), dep1.bar()); rollup-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/cjs/main2.js000066400000000000000000000002531415504077600334670ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-dep1.js'); }).then(function (n) { return n.dep1; }).then(({ bar }) => console.log(bar())); rollup-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/es/000077500000000000000000000000001415504077600317535ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000004271415504077600350220ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/es/main.js000066400000000000000000000001261415504077600332340ustar00rootroot00000000000000import { f as foo, b as bar } from './generated-dep1.js'; console.log(foo(), bar()); rollup-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/es/main2.js000066400000000000000000000001501415504077600333130ustar00rootroot00000000000000import('./generated-dep1.js').then(function (n) { return n.d; }).then(({ bar }) => console.log(bar())); rollup-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported-2/_expected/system/000077500000000000000000000000001415504077600326705ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000006751415504077600357440ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003641415504077600340760ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003471415504077600341610ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported-2/dep1.js000066400000000000000000000001111415504077600305640ustar00rootroot00000000000000import {foo} from './dep2.js'; export function bar() { return foo(); } rollup-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported-2/dep2.js000066400000000000000000000001461415504077600305750ustar00rootroot00000000000000export function foo() { return 'dep2'; } import('./dep1.js').then(({ bar }) => console.log(bar())); rollup-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported-2/main.js000066400000000000000000000001361415504077600306660ustar00rootroot00000000000000import { bar } from './dep1.js'; import { foo } from './dep2.js'; console.log(foo(), bar()); rollup-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported-2/main2.js000066400000000000000000000000731415504077600307500ustar00rootroot00000000000000import('./dep1.js').then(({ bar }) => console.log(bar())); rollup-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported/000077500000000000000000000000001415504077600272455ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported/_config.js000066400000000000000000000002141415504077600312040ustar00rootroot00000000000000module.exports = { description: 'handles dynamic imports of previously statically imported chunks', options: { input: ['main.js'] } }; rollup-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported/_expected/000077500000000000000000000000001415504077600312055ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported/_expected/amd/000077500000000000000000000000001415504077600317465ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported/_expected/amd/main.js000066400000000000000000000004771415504077600332400ustar00rootroot00000000000000define((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-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported/_expected/cjs/000077500000000000000000000000001415504077600317645ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported/_expected/cjs/main.js000066400000000000000000000004271415504077600332510ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported/_expected/es/000077500000000000000000000000001415504077600316145ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported/_expected/es/main.js000066400000000000000000000004101415504077600330710ustar00rootroot00000000000000function 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-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported/_expected/system/000077500000000000000000000000001415504077600325315ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported/_expected/system/main.js000066400000000000000000000006221415504077600340130ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported/dep1.js000066400000000000000000000001111415504077600304250ustar00rootroot00000000000000import {foo} from './dep2.js'; export function bar() { return foo(); } rollup-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported/dep2.js000066400000000000000000000001461415504077600304360ustar00rootroot00000000000000export function foo() { return 'dep2'; } import('./dep1.js').then(({ bar }) => console.log(bar())); rollup-2.61.1/test/chunking-form/samples/dynamic-import-statically-imported/main.js000066400000000000000000000001361415504077600305270ustar00rootroot00000000000000import { bar } from './dep1.js'; import { foo } from './dep2.js'; console.log(foo(), bar()); rollup-2.61.1/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/000077500000000000000000000000001415504077600322665ustar00rootroot00000000000000_config.js000066400000000000000000000006051415504077600341520ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modulesmodule.exports = { 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: { preserveModules: true } } }; _expected/000077500000000000000000000000001415504077600341475ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modulesamd/000077500000000000000000000000001415504077600347105ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/_expectedlib.js000066400000000000000000000001641415504077600360150ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/_expected/amddefine((function () { 'use strict'; const __moduleExports = { foo: 'bar' }; var lib = 'baz'; return lib; })); main.js000066400000000000000000000005151415504077600361730ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/_expected/amddefine(['require'], (function (require) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, 'default': e }); } new Promise(function (resolve, reject) { require(['./lib'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefaultOnly(m)); }, reject); }).then(console.log); })); cjs/000077500000000000000000000000001415504077600347265ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/_expectedlib.js000066400000000000000000000001371415504077600360330ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/_expected/cjs'use strict'; const __moduleExports = { foo: 'bar' }; var lib = 'baz'; module.exports = lib; main.js000066400000000000000000000003711415504077600362110ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/_expected/cjs'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, 'default': e }); } Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./lib.js')); }).then(console.log); es/000077500000000000000000000000001415504077600345565ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/_expectedlib.js000066400000000000000000000001251415504077600356600ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/_expected/esconst __moduleExports = { foo: 'bar' }; var lib = 'baz'; export { lib as default }; main.js000066400000000000000000000000461415504077600360400ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/_expected/esimport('./lib.js').then(console.log); system/000077500000000000000000000000001415504077600354735ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/_expectedlib.js000066400000000000000000000003001415504077600365700ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const __moduleExports = { foo: 'bar' }; var lib = exports('default', 'baz'); }) }; })); main.js000066400000000000000000000002451415504077600367560ustar00rootroot00000000000000rollup-2.61.1/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(console.log); }) }; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/lib.js000066400000000000000000000001051415504077600333660ustar00rootroot00000000000000export const __moduleExports = { foo: 'bar' }; export default 'baz'; rollup-2.61.1/test/chunking-form/samples/dynamic-import-synthetic-exports-preserve-modules/main.js000066400000000000000000000000461415504077600335500ustar00rootroot00000000000000import('./lib.js').then(console.log); rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-1/000077500000000000000000000000001415504077600257725ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-1/_config.js000066400000000000000000000002441415504077600277340ustar00rootroot00000000000000module.exports = { description: 'uses tree-shaking information to improve chunking', options: { input: { entryA: 'main1.js', entryB: 'main2.js' } } }; rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/000077500000000000000000000000001415504077600277325ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/amd/000077500000000000000000000000001415504077600304735ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/amd/entryA.js000066400000000000000000000001601415504077600322700ustar00rootroot00000000000000define((function () { 'use strict'; console.log('dep'); var value = 1; console.log('main1', value); })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/amd/entryB.js000066400000000000000000000001021415504077600322650ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main2'); })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/cjs/000077500000000000000000000000001415504077600305115ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/cjs/entryA.js000066400000000000000000000001211415504077600323030ustar00rootroot00000000000000'use strict'; console.log('dep'); var value = 1; console.log('main1', value); rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/cjs/entryB.js000066400000000000000000000000451415504077600323110ustar00rootroot00000000000000'use strict'; console.log('main2'); rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/es/000077500000000000000000000000001415504077600303415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/es/entryA.js000066400000000000000000000001021415504077600321320ustar00rootroot00000000000000console.log('dep'); var value = 1; console.log('main1', value); rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/es/entryB.js000066400000000000000000000000261415504077600321400ustar00rootroot00000000000000console.log('main2'); rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/system/000077500000000000000000000000001415504077600312565ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/system/entryA.js000066400000000000000000000002611415504077600330550ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('dep'); var value = 1; console.log('main1', value); }) }; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-1/_expected/system/entryB.js000066400000000000000000000001771415504077600330640ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main2'); }) }; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-1/dep.js000066400000000000000000000000531415504077600270760ustar00rootroot00000000000000console.log('dep'); export var value = 1; rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-1/dep2.js000066400000000000000000000000651415504077600271630ustar00rootroot00000000000000console.log('dep2'); export { value } from './dep'; rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-1/main1.js000066400000000000000000000000751415504077600273370ustar00rootroot00000000000000import { value } from './dep'; console.log('main1', value); rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-1/main2.js000066400000000000000000000001521415504077600273340ustar00rootroot00000000000000if (false) { import('./dep2').then(({ value }) => console.log('main2', value)); } console.log('main2'); rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-2/000077500000000000000000000000001415504077600257735ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-2/_config.js000066400000000000000000000002511415504077600277330ustar00rootroot00000000000000module.exports = { description: 'does not expose exports of chunks which were used by tree-shaken dynamic imports', options: { input: ['main1.js', 'main2.js'] } }; rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/000077500000000000000000000000001415504077600277335ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/amd/000077500000000000000000000000001415504077600304745ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/amd/main1.js000066400000000000000000000001021415504077600320300ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main1'); })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/amd/main2.js000066400000000000000000000002201415504077600320320ustar00rootroot00000000000000define((function () { 'use strict'; console.log('dep'); const dep = 'dep'; console.log('dynamic', dep); console.log('main2', dep); })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/cjs/000077500000000000000000000000001415504077600305125ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/cjs/main1.js000066400000000000000000000000451415504077600320540ustar00rootroot00000000000000'use strict'; console.log('main1'); rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/cjs/main2.js000066400000000000000000000001601415504077600320530ustar00rootroot00000000000000'use strict'; console.log('dep'); const dep = 'dep'; console.log('dynamic', dep); console.log('main2', dep); rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/es/000077500000000000000000000000001415504077600303425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/es/main1.js000066400000000000000000000000261415504077600317030ustar00rootroot00000000000000console.log('main1'); rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/es/main2.js000066400000000000000000000001411415504077600317020ustar00rootroot00000000000000console.log('dep'); const dep = 'dep'; console.log('dynamic', dep); console.log('main2', dep); rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/system/000077500000000000000000000000001415504077600312575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/system/main1.js000066400000000000000000000001771415504077600326270ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main1'); }) }; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-2/_expected/system/main2.js000066400000000000000000000003231415504077600326210ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('dep'); const dep = 'dep'; console.log('dynamic', dep); console.log('main2', dep); }) }; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-2/dep.js000066400000000000000000000000561415504077600271020ustar00rootroot00000000000000console.log('dep'); export const dep = 'dep'; rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-2/dynamic.js000066400000000000000000000001351415504077600277540ustar00rootroot00000000000000import { dep } from './dep'; console.log('dynamic', dep); export const dynamic = 'dynamic'; rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-2/main1.js000066400000000000000000000000761415504077600273410ustar00rootroot00000000000000if (false) { import('./dynamic.js'); } console.log('main1'); rollup-2.61.1/test/chunking-form/samples/dynamic-import-tree-shaking-2/main2.js000066400000000000000000000001231415504077600273330ustar00rootroot00000000000000import { dep } from './dep.js'; import './dynamic.js'; console.log('main2', dep); rollup-2.61.1/test/chunking-form/samples/dynamic-import/000077500000000000000000000000001415504077600232555ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import/_config.js000066400000000000000000000003631415504077600252210ustar00rootroot00000000000000module.exports = { description: 'handles dynamic imports with a shared dependency', options: { input: ['main'], output: { chunkFileNames: 'chunks/[name].js' } }, runAmd: { exports(exports) { return exports.promise; } } }; rollup-2.61.1/test/chunking-form/samples/dynamic-import/_expected/000077500000000000000000000000001415504077600252155ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import/_expected/amd/000077500000000000000000000000001415504077600257565ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import/_expected/amd/chunks/000077500000000000000000000000001415504077600272515ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import/_expected/amd/chunks/main.js000066400000000000000000000006021415504077600305310ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/dynamic-import/_expected/amd/chunks/other.js000066400000000000000000000001641415504077600307310ustar00rootroot00000000000000define(['exports', './main'], (function (exports, main) { 'use strict'; exports.value = main.sharedValue; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import/_expected/amd/main.js000066400000000000000000000002721415504077600272410ustar00rootroot00000000000000define(['exports', './chunks/main'], (function (exports, main) { 'use strict'; exports.promise = main.promise; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/dynamic-import/_expected/cjs/000077500000000000000000000000001415504077600257745ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import/_expected/cjs/chunks/000077500000000000000000000000001415504077600272675ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import/_expected/cjs/chunks/main.js000066400000000000000000000004521415504077600305520ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/dynamic-import/_expected/cjs/chunks/other.js000066400000000000000000000001251415504077600307440ustar00rootroot00000000000000'use strict'; var main = require('./main.js'); exports.value = main.sharedValue; rollup-2.61.1/test/chunking-form/samples/dynamic-import/_expected/cjs/main.js000066400000000000000000000002321415504077600272530ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var main = require('./chunks/main.js'); exports.promise = main.promise; rollup-2.61.1/test/chunking-form/samples/dynamic-import/_expected/es/000077500000000000000000000000001415504077600256245ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import/_expected/es/chunks/000077500000000000000000000000001415504077600271175ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import/_expected/es/chunks/main.js000066400000000000000000000003271415504077600304030ustar00rootroot00000000000000const 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-2.61.1/test/chunking-form/samples/dynamic-import/_expected/es/chunks/other.js000066400000000000000000000000501415504077600305710ustar00rootroot00000000000000export { s as value } from './main.js'; rollup-2.61.1/test/chunking-form/samples/dynamic-import/_expected/es/main.js000066400000000000000000000000611415504077600271030ustar00rootroot00000000000000export { p as promise } from './chunks/main.js'; rollup-2.61.1/test/chunking-form/samples/dynamic-import/_expected/system/000077500000000000000000000000001415504077600265415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import/_expected/system/chunks/000077500000000000000000000000001415504077600300345ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamic-import/_expected/system/chunks/main.js000066400000000000000000000005221415504077600313150ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/dynamic-import/_expected/system/chunks/other.js000066400000000000000000000002761415504077600315200ustar00rootroot00000000000000System.register(['./main.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('value', module.s); }], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import/_expected/system/main.js000066400000000000000000000003071415504077600300230ustar00rootroot00000000000000System.register(['./chunks/main.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('promise', module.p); }], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/dynamic-import/main.js000066400000000000000000000002701415504077600245360ustar00rootroot00000000000000import { sharedValue } from './shared'; assert.equal(sharedValue, 'shared'); export const promise = import('./other').then(result => assert.deepEqual(result, { value: 'shared' }) ); rollup-2.61.1/test/chunking-form/samples/dynamic-import/other.js000066400000000000000000000000611415504077600247310ustar00rootroot00000000000000export { sharedValue as value } from './shared'; rollup-2.61.1/test/chunking-form/samples/dynamic-import/shared.js000066400000000000000000000000451415504077600250600ustar00rootroot00000000000000export const sharedValue = 'shared'; rollup-2.61.1/test/chunking-form/samples/dynamically-import-facaded-entry/000077500000000000000000000000001415504077600266435ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamically-import-facaded-entry/_config.js000066400000000000000000000002721415504077600306060ustar00rootroot00000000000000module.exports = { description: 'uses existing entry facades for dynamic imports if present', options: { input: ['main.js', 'importer.js'], preserveEntrySignatures: 'strict' } }; rollup-2.61.1/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/000077500000000000000000000000001415504077600306035ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/amd/000077500000000000000000000000001415504077600313445ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001521415504077600352010ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/amddefine(['./generated-main'], (function (main) { 'use strict'; console.log('dynamic', main.value); })); generated-main.js000066400000000000000000000004761415504077600345120ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/amd/importer.js000066400000000000000000000003031415504077600335370ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./main'], resolve, reject); }).then(result => console.log('importer', result)); })); rollup-2.61.1/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/amd/main.js000066400000000000000000000002751415504077600326320ustar00rootroot00000000000000define(['exports', './generated-main'], (function (exports, main) { 'use strict'; exports.promise = main.promise; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/cjs/000077500000000000000000000000001415504077600313625ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001371415504077600352220ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003511415504077600345200ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/cjs/importer.js000066400000000000000000000002051415504077600335560ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./main.js'); }).then(result => console.log('importer', result)); rollup-2.61.1/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/cjs/main.js000066400000000000000000000002351415504077600326440ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var main = require('./generated-main.js'); exports.promise = main.promise; rollup-2.61.1/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/es/000077500000000000000000000000001415504077600312125ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001221415504077600350440ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/esimport { v as value } from './generated-main.js'; console.log('dynamic', value); generated-main.js000066400000000000000000000002341415504077600343500ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/es/importer.js000066400000000000000000000001051415504077600334050ustar00rootroot00000000000000import('./main.js').then(result => console.log('importer', result)); rollup-2.61.1/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/es/main.js000066400000000000000000000000641415504077600324740ustar00rootroot00000000000000export { p as promise } from './generated-main.js'; rollup-2.61.1/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/system/000077500000000000000000000000001415504077600321275ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000003441415504077600357670ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000004241415504077600352660ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003041415504077600342440ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/dynamically-import-facaded-entry/_expected/system/main.js000066400000000000000000000003121415504077600334050ustar00rootroot00000000000000System.register(['./generated-main.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('promise', module.p); }], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/dynamically-import-facaded-entry/dep.js000066400000000000000000000000231415504077600277440ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/dynamically-import-facaded-entry/dynamic.js000066400000000000000000000000761415504077600306300ustar00rootroot00000000000000import value from './dep.js'; console.log('dynamic', value); rollup-2.61.1/test/chunking-form/samples/dynamically-import-facaded-entry/importer.js000066400000000000000000000001051415504077600310360ustar00rootroot00000000000000import('./main.js').then(result => console.log('importer', result)); rollup-2.61.1/test/chunking-form/samples/dynamically-import-facaded-entry/main.js000066400000000000000000000001761415504077600301310ustar00rootroot00000000000000import value from './dep.js'; export const promise = import('./dynamic').then(result => console.log('main', result, value)); rollup-2.61.1/test/chunking-form/samples/dynamically-import-non-preserved-entry/000077500000000000000000000000001415504077600300635ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamically-import-non-preserved-entry/_config.js000066400000000000000000000002731415504077600320270ustar00rootroot00000000000000module.exports = { description: 'supports dynamically importing entries with additional exports', options: { input: ['main.js', 'importer.js'], preserveEntrySignatures: false } }; rollup-2.61.1/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/000077500000000000000000000000001415504077600320235ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/amd/000077500000000000000000000000001415504077600325645ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001401415504077600364160ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/amddefine(['./main'], (function (main) { 'use strict'; console.log('dynamic', main.value); })); importer.js000066400000000000000000000003511415504077600347030ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000007161415504077600337730ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/cjs/000077500000000000000000000000001415504077600326025ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001251415504077600364370ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/cjs'use strict'; var main = require('./main.js'); console.log('dynamic', main.value); importer.js000066400000000000000000000002531415504077600347220ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000005641415504077600340120ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/es/000077500000000000000000000000001415504077600324325ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001101415504077600362610ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/esimport { v as value } from './main.js'; console.log('dynamic', value); importer.js000066400000000000000000000001501415504077600345460ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/es/main.js000066400000000000000000000003521415504077600337140ustar00rootroot00000000000000var 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-2.61.1/test/chunking-form/samples/dynamically-import-non-preserved-entry/_expected/system/000077500000000000000000000000001415504077600333475ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000003321415504077600372040ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003471415504077600354730ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000005721415504077600345560ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/dynamically-import-non-preserved-entry/dep.js000066400000000000000000000000231415504077600311640ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/dynamically-import-non-preserved-entry/dynamic.js000066400000000000000000000000761415504077600320500ustar00rootroot00000000000000import value from './dep.js'; console.log('dynamic', value); rollup-2.61.1/test/chunking-form/samples/dynamically-import-non-preserved-entry/importer.js000066400000000000000000000001051415504077600322560ustar00rootroot00000000000000import('./main.js').then(result => console.log('importer', result)); rollup-2.61.1/test/chunking-form/samples/dynamically-import-non-preserved-entry/main.js000066400000000000000000000001761415504077600313510ustar00rootroot00000000000000import value from './dep.js'; export const promise = import('./dynamic').then(result => console.log('main', result, value)); rollup-2.61.1/test/chunking-form/samples/dynamically-import-tainted-entry/000077500000000000000000000000001415504077600267245ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamically-import-tainted-entry/_config.js000066400000000000000000000003071415504077600306660ustar00rootroot00000000000000module.exports = { description: 'supports dynamically importing entries with additional exports', options: { input: ['main.js', 'importer.js'], preserveEntrySignatures: 'allow-extension' } }; rollup-2.61.1/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/000077500000000000000000000000001415504077600306645ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/amd/000077500000000000000000000000001415504077600314255ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001401415504077600352570ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/amddefine(['./main'], (function (main) { 'use strict'; console.log('dynamic', main.value); })); rollup-2.61.1/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/amd/importer.js000066400000000000000000000003511415504077600336230ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/amd/main.js000066400000000000000000000007521415504077600327130ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/cjs/000077500000000000000000000000001415504077600314435ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001251415504077600353000ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/cjs'use strict'; var main = require('./main.js'); console.log('dynamic', main.value); rollup-2.61.1/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/cjs/importer.js000066400000000000000000000002531415504077600336420ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./main.js'); }).then(function (n) { return n.main; }).then(result => console.log('importer', result)); rollup-2.61.1/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/cjs/main.js000066400000000000000000000006171415504077600327310ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/es/000077500000000000000000000000001415504077600312735ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001101415504077600351220ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/esimport { v as value } from './main.js'; console.log('dynamic', value); rollup-2.61.1/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/es/importer.js000066400000000000000000000001501415504077600334660ustar00rootroot00000000000000import('./main.js').then(function (n) { return n.m; }).then(result => console.log('importer', result)); rollup-2.61.1/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/es/main.js000066400000000000000000000003631415504077600325570ustar00rootroot00000000000000var 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-2.61.1/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/system/000077500000000000000000000000001415504077600322105ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000003321415504077600360450ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003471415504077600343340ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/dynamically-import-tainted-entry/_expected/system/main.js000066400000000000000000000006161415504077600334750ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/dynamically-import-tainted-entry/dep.js000066400000000000000000000000231415504077600300250ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/dynamically-import-tainted-entry/dynamic.js000066400000000000000000000000761415504077600307110ustar00rootroot00000000000000import value from './dep.js'; console.log('dynamic', value); rollup-2.61.1/test/chunking-form/samples/dynamically-import-tainted-entry/importer.js000066400000000000000000000001051415504077600311170ustar00rootroot00000000000000import('./main.js').then(result => console.log('importer', result)); rollup-2.61.1/test/chunking-form/samples/dynamically-import-tainted-entry/main.js000066400000000000000000000001761415504077600302120ustar00rootroot00000000000000import value from './dep.js'; export const promise = import('./dynamic').then(result => console.log('main', result, value)); rollup-2.61.1/test/chunking-form/samples/dynamically-import-untainted-entry/000077500000000000000000000000001415504077600272675ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamically-import-untainted-entry/_config.js000066400000000000000000000003121415504077600312250ustar00rootroot00000000000000module.exports = { description: 'makes existing entries a proper facade if possible when importing dynamically', options: { input: ['main.js', 'importer.js'], preserveEntrySignatures: false } }; rollup-2.61.1/test/chunking-form/samples/dynamically-import-untainted-entry/_expected/000077500000000000000000000000001415504077600312275ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamically-import-untainted-entry/_expected/amd/000077500000000000000000000000001415504077600317705ustar00rootroot00000000000000importer.js000066400000000000000000000005541415504077600341140ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/dynamically-import-untainted-entry/_expected/amd/main.js000066400000000000000000000001121415504077600332440ustar00rootroot00000000000000define((function () { 'use strict'; var main = 42; return main; })); rollup-2.61.1/test/chunking-form/samples/dynamically-import-untainted-entry/_expected/cjs/000077500000000000000000000000001415504077600320065ustar00rootroot00000000000000importer.js000066400000000000000000000004301415504077600341230ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/dynamically-import-untainted-entry/_expected/cjs/main.js000066400000000000000000000000661415504077600332720ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-2.61.1/test/chunking-form/samples/dynamically-import-untainted-entry/_expected/es/000077500000000000000000000000001415504077600316365ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/dynamically-import-untainted-entry/_expected/es/importer.js000066400000000000000000000001051415504077600340310ustar00rootroot00000000000000import('./main.js').then(result => console.log('importer', result)); rollup-2.61.1/test/chunking-form/samples/dynamically-import-untainted-entry/_expected/es/main.js000066400000000000000000000000541415504077600331170ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-2.61.1/test/chunking-form/samples/dynamically-import-untainted-entry/_expected/system/000077500000000000000000000000001415504077600325535ustar00rootroot00000000000000importer.js000066400000000000000000000003041415504077600346700ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/dynamically-import-untainted-entry/_expected/system/main.js000066400000000000000000000002231415504077600340320ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', 42); }) }; })); rollup-2.61.1/test/chunking-form/samples/dynamically-import-untainted-entry/importer.js000066400000000000000000000001051415504077600314620ustar00rootroot00000000000000import('./main.js').then(result => console.log('importer', result)); rollup-2.61.1/test/chunking-form/samples/dynamically-import-untainted-entry/main.js000066400000000000000000000000231415504077600305440ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/emit-file/000077500000000000000000000000001415504077600221745ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/asset-file-names/000077500000000000000000000000001415504077600253315ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/asset-file-names/_config.js000066400000000000000000000004671415504077600273020ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/emit-file/asset-file-names/_expected/000077500000000000000000000000001415504077600272715ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/asset-file-names/_expected/amd/000077500000000000000000000000001415504077600300325ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/asset-file-names/_expected/amd/main.js000066400000000000000000000001011415504077600313040ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main'); })); rollup-2.61.1/test/chunking-form/samples/emit-file/asset-file-names/_expected/amd/txt/000077500000000000000000000000001415504077600306515ustar00rootroot000000000000007468331f-test.txt000066400000000000000000000000131415504077600333070ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/asset-file-names/_expected/amd/txthello worldrollup-2.61.1/test/chunking-form/samples/emit-file/asset-file-names/_expected/cjs/000077500000000000000000000000001415504077600300505ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/asset-file-names/_expected/cjs/main.js000066400000000000000000000000441415504077600313300ustar00rootroot00000000000000'use strict'; console.log('main'); rollup-2.61.1/test/chunking-form/samples/emit-file/asset-file-names/_expected/cjs/txt/000077500000000000000000000000001415504077600306675ustar00rootroot000000000000007468331f-test.txt000066400000000000000000000000131415504077600333250ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/asset-file-names/_expected/cjs/txthello worldrollup-2.61.1/test/chunking-form/samples/emit-file/asset-file-names/_expected/es/000077500000000000000000000000001415504077600277005ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/asset-file-names/_expected/es/main.js000066400000000000000000000000251415504077600311570ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/chunking-form/samples/emit-file/asset-file-names/_expected/es/txt/000077500000000000000000000000001415504077600305175ustar00rootroot000000000000007468331f-test.txt000066400000000000000000000000131415504077600331550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/asset-file-names/_expected/es/txthello worldrollup-2.61.1/test/chunking-form/samples/emit-file/asset-file-names/_expected/system/000077500000000000000000000000001415504077600306155ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/asset-file-names/_expected/system/main.js000066400000000000000000000001761415504077600321030ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-2.61.1/test/chunking-form/samples/emit-file/asset-file-names/_expected/system/txt/000077500000000000000000000000001415504077600314345ustar00rootroot000000000000007468331f-test.txt000066400000000000000000000000131415504077600340720ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/asset-file-names/_expected/system/txthello worldrollup-2.61.1/test/chunking-form/samples/emit-file/asset-file-names/main.js000066400000000000000000000000251415504077600266100ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/000077500000000000000000000000001415504077600301145ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_config.js000066400000000000000000000016231415504077600320600ustar00rootroot00000000000000const { loader } = require('../../../../utils.js'); module.exports = { 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-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/000077500000000000000000000000001415504077600320545ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/amd/000077500000000000000000000000001415504077600326155ustar00rootroot00000000000000main.js000066400000000000000000000001011415504077600340100ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/amddefine((function () { 'use strict'; console.log('main'); })); myfile.js000066400000000000000000000000741415504077600343620ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/amddefine((function () { 'use strict'; console.log(2); })); myfile2.js000066400000000000000000000000051415504077600344360ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/amdtext1myfile3.js000066400000000000000000000000051415504077600344370ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/amdtext2myfile4.js000066400000000000000000000000741415504077600344460ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/amddefine((function () { 'use strict'; console.log(1); })); myfile5.js000066400000000000000000000000741415504077600344470ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/amddefine((function () { 'use strict'; console.log(3); })); rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/cjs/000077500000000000000000000000001415504077600326335ustar00rootroot00000000000000main.js000066400000000000000000000000441415504077600340340ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/cjs'use strict'; console.log('main'); myfile.js000066400000000000000000000000371415504077600343770ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/cjs'use strict'; console.log(2); myfile2.js000066400000000000000000000000051415504077600344540ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/cjstext1myfile3.js000066400000000000000000000000051415504077600344550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/cjstext2myfile4.js000066400000000000000000000000371415504077600344630ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/cjs'use strict'; console.log(1); myfile5.js000066400000000000000000000000371415504077600344640ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/cjs'use strict'; console.log(3); rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/es/000077500000000000000000000000001415504077600324635ustar00rootroot00000000000000main.js000066400000000000000000000000251415504077600336630ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/esconsole.log('main'); myfile.js000066400000000000000000000000201415504077600342170ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/esconsole.log(2); myfile2.js000066400000000000000000000000051415504077600343040ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/estext1myfile3.js000066400000000000000000000000051415504077600343050ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/estext2myfile4.js000066400000000000000000000000201415504077600343030ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/esconsole.log(1); myfile5.js000066400000000000000000000000201415504077600343040ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/esconsole.log(3); rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/system/000077500000000000000000000000001415504077600334005ustar00rootroot00000000000000main.js000066400000000000000000000001761415504077600346070ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); myfile.js000066400000000000000000000001711415504077600351430ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log(2); }) }; })); myfile2.js000066400000000000000000000000051415504077600352210ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/systemtext1myfile3.js000066400000000000000000000000051415504077600352220ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/systemtext2myfile4.js000066400000000000000000000001711415504077600352270ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log(1); }) }; })); myfile5.js000066400000000000000000000001711415504077600352300ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log(3); }) }; })); rollup-2.61.1/test/chunking-form/samples/emit-file/deconflict-against-named-files/main.js000066400000000000000000000000251415504077600313730ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/000077500000000000000000000000001415504077600257575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_config.js000066400000000000000000000016201415504077600277200ustar00rootroot00000000000000module.exports = { description: 'deduplicates asset that have the same source', options: { input: ['main.js'], plugins: { buildStart() { this.emitFile({ type: 'asset', name: 'string.txt', source: 'hello world' }); this.emitFile({ type: 'asset', name: 'otherString.txt', source: 'hello world' }); this.emitFile({ type: 'asset', name: 'buffer.txt', source: Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]) }); this.emitFile({ type: 'asset', name: 'otherBuffer.txt', source: Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]) }); // specific file names will not be deduplicated this.emitFile({ type: 'asset', fileName: 'named/string.txt', source: 'hello world' }); this.emitFile({ type: 'asset', fileName: 'named/buffer.txt', source: Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]) }); return null; } } } }; rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/000077500000000000000000000000001415504077600277175ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/000077500000000000000000000000001415504077600304605ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assets/000077500000000000000000000000001415504077600317625ustar00rootroot00000000000000buffer-5a245d77.txt000066400000000000000000000000061415504077600347710ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assetsbufferstring-be268e3d.txt000066400000000000000000000000131415504077600351640ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/assetshello worldrollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/main.js000066400000000000000000000001011415504077600317320ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main'); })); rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/named/000077500000000000000000000000001415504077600315445ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/named/buffer.txt000066400000000000000000000000061415504077600335520ustar00rootroot00000000000000bufferrollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/amd/named/string.txt000066400000000000000000000000131415504077600336050ustar00rootroot00000000000000hello worldrollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/000077500000000000000000000000001415504077600304765ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assets/000077500000000000000000000000001415504077600320005ustar00rootroot00000000000000buffer-5a245d77.txt000066400000000000000000000000061415504077600350070ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assetsbufferstring-be268e3d.txt000066400000000000000000000000131415504077600352020ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/assetshello worldrollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/main.js000066400000000000000000000000441415504077600317560ustar00rootroot00000000000000'use strict'; console.log('main'); rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/named/000077500000000000000000000000001415504077600315625ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/named/buffer.txt000066400000000000000000000000061415504077600335700ustar00rootroot00000000000000bufferrollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/cjs/named/string.txt000066400000000000000000000000131415504077600336230ustar00rootroot00000000000000hello worldrollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/000077500000000000000000000000001415504077600303265ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assets/000077500000000000000000000000001415504077600316305ustar00rootroot00000000000000buffer-5a245d77.txt000066400000000000000000000000061415504077600346370ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assetsbufferstring-be268e3d.txt000066400000000000000000000000131415504077600350320ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/assetshello worldrollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/main.js000066400000000000000000000000251415504077600316050ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/named/000077500000000000000000000000001415504077600314125ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/named/buffer.txt000066400000000000000000000000061415504077600334200ustar00rootroot00000000000000bufferrollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/es/named/string.txt000066400000000000000000000000131415504077600334530ustar00rootroot00000000000000hello worldrollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/000077500000000000000000000000001415504077600312435ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assets/000077500000000000000000000000001415504077600325455ustar00rootroot00000000000000buffer-5a245d77.txt000066400000000000000000000000061415504077600355540ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assetsbufferstring-be268e3d.txt000066400000000000000000000000131415504077600357470ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/assetshello worldrollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/main.js000066400000000000000000000001761415504077600325310ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/named/000077500000000000000000000000001415504077600323275ustar00rootroot00000000000000buffer.txt000066400000000000000000000000061415504077600342560ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/namedbufferstring.txt000066400000000000000000000000131415504077600343110ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/_expected/system/namedhello worldrollup-2.61.1/test/chunking-form/samples/emit-file/deduplicate-assets/main.js000066400000000000000000000000251415504077600272360ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-asset-without-name/000077500000000000000000000000001415504077600266665ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-asset-without-name/_config.js000066400000000000000000000003331415504077600306270ustar00rootroot00000000000000module.exports = { description: 'supports emitting an asset without a name', options: { input: ['main.js'], plugins: { buildStart() { this.emitFile({ type: 'asset', source: 'hello world' }); } } } }; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/000077500000000000000000000000001415504077600306265ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/amd/000077500000000000000000000000001415504077600313675ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/amd/assets/000077500000000000000000000000001415504077600326715ustar00rootroot00000000000000asset-417c0188000066400000000000000000000000131415504077600346430ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/amd/assetshello worldrollup-2.61.1/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/amd/main.js000066400000000000000000000001011415504077600326410ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main'); })); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/cjs/000077500000000000000000000000001415504077600314055ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/cjs/assets/000077500000000000000000000000001415504077600327075ustar00rootroot00000000000000asset-417c0188000066400000000000000000000000131415504077600346610ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/cjs/assetshello worldrollup-2.61.1/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/cjs/main.js000066400000000000000000000000441415504077600326650ustar00rootroot00000000000000'use strict'; console.log('main'); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/es/000077500000000000000000000000001415504077600312355ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/es/assets/000077500000000000000000000000001415504077600325375ustar00rootroot00000000000000asset-417c0188000066400000000000000000000000131415504077600345110ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/es/assetshello worldrollup-2.61.1/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/es/main.js000066400000000000000000000000251415504077600325140ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/system/000077500000000000000000000000001415504077600321525ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/system/assets/000077500000000000000000000000001415504077600334545ustar00rootroot00000000000000asset-417c0188000066400000000000000000000000131415504077600354260ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/system/assetshello worldrollup-2.61.1/test/chunking-form/samples/emit-file/emit-asset-without-name/_expected/system/main.js000066400000000000000000000001761415504077600334400ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-asset-without-name/main.js000066400000000000000000000000251415504077600301450ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-facade/000077500000000000000000000000001415504077600254415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-facade/_config.js000066400000000000000000000007541415504077600274110ustar00rootroot00000000000000const assert = require('assert'); let referenceId; module.exports = { 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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/000077500000000000000000000000001415504077600274015ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/amd/000077500000000000000000000000001415504077600301425ustar00rootroot00000000000000generated-build-starter.js000066400000000000000000000003111415504077600351310ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003341415504077600344720ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/amddefine(['exports', './generated-build-starter'], (function (exports, buildStarter) { 'use strict'; exports.buildStartValue = buildStarter.value; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/amd/main.js000066400000000000000000000002311415504077600314200ustar00rootroot00000000000000define(['./generated-build-starter'], (function (buildStarter) { 'use strict'; console.log('main', buildStarter.value, buildStarter.otherValue); })); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/cjs/000077500000000000000000000000001415504077600301605ustar00rootroot00000000000000generated-build-starter.js000066400000000000000000000002241415504077600351520ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002741415504077600345130ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var buildStarter = require('./generated-build-starter.js'); exports.buildStartValue = buildStarter.value; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/cjs/main.js000066400000000000000000000002161415504077600314410ustar00rootroot00000000000000'use strict'; var buildStarter = require('./generated-build-starter.js'); console.log('main', buildStarter.value, buildStarter.otherValue); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/es/000077500000000000000000000000001415504077600300105ustar00rootroot00000000000000generated-build-starter.js000066400000000000000000000001651415504077600350060ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001051415504077600343340ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/esexport { v as buildStartValue } from './generated-build-starter.js'; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/es/main.js000066400000000000000000000001651415504077600312740ustar00rootroot00000000000000import { v as value, o as otherValue } from './generated-build-starter.js'; console.log('main', value, otherValue); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/system/000077500000000000000000000000001415504077600307255ustar00rootroot00000000000000generated-build-starter.js000066400000000000000000000003361415504077600357230ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003331415504077600352540ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-facade/_expected/system/main.js000066400000000000000000000004341415504077600322100ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-facade/buildStart.js000066400000000000000000000001511415504077600301110ustar00rootroot00000000000000import {value} from './dep.js'; console.log('startBuild', value); export { value as buildStartValue }; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-facade/dep.js000066400000000000000000000000671415504077600265520ustar00rootroot00000000000000export const value = 42; export const otherValue = 43; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-facade/main.js000066400000000000000000000001241415504077600267200ustar00rootroot00000000000000import { value, otherValue } from './dep'; console.log('main', value, otherValue); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-filename/000077500000000000000000000000001415504077600260165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-filename/_config.js000066400000000000000000000012001415504077600277510ustar00rootroot00000000000000const assert = require('assert'); let referenceId; module.exports = { 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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/000077500000000000000000000000001415504077600277565ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/amd/000077500000000000000000000000001415504077600305175ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/amd/custom/000077500000000000000000000000001415504077600320315ustar00rootroot00000000000000build-start-chunk.js000066400000000000000000000003061415504077600356470ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/amd/customdefine(['exports', '../generated-buildStart'], (function (exports, buildStart) { 'use strict'; exports.id = buildStart.id; Object.defineProperty(exports, '__esModule', { value: true }); })); generated-buildStart.js000066400000000000000000000002571415504077600350530ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/amd/main.js000066400000000000000000000002271415504077600320020ustar00rootroot00000000000000define(['./generated-buildStart'], (function (buildStart) { 'use strict'; console.log(buildStart.id); console.log('main', buildStart.value); })); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/cjs/000077500000000000000000000000001415504077600305355ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/cjs/custom/000077500000000000000000000000001415504077600320475ustar00rootroot00000000000000build-start-chunk.js000066400000000000000000000002461415504077600356700ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/cjs/custom'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var buildStart = require('../generated-buildStart.js'); exports.id = buildStart.id; generated-buildStart.js000066400000000000000000000001721415504077600350650ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/cjs/main.js000066400000000000000000000002131415504077600320130ustar00rootroot00000000000000'use strict'; var buildStart = require('./generated-buildStart.js'); console.log(buildStart.id); console.log('main', buildStart.value); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/es/000077500000000000000000000000001415504077600303655ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/es/custom/000077500000000000000000000000001415504077600316775ustar00rootroot00000000000000build-start-chunk.js000066400000000000000000000000661415504077600355200ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/es/customexport { i as id } from '../generated-buildStart.js'; generated-buildStart.js000066400000000000000000000001431415504077600347130ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/es/main.js000066400000000000000000000001601415504077600316440ustar00rootroot00000000000000import { i as id, v as value } from './generated-buildStart.js'; console.log(id); console.log('main', value); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/system/000077500000000000000000000000001415504077600313025ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/system/custom/000077500000000000000000000000001415504077600326145ustar00rootroot00000000000000build-start-chunk.js000066400000000000000000000003141415504077600364310ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003241415504077600356310ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-filename/_expected/system/main.js000066400000000000000000000004221415504077600325620ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-filename/buildStart.js000066400000000000000000000001261415504077600304700ustar00rootroot00000000000000import value from './dep.js'; export const id = 'startBuild'; console.log(id, value); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-filename/dep.js000066400000000000000000000000231415504077600271170ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-filename/dep2.js000066400000000000000000000000701415504077600272030ustar00rootroot00000000000000import { id } from './buildStart.js'; console.log(id); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-filename/main.js000066400000000000000000000001161415504077600272760ustar00rootroot00000000000000import value from './dep.js'; import './dep2.js'; console.log('main', value); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/000077500000000000000000000000001415504077600267555ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_config.js000066400000000000000000000021011415504077600307110ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/000077500000000000000000000000001415504077600307155ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/amd/000077500000000000000000000000001415504077600314565ustar00rootroot00000000000000generated-name.js000066400000000000000000000001161415504077600346070ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/amddefine((function () { 'use strict'; var value1 = 42; return value1; })); generated-name2.js000066400000000000000000000001161415504077600346710ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/amddefine((function () { 'use strict'; var value3 = 44; return value3; })); generated-secondName.js000066400000000000000000000001161415504077600357430ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/amddefine((function () { 'use strict'; var value2 = 43; return value2; })); mainChunk.js000066400000000000000000000002701415504077600336510ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/amddefine(['./generated-name', './generated-secondName', './generated-name2'], (function (name, secondName, name$1) { 'use strict'; console.log('main', name, secondName, name$1); })); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/amd/other.js000066400000000000000000000002431415504077600331340ustar00rootroot00000000000000define(['./generated-name', './generated-secondName', './generated-name2', './mainChunk'], (function (name, secondName, name$1, mainChunk) { 'use strict'; })); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/cjs/000077500000000000000000000000001415504077600314745ustar00rootroot00000000000000generated-name.js000066400000000000000000000000721415504077600346260ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/cjs'use strict'; var value1 = 42; module.exports = value1; generated-name2.js000066400000000000000000000000721415504077600347100ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/cjs'use strict'; var value3 = 44; module.exports = value3; generated-secondName.js000066400000000000000000000000721415504077600357620ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/cjs'use strict'; var value2 = 43; module.exports = value2; mainChunk.js000066400000000000000000000003171415504077600336710ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/cjs'use strict'; var name = require('./generated-name.js'); var secondName = require('./generated-secondName.js'); var name$1 = require('./generated-name2.js'); console.log('main', name, secondName, name$1); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/cjs/other.js000066400000000000000000000002221415504077600331470ustar00rootroot00000000000000'use strict'; require('./generated-name.js'); require('./generated-secondName.js'); require('./generated-name2.js'); require('./mainChunk.js'); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/es/000077500000000000000000000000001415504077600313245ustar00rootroot00000000000000generated-name.js000066400000000000000000000000601415504077600344530ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/esvar value1 = 42; export { value1 as default }; generated-name2.js000066400000000000000000000000601415504077600345350ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/esvar value3 = 44; export { value3 as default }; generated-secondName.js000066400000000000000000000000601415504077600356070ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/esvar value2 = 43; export { value2 as default }; mainChunk.js000066400000000000000000000002631415504077600335210ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/esimport value1 from './generated-name.js'; import value2 from './generated-secondName.js'; import value3 from './generated-name2.js'; console.log('main', value1, value2, value3); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/es/other.js000066400000000000000000000001721415504077600330030ustar00rootroot00000000000000import './generated-name.js'; import './generated-secondName.js'; import './generated-name2.js'; import './mainChunk.js'; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/system/000077500000000000000000000000001415504077600322415ustar00rootroot00000000000000generated-name.js000066400000000000000000000002251415504077600353730ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002251415504077600354550ustar00rootroot00000000000000rollup-2.61.1/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); }) }; })); generated-secondName.js000066400000000000000000000002251415504077600365270ustar00rootroot00000000000000rollup-2.61.1/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); }) }; })); mainChunk.js000066400000000000000000000006621415504077600344410ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/systemSystem.register(['./generated-name.js', './generated-secondName.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.js000066400000000000000000000004201415504077600336350ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/_expected/systemSystem.register(['./generated-name.js', './generated-secondName.js', './generated-name2.js', './mainChunk.js'], (function () { 'use strict'; return { setters: [function () {}, function () {}, function () {}, function () {}], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/dep1.js000066400000000000000000000000231415504077600301370ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/dep2.js000066400000000000000000000000231415504077600301400ustar00rootroot00000000000000export default 43; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/dep3.js000066400000000000000000000000231415504077600301410ustar00rootroot00000000000000export default 44; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-name-conflict/main.js000066400000000000000000000002161415504077600302360ustar00rootroot00000000000000import value1 from './dep1.js'; import value2 from './dep2.js'; import value3 from './dep3.js'; console.log('main', value1, value2, value3); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-named/000077500000000000000000000000001415504077600253225ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-named/_config.js000066400000000000000000000006171415504077600272700ustar00rootroot00000000000000const assert = require('assert'); let referenceId; module.exports = { 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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/000077500000000000000000000000001415504077600272625ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/amd/000077500000000000000000000000001415504077600300235ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/amd/generated-dep.js000066400000000000000000000001511415504077600330620ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var value = 42; exports.value = value; })); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/amd/generated-nested/000077500000000000000000000000001415504077600332415ustar00rootroot00000000000000my-chunk.js000066400000000000000000000001531415504077600352520ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/amd/main.js000066400000000000000000000001441415504077600313040ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log('main', dep.value); })); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/cjs/000077500000000000000000000000001415504077600300415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/cjs/generated-dep.js000066400000000000000000000000671415504077600331060ustar00rootroot00000000000000'use strict'; var value = 42; exports.value = value; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/cjs/generated-nested/000077500000000000000000000000001415504077600332575ustar00rootroot00000000000000my-chunk.js000066400000000000000000000001401415504077600352640ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/cjs/main.js000066400000000000000000000001311415504077600313160ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('main', dep.value); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/es/000077500000000000000000000000001415504077600276715ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/es/generated-dep.js000066400000000000000000000000501415504077600327260ustar00rootroot00000000000000var value = 42; export { value as v }; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/es/generated-nested/000077500000000000000000000000001415504077600331075ustar00rootroot00000000000000my-chunk.js000066400000000000000000000001251415504077600351170ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/es/main.js000066400000000000000000000001161415504077600311510ustar00rootroot00000000000000import { v as value } from './generated-dep.js'; console.log('main', value); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/system/000077500000000000000000000000001415504077600306065ustar00rootroot00000000000000generated-dep.js000066400000000000000000000002161415504077600335700ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600337455ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/systemmy-chunk.js000066400000000000000000000003471415504077600360420ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-named/_expected/system/main.js000066400000000000000000000003401415504077600320650ustar00rootroot00000000000000System.register(['./generated-dep.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.v; }], execute: (function () { console.log('main', value); }) }; })); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-named/buildStart.js000066400000000000000000000001011415504077600277650ustar00rootroot00000000000000import value from './dep.js'; console.log('startBuild', value); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-named/dep.js000066400000000000000000000000231415504077600264230ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-named/main.js000066400000000000000000000000731415504077600266040ustar00rootroot00000000000000import value from './dep.js'; console.log('main', value); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order1/000077500000000000000000000000001415504077600254325ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order1/_config.js000066400000000000000000000013021415504077600273700ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/000077500000000000000000000000001415504077600273725ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/amd/000077500000000000000000000000001415504077600301335ustar00rootroot00000000000000generated-emitted.js000066400000000000000000000002541415504077600340020ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002741415504077600340660ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/amddefine(['exports', './generated-emitted'], (function (exports, emitted) { 'use strict'; exports.id = emitted.id; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/amd/main.js000066400000000000000000000002131415504077600314110ustar00rootroot00000000000000define(['./generated-emitted'], (function (emitted) { 'use strict'; console.log(emitted.id); console.log('main', emitted.value); })); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/cjs/000077500000000000000000000000001415504077600301515ustar00rootroot00000000000000generated-emitted.js000066400000000000000000000001671415504077600340230ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002341415504077600341000ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var emitted = require('./generated-emitted.js'); exports.id = emitted.id; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/cjs/main.js000066400000000000000000000001771415504077600314400ustar00rootroot00000000000000'use strict'; var emitted = require('./generated-emitted.js'); console.log(emitted.id); console.log('main', emitted.value); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/es/000077500000000000000000000000001415504077600300015ustar00rootroot00000000000000generated-emitted.js000066400000000000000000000001401415504077600336420ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000621415504077600337270ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/esexport { i as id } from './generated-emitted.js'; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/es/main.js000066400000000000000000000001551415504077600312640ustar00rootroot00000000000000import { i as id, v as value } from './generated-emitted.js'; console.log(id); console.log('main', value); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/system/000077500000000000000000000000001415504077600307165ustar00rootroot00000000000000generated-emitted.js000066400000000000000000000003211415504077600345600ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003101415504077600346400ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order1/_expected/system/main.js000066400000000000000000000004171415504077600322020ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order1/dep.js000066400000000000000000000000231415504077600265330ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order1/dep2.js000066400000000000000000000000601415504077600266160ustar00rootroot00000000000000import { id } from 'emitted'; console.log(id); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order1/main.js000066400000000000000000000001161415504077600267120ustar00rootroot00000000000000import value from './dep.js'; import './dep2.js'; console.log('main', value); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order2/000077500000000000000000000000001415504077600254335ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order2/_config.js000066400000000000000000000014441415504077600274000ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/000077500000000000000000000000001415504077600273735ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/amd/000077500000000000000000000000001415504077600301345ustar00rootroot00000000000000generated-emitted.js000066400000000000000000000002541415504077600340030ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002741415504077600340670ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/amddefine(['exports', './generated-emitted'], (function (exports, emitted) { 'use strict'; exports.id = emitted.id; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/amd/main.js000066400000000000000000000002131415504077600314120ustar00rootroot00000000000000define(['./generated-emitted'], (function (emitted) { 'use strict'; console.log(emitted.id); console.log('main', emitted.value); })); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/cjs/000077500000000000000000000000001415504077600301525ustar00rootroot00000000000000generated-emitted.js000066400000000000000000000001671415504077600340240ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002341415504077600341010ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var emitted = require('./generated-emitted.js'); exports.id = emitted.id; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/cjs/main.js000066400000000000000000000001771415504077600314410ustar00rootroot00000000000000'use strict'; var emitted = require('./generated-emitted.js'); console.log(emitted.id); console.log('main', emitted.value); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/es/000077500000000000000000000000001415504077600300025ustar00rootroot00000000000000generated-emitted.js000066400000000000000000000001401415504077600336430ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000621415504077600337300ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/esexport { i as id } from './generated-emitted.js'; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/es/main.js000066400000000000000000000001551415504077600312650ustar00rootroot00000000000000import { i as id, v as value } from './generated-emitted.js'; console.log(id); console.log('main', value); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/system/000077500000000000000000000000001415504077600307175ustar00rootroot00000000000000generated-emitted.js000066400000000000000000000003211415504077600345610ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003101415504077600346410ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order2/_expected/system/main.js000066400000000000000000000004171415504077600322030ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order2/dep.js000066400000000000000000000000231415504077600265340ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order2/dep2.js000066400000000000000000000000601415504077600266170ustar00rootroot00000000000000import { id } from 'emitted'; console.log(id); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-order2/main.js000066400000000000000000000001161415504077600267130ustar00rootroot00000000000000import value from './dep.js'; import './dep2.js'; console.log('main', value); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-with-importer/000077500000000000000000000000001415504077600270505ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_config.js000066400000000000000000000017331415504077600310160ustar00rootroot00000000000000const path = require('path'); let noImporterReferenceId; let mainReferenceId; let nestedReferenceId; module.exports = { 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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/000077500000000000000000000000001415504077600310105ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/amd/000077500000000000000000000000001415504077600315515ustar00rootroot00000000000000generated-lib.js000066400000000000000000000001051415504077600345260ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/amddefine((function () { 'use strict'; console.log('main lib'); })); generated-lib2.js000066400000000000000000000001071415504077600346120ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/amddefine((function () { 'use strict'; console.log('nested lib'); })); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/amd/main.js000066400000000000000000000005441415504077600330360ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/cjs/000077500000000000000000000000001415504077600315675ustar00rootroot00000000000000generated-lib.js000066400000000000000000000000501415504077600345430ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/cjs'use strict'; console.log('main lib'); generated-lib2.js000066400000000000000000000000521415504077600346270ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/cjs'use strict'; console.log('nested lib'); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/cjs/main.js000066400000000000000000000014031415504077600330470ustar00rootroot00000000000000'use strict'; console.log('no importer', (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __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' ? new (require('u' + 'rl').URL)('file:' + __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' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/generated-lib2.js').href : new URL('generated-lib2.js', document.currentScript && document.currentScript.src || document.baseURI).href)); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/es/000077500000000000000000000000001415504077600314175ustar00rootroot00000000000000generated-lib.js000066400000000000000000000000311415504077600343720ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/esconsole.log('main lib'); generated-lib2.js000066400000000000000000000000331415504077600344560ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/esconsole.log('nested lib'); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/es/main.js000066400000000000000000000003541415504077600327030ustar00rootroot00000000000000console.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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/system/000077500000000000000000000000001415504077600323345ustar00rootroot00000000000000generated-lib.js000066400000000000000000000002021415504077600353070ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002041415504077600353730ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('nested lib'); }) }; })); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-with-importer/_expected/system/main.js000066400000000000000000000005521415504077600336200ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-with-importer/lib.js000066400000000000000000000000311415504077600301460ustar00rootroot00000000000000console.log('main lib'); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-with-importer/main.js000066400000000000000000000000301415504077600303230ustar00rootroot00000000000000console.log('ignored'); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-with-importer/nested/000077500000000000000000000000001415504077600303325ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-with-importer/nested/lib.js000066400000000000000000000000331415504077600314320ustar00rootroot00000000000000console.log('nested lib'); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/000077500000000000000000000000001415504077600255475ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_config.js000066400000000000000000000027211415504077600275130ustar00rootroot00000000000000const path = require('path'); let workerId; let proxyId; module.exports = { 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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/000077500000000000000000000000001415504077600275075ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/amd/000077500000000000000000000000001415504077600302505ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/amd/chunks/000077500000000000000000000000001415504077600315435ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/amd/chunks/nested.js000066400000000000000000000005061415504077600333640ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/amd/chunks/shared.js000066400000000000000000000001641415504077600333500ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const shared = 'shared'; exports.shared = shared; })); worker-proxy.js000066400000000000000000000001501415504077600345060ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/amd/chunksimportScripts('../../../../../../../../node_modules/requirejs/require.js'); requirejs(['./worker.js']); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/amd/chunks/worker.js000066400000000000000000000001561415504077600334140ustar00rootroot00000000000000define(['./shared'], (function (shared) { 'use strict'; postMessage(`from worker: ${shared.shared}`); })); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/amd/main.js000066400000000000000000000012441415504077600315330ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/cjs/000077500000000000000000000000001415504077600302665ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/cjs/chunks/000077500000000000000000000000001415504077600315615ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/cjs/chunks/nested.js000066400000000000000000000006221415504077600334010ustar00rootroot00000000000000'use strict'; const getWorkerMessage = () => new Promise(resolve => { const worker = new Worker((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/cjs/chunks/shared.js000066400000000000000000000001021415504077600333560ustar00rootroot00000000000000'use strict'; const shared = 'shared'; exports.shared = shared; worker-proxy.js000066400000000000000000000003561415504077600345340ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/cjs/chunks'use strict'; PLACEHOLDER((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/worker.js').href : new URL('worker.js', document.currentScript && document.currentScript.src || document.baseURI).href)); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/cjs/chunks/worker.js000066400000000000000000000001431415504077600334260ustar00rootroot00000000000000'use strict'; var shared = require('./shared.js'); postMessage(`from worker: ${shared.shared}`); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/cjs/main.js000066400000000000000000000014101415504077600315440ustar00rootroot00000000000000'use strict'; var shared = require('./chunks/shared.js'); const getWorkerMessage = () => new Promise(resolve => { const worker = new Worker((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/es/000077500000000000000000000000001415504077600301165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/es/chunks/000077500000000000000000000000001415504077600314115ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/es/chunks/nested.js000066400000000000000000000003071415504077600332310ustar00rootroot00000000000000const getWorkerMessage = () => new Promise(resolve => { const worker = new Worker(new URL('worker-proxy.js', import.meta.url).href); worker.onmessage = resolve; }); export { getWorkerMessage }; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/es/chunks/shared.js000066400000000000000000000000621415504077600332130ustar00rootroot00000000000000const shared = 'shared'; export { shared as s }; worker-proxy.js000066400000000000000000000000711415504077600343560ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/es/chunksPLACEHOLDER(new URL('worker.js', import.meta.url).href); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/es/chunks/worker.js000066400000000000000000000001231415504077600332540ustar00rootroot00000000000000import { s as shared } from './shared.js'; postMessage(`from worker: ${shared}`); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/es/main.js000066400000000000000000000010241415504077600313750ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/system/000077500000000000000000000000001415504077600310335ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/system/chunks/000077500000000000000000000000001415504077600323265ustar00rootroot00000000000000nested.js000066400000000000000000000005321415504077600340670ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002271415504077600340540ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001551415504077600352760ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/system/chunksimportScripts('../../../../../../../../node_modules/systemjs/dist/system.js'); System.import('./worker.js'); worker.js000066400000000000000000000003461415504077600341210ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/_expected/system/main.js000066400000000000000000000013771415504077600323250ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/index-amd.html000066400000000000000000000003461415504077600303060ustar00rootroot00000000000000 AMD rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/index-system.html000066400000000000000000000004111415504077600310620ustar00rootroot00000000000000 SystemJS rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/main.js000066400000000000000000000005631415504077600270350ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/shared.js000066400000000000000000000000401415504077600273450ustar00rootroot00000000000000export const shared = 'shared'; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worker/worker.js000066400000000000000000000001111415504077600274070ustar00rootroot00000000000000import {shared} from './shared'; postMessage(`from worker: ${shared}`); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worklet/000077500000000000000000000000001415504077600257255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worklet/_config.js000066400000000000000000000013211415504077600276640ustar00rootroot00000000000000const REGISTER_WORKLET = 'register-paint-worklet:'; module.exports = { 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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/000077500000000000000000000000001415504077600276655ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/amd/000077500000000000000000000000001415504077600304265ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/amd/chunks/000077500000000000000000000000001415504077600317215ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/amd/chunks/shared.js000066400000000000000000000002351415504077600335250ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const color = 'greenyellow'; const size = 6; exports.color = color; exports.size = size; })); worklet.js000066400000000000000000000005141415504077600336670ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/amd/main.js000066400000000000000000000005041415504077600317070ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/cjs/000077500000000000000000000000001415504077600304445ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/cjs/chunks/000077500000000000000000000000001415504077600317375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/cjs/chunks/shared.js000066400000000000000000000001511415504077600335400ustar00rootroot00000000000000'use strict'; const color = 'greenyellow'; const size = 6; exports.color = color; exports.size = size; worklet.js000066400000000000000000000004651415504077600337120ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/cjs/main.js000066400000000000000000000007001415504077600317230ustar00rootroot00000000000000'use strict'; var shared = require('./chunks/shared.js'); CSS.paintWorklet.addModule((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/es/000077500000000000000000000000001415504077600302745ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/es/chunks/000077500000000000000000000000001415504077600315675ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/es/chunks/shared.js000066400000000000000000000001201415504077600333640ustar00rootroot00000000000000const color = 'greenyellow'; const size = 6; export { color as c, size as s }; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/es/chunks/worklet.js000066400000000000000000000004411415504077600336130ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/es/main.js000066400000000000000000000004051415504077600315550ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/system/000077500000000000000000000000001415504077600312115ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/system/chunks/000077500000000000000000000000001415504077600325045ustar00rootroot00000000000000shared.js000066400000000000000000000002741415504077600342340ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000007461415504077600344610ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worklet/_expected/system/main.js000066400000000000000000000006701415504077600324760ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worklet/index-es.html000066400000000000000000000002651415504077600303320ustar00rootroot00000000000000 ES rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worklet/main.js000066400000000000000000000003161415504077600272070ustar00rootroot00000000000000import 'register-paint-worklet:./worklet.js'; import { color, size } from './shared'; document.body.innerHTML += `

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

`; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worklet/shared.js000066400000000000000000000000731415504077600275310ustar00rootroot00000000000000export const color = 'greenyellow'; export const size = 6; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk-worklet/worklet.js000066400000000000000000000004241415504077600277520ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk/000077500000000000000000000000001415504077600242405ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk/_config.js000066400000000000000000000010231415504077600261760ustar00rootroot00000000000000const assert = require('assert'); let referenceId; module.exports = { 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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk/_expected/000077500000000000000000000000001415504077600262005ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk/_expected/amd/000077500000000000000000000000001415504077600267415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk/_expected/amd/generated-buildStart.js000066400000000000000000000001521415504077600333460ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log('startBuild', dep.value); })); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk/_expected/amd/generated-dep.js000066400000000000000000000001511415504077600320000ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var value = 42; exports.value = value; })); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk/_expected/amd/main.js000066400000000000000000000012521415504077600302230ustar00rootroot00000000000000define(['require', './generated-dep'], (function (require, dep) { 'use strict'; 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); } new Promise(function (resolve, reject) { require(['./ext\'ernal'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }); console.log('main', dep.value); })); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk/_expected/cjs/000077500000000000000000000000001415504077600267575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk/_expected/cjs/generated-buildStart.js000066400000000000000000000001371415504077600333670ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('startBuild', dep.value); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk/_expected/cjs/generated-dep.js000066400000000000000000000000671415504077600320240ustar00rootroot00000000000000'use strict'; var value = 42; exports.value = value; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk/_expected/cjs/main.js000066400000000000000000000011241415504077600302370ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); 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); } Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('./ext\'ernal')); }); console.log('main', dep.value); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk/_expected/es/000077500000000000000000000000001415504077600266075ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk/_expected/es/generated-buildStart.js000066400000000000000000000001241415504077600332130ustar00rootroot00000000000000import { v as value } from './generated-dep.js'; console.log('startBuild', value); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk/_expected/es/generated-dep.js000066400000000000000000000000501415504077600316440ustar00rootroot00000000000000var value = 42; export { value as v }; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk/_expected/es/main.js000066400000000000000000000001471415504077600300730ustar00rootroot00000000000000import { v as value } from './generated-dep.js'; import('./ext\'ernal'); console.log('main', value); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk/_expected/system/000077500000000000000000000000001415504077600275245ustar00rootroot00000000000000generated-buildStart.js000066400000000000000000000003461415504077600340570ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk/_expected/system/generated-dep.js000066400000000000000000000002161415504077600325650ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var value = exports('v', 42); }) }; })); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk/_expected/system/main.js000066400000000000000000000004221415504077600310040ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/emit-file/emit-chunk/buildStart.js000066400000000000000000000001011415504077600267030ustar00rootroot00000000000000import value from './dep.js'; console.log('startBuild', value); rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk/dep.js000066400000000000000000000000231415504077600253410ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/emit-file/emit-chunk/main.js000066400000000000000000000001171415504077600255210ustar00rootroot00000000000000import value from './dep.js'; import('external'); console.log('main', value); rollup-2.61.1/test/chunking-form/samples/emit-file/emits-existing-chunk/000077500000000000000000000000001415504077600262535ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-existing-chunk/_config.js000066400000000000000000000010431415504077600302130ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/000077500000000000000000000000001415504077600302135ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/amd/000077500000000000000000000000001415504077600307545ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/amd/first-main.js000066400000000000000000000001371415504077600333640ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log('main1', dep); })); generated-dep.js000066400000000000000000000001141415504077600337330ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/amddefine((function () { 'use strict'; var value = 42; return value; })); rollup-2.61.1/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/amd/second-main.js000066400000000000000000000001371415504077600335100ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log('main1', dep); })); rollup-2.61.1/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/cjs/000077500000000000000000000000001415504077600307725ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/cjs/first-main.js000066400000000000000000000001241415504077600333760ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('main1', dep); generated-dep.js000066400000000000000000000000701415504077600337520ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/cjs'use strict'; var value = 42; module.exports = value; rollup-2.61.1/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/cjs/second-main.js000066400000000000000000000001241415504077600335220ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('main1', dep); rollup-2.61.1/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/es/000077500000000000000000000000001415504077600306225ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/es/first-main.js000066400000000000000000000001061415504077600332260ustar00rootroot00000000000000import value from './generated-dep.js'; console.log('main1', value); generated-dep.js000066400000000000000000000000561415504077600336060ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/esvar value = 42; export { value as default }; rollup-2.61.1/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/es/second-main.js000066400000000000000000000001061415504077600333520ustar00rootroot00000000000000import value from './generated-dep.js'; console.log('main1', value); rollup-2.61.1/test/chunking-form/samples/emit-file/emits-existing-chunk/_expected/system/000077500000000000000000000000001415504077600315375ustar00rootroot00000000000000first-main.js000066400000000000000000000003521415504077600340670ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002241415504077600345200ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003521415504077600342130ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/emit-file/emits-existing-chunk/dep.js000066400000000000000000000000231415504077600273540ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/emit-file/emits-existing-chunk/main1.js000066400000000000000000000000741415504077600276170ustar00rootroot00000000000000import value from './dep.js'; console.log('main1', value); rollup-2.61.1/test/chunking-form/samples/emit-file/emits-existing-chunk/main2.js000066400000000000000000000000741415504077600276200ustar00rootroot00000000000000import value from './dep.js'; console.log('main1', value); rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/000077500000000000000000000000001415504077600301655ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_config.js000066400000000000000000000046601415504077600321350ustar00rootroot00000000000000module.exports = { 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' }); }, resolveId() { this.emitFile({ type: 'asset', name: 'resolveId.txt', source: 'resolveId' }); this.emitFile({ type: 'asset', fileName: 'custom/resolveId.txt', source: 'resolveId' }); }, load() { this.emitFile({ type: 'asset', name: 'load.txt', source: 'load' }); this.emitFile({ type: 'asset', fileName: 'custom/load.txt', source: 'load' }); }, transform() { this.emitFile({ type: 'asset', name: 'transform.txt', source: 'transform' }); this.emitFile({ type: 'asset', fileName: 'custom/transform.txt', source: 'transform' }); }, buildEnd() { this.emitFile({ type: 'asset', name: 'buildEnd.txt', source: 'buildEnd' }); this.emitFile({ type: 'asset', fileName: 'custom/buildEnd.txt', source: 'buildEnd' }); }, renderStart() { this.emitFile({ type: 'asset', name: 'renderStart.txt', source: 'renderStart' }); this.emitFile({ type: 'asset', fileName: 'custom/renderStart.txt', source: 'renderStart' }); }, banner() { this.emitFile({ type: 'asset', name: 'banner.txt', source: 'banner' }); this.emitFile({ type: 'asset', fileName: 'custom/banner.txt', source: 'banner' }); }, footer() { this.emitFile({ type: 'asset', name: 'footer.txt', source: 'footer' }); this.emitFile({ type: 'asset', fileName: 'custom/footer.txt', source: 'footer' }); }, intro() { this.emitFile({ type: 'asset', name: 'intro.txt', source: 'intro' }); this.emitFile({ type: 'asset', fileName: 'custom/intro.txt', source: 'intro' }); }, outro() { this.emitFile({ type: 'asset', name: 'outro.txt', source: 'outro' }); this.emitFile({ type: 'asset', fileName: 'custom/outro.txt', source: 'outro' }); }, renderChunk() { this.emitFile({ type: 'asset', name: 'renderChunk.txt', source: 'renderChunk' }); this.emitFile({ type: 'asset', fileName: 'custom/renderChunk.txt', source: 'renderChunk' }); }, generateBundle() { this.emitFile({ type: 'asset', name: 'generateBundle.txt', source: 'generateBundle' }); this.emitFile({ type: 'asset', fileName: 'custom/generateBundle.txt', source: 'generateBundle' }); } } } }; rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/000077500000000000000000000000001415504077600321255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/000077500000000000000000000000001415504077600326665ustar00rootroot00000000000000assets/000077500000000000000000000000001415504077600341115ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amdbanner-2b65cc0c.txt000066400000000000000000000000061415504077600373200ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetsbannerbuildEnd-4678f17a.txt000066400000000000000000000000101415504077600374540ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetsbuildEndbuildStart-5b740828.txt000066400000000000000000000000121415504077600377610ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetsbuildStartfooter-e1d2fccb.txt000066400000000000000000000000061415504077600375130ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetsfootergenerateBundle-22413744.txt000066400000000000000000000000161415504077600405030ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetsgenerateBundleintro-520a8116.txt000066400000000000000000000000051415504077600367650ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetsintroload-a4cc2865.txt000066400000000000000000000000041415504077600367200ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetsloadoutro-21f77720.txt000066400000000000000000000000051415504077600370120ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetsoutrorenderChunk-a91c7c32.txt000066400000000000000000000000131415504077600402460ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetsrenderChunkrenderStart-66600c78.txt000066400000000000000000000000131415504077600401420ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetsrenderStartresolveId-6d8063a5.txt000066400000000000000000000000111415504077600376540ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetsresolveIdtransform-d49df25a.txt000066400000000000000000000000111415504077600400750ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/assetstransformcustom/000077500000000000000000000000001415504077600341215ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amdbanner.txt000066400000000000000000000000061415504077600361230ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/custombannerbuildEnd.txt000066400000000000000000000000101415504077600363770ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/custombuildEndbuildStart.txt000066400000000000000000000000121415504077600367700ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/custombuildStartfooter.txt000066400000000000000000000000061415504077600361540ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/customfootergenerateBundle.txt000066400000000000000000000000161415504077600376030ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/customgenerateBundleintro.txt000066400000000000000000000000051415504077600360100ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/customintroload.txt000066400000000000000000000000041415504077600355730ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/customloadoutro.txt000066400000000000000000000000051415504077600360250ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/customoutrorenderChunk.txt000066400000000000000000000000131415504077600371240ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/customrenderChunkrenderStart.txt000066400000000000000000000000131415504077600371510ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/customrenderStartresolveId.txt000066400000000000000000000000111415504077600366060ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/customresolveIdtransform.txt000066400000000000000000000000111415504077600366650ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amd/customtransformmain.js000066400000000000000000000001011415504077600340610ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/amddefine((function () { 'use strict'; console.log('main'); })); rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/000077500000000000000000000000001415504077600327045ustar00rootroot00000000000000assets/000077500000000000000000000000001415504077600341275ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjsbanner-2b65cc0c.txt000066400000000000000000000000061415504077600373360ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetsbannerbuildEnd-4678f17a.txt000066400000000000000000000000101415504077600374720ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetsbuildEndbuildStart-5b740828.txt000066400000000000000000000000121415504077600377770ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetsbuildStartfooter-e1d2fccb.txt000066400000000000000000000000061415504077600375310ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetsfootergenerateBundle-22413744.txt000066400000000000000000000000161415504077600405210ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetsgenerateBundleintro-520a8116.txt000066400000000000000000000000051415504077600370030ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetsintroload-a4cc2865.txt000066400000000000000000000000041415504077600367360ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetsloadoutro-21f77720.txt000066400000000000000000000000051415504077600370300ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetsoutrorenderChunk-a91c7c32.txt000066400000000000000000000000131415504077600402640ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetsrenderChunkrenderStart-66600c78.txt000066400000000000000000000000131415504077600401600ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetsrenderStartresolveId-6d8063a5.txt000066400000000000000000000000111415504077600376720ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetsresolveIdtransform-d49df25a.txt000066400000000000000000000000111415504077600401130ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/assetstransformcustom/000077500000000000000000000000001415504077600341375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjsbanner.txt000066400000000000000000000000061415504077600361410ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/custombannerbuildEnd.txt000066400000000000000000000000101415504077600364150ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/custombuildEndbuildStart.txt000066400000000000000000000000121415504077600370060ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/custombuildStartfooter.txt000066400000000000000000000000061415504077600361720ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/customfootergenerateBundle.txt000066400000000000000000000000161415504077600376210ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/customgenerateBundleintro.txt000066400000000000000000000000051415504077600360260ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/customintroload.txt000066400000000000000000000000041415504077600356110ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/customloadoutro.txt000066400000000000000000000000051415504077600360430ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/customoutrorenderChunk.txt000066400000000000000000000000131415504077600371420ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/customrenderChunkrenderStart.txt000066400000000000000000000000131415504077600371670ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/customrenderStartresolveId.txt000066400000000000000000000000111415504077600366240ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/customresolveIdtransform.txt000066400000000000000000000000111415504077600367030ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs/customtransformmain.js000066400000000000000000000000441415504077600341050ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/cjs'use strict'; console.log('main'); rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/000077500000000000000000000000001415504077600325345ustar00rootroot00000000000000assets/000077500000000000000000000000001415504077600337575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/esbanner-2b65cc0c.txt000066400000000000000000000000061415504077600371660ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetsbannerbuildEnd-4678f17a.txt000066400000000000000000000000101415504077600373220ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetsbuildEndbuildStart-5b740828.txt000066400000000000000000000000121415504077600376270ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetsbuildStartfooter-e1d2fccb.txt000066400000000000000000000000061415504077600373610ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetsfootergenerateBundle-22413744.txt000066400000000000000000000000161415504077600403510ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetsgenerateBundleintro-520a8116.txt000066400000000000000000000000051415504077600366330ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetsintroload-a4cc2865.txt000066400000000000000000000000041415504077600365660ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetsloadoutro-21f77720.txt000066400000000000000000000000051415504077600366600ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetsoutrorenderChunk-a91c7c32.txt000066400000000000000000000000131415504077600401140ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetsrenderChunkrenderStart-66600c78.txt000066400000000000000000000000131415504077600400100ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetsrenderStartresolveId-6d8063a5.txt000066400000000000000000000000111415504077600375220ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetsresolveIdtransform-d49df25a.txt000066400000000000000000000000111415504077600377430ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/assetstransformcustom/000077500000000000000000000000001415504077600337675ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/esbanner.txt000066400000000000000000000000061415504077600357710ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/custombannerbuildEnd.txt000066400000000000000000000000101415504077600362450ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/custombuildEndbuildStart.txt000066400000000000000000000000121415504077600366360ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/custombuildStartfooter.txt000066400000000000000000000000061415504077600360220ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/customfootergenerateBundle.txt000066400000000000000000000000161415504077600374510ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/customgenerateBundleintro.txt000066400000000000000000000000051415504077600356560ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/customintroload.txt000066400000000000000000000000041415504077600354410ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/customloadoutro.txt000066400000000000000000000000051415504077600356730ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/customoutrorenderChunk.txt000066400000000000000000000000131415504077600367720ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/customrenderChunkrenderStart.txt000066400000000000000000000000131415504077600370170ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/customrenderStartresolveId.txt000066400000000000000000000000111415504077600364540ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/customresolveIdtransform.txt000066400000000000000000000000111415504077600365330ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/es/customtransformmain.js000066400000000000000000000000251415504077600337340ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/esconsole.log('main'); rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/000077500000000000000000000000001415504077600334515ustar00rootroot00000000000000assets/000077500000000000000000000000001415504077600346745ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/systembanner-2b65cc0c.txt000066400000000000000000000000061415504077600401030ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetsbannerbuildEnd-4678f17a.txt000066400000000000000000000000101415504077600402370ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetsbuildEndbuildStart-5b740828.txt000066400000000000000000000000121415504077600405440ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetsbuildStartfooter-e1d2fccb.txt000066400000000000000000000000061415504077600402760ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetsfootergenerateBundle-22413744.txt000066400000000000000000000000161415504077600412660ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetsgenerateBundleintro-520a8116.txt000066400000000000000000000000051415504077600375500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetsintroload-a4cc2865.txt000066400000000000000000000000041415504077600375030ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetsloadoutro-21f77720.txt000066400000000000000000000000051415504077600375750ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetsoutrorenderChunk-a91c7c32.txt000066400000000000000000000000131415504077600410310ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetsrenderChunkrenderStart-66600c78.txt000066400000000000000000000000131415504077600407250ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetsrenderStartresolveId-6d8063a5.txt000066400000000000000000000000111415504077600404370ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetsresolveIdtransform-d49df25a.txt000066400000000000000000000000111415504077600406600ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/assetstransformcustom/000077500000000000000000000000001415504077600347045ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/systembanner.txt000066400000000000000000000000061415504077600367060ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/custombannerbuildEnd.txt000066400000000000000000000000101415504077600371620ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/custombuildEndbuildStart.txt000066400000000000000000000000121415504077600375530ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/custombuildStartfooter.txt000066400000000000000000000000061415504077600367370ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/customfootergenerateBundle.txt000066400000000000000000000000161415504077600403660ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/customgenerateBundleintro.txt000066400000000000000000000000051415504077600365730ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/customintroload.txt000066400000000000000000000000041415504077600363560ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/customloadoutro.txt000066400000000000000000000000051415504077600366100ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/customoutrorenderChunk.txt000066400000000000000000000000131415504077600377070ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/customrenderChunkrenderStart.txt000066400000000000000000000000131415504077600377340ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/customrenderStartresolveId.txt000066400000000000000000000000111415504077600373710ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/customresolveIdtransform.txt000066400000000000000000000000111415504077600374500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/system/customtransformmain.js000066400000000000000000000001761415504077600346600ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-2.61.1/test/chunking-form/samples/emit-file/emits-files-from-various-hooks/main.js000066400000000000000000000000251415504077600314440ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/000077500000000000000000000000001415504077600331175ustar00rootroot00000000000000_config.js000066400000000000000000000022151415504077600350020ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modulesconst assert = require('assert'); const path = require('path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_DEB = path.join(__dirname, 'deb.js'); module.exports = { 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 => { const isMain = fileInfo.facadeModuleId === ID_MAIN; // This is checked separately as deepStrictEqual is having some issues assert.deepStrictEqual(Object.keys(fileInfo.modules), [isMain ? ID_MAIN : ID_DEB]); delete fileInfo.modules; assert.deepStrictEqual( fileInfo, { exports: isMain ? [] : ['default'], facadeModuleId: isMain ? ID_MAIN : ID_DEB, isDynamicEntry: !isMain, isEntry: isMain, isImplicitEntry: false, name: isMain ? 'main' : 'deb', type: 'chunk' }, 'entry info' ); return `entry-[name]-[format].js`; } } } }; _expected/000077500000000000000000000000001415504077600350005ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modulesamd/000077500000000000000000000000001415504077600355415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expectedassets/000077500000000000000000000000001415504077600370435ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/amdtest-7468331f.txt000066400000000000000000000000131415504077600415600ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/amd/assetshello worldentry-deb-amd.js000066400000000000000000000001161415504077600405250ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/amddefine((function () { 'use strict'; var deb = 'string'; return deb; })); entry-main-amd.js000066400000000000000000000005551415504077600407260ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600355575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expectedassets/000077500000000000000000000000001415504077600370615ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/cjstest-7468331f.txt000066400000000000000000000000131415504077600415760ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/cjs/assetshello worldentry-deb-cjs.js000066400000000000000000000000721415504077600405620ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/cjs'use strict'; var deb = 'string'; module.exports = deb; entry-main-cjs.js000066400000000000000000000004301415504077600407520ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600354075ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expectedassets/000077500000000000000000000000001415504077600367115ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/estest-7468331f.txt000066400000000000000000000000131415504077600414260ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/es/assetshello worldentry-deb-es.js000066400000000000000000000000601415504077600402370ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/esvar deb = 'string'; export { deb as default }; entry-main-es.js000066400000000000000000000001041415504077600404300ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/esconsole.log('main'); import('./entry-deb-es.js').then(console.log); system/000077500000000000000000000000001415504077600363245ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expectedassets/000077500000000000000000000000001415504077600376265ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/systemtest-7468331f.txt000066400000000000000000000000131415504077600423430ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modules/_expected/system/assetshello worldentry-deb-system.js000066400000000000000000000002301415504077600420700ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003121415504077600422630ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000311415504077600341220ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modulesexport default 'string'; main.js000066400000000000000000000000701415504077600343170ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns-preserve-modulesconsole.log('main'); import('./deb').then(console.log); rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns/000077500000000000000000000000001415504077600276205ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns/_config.js000066400000000000000000000032701415504077600315640ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_DEB = path.join(__dirname, 'deb.js'); module.exports = { description: 'supports using a function that returns a pattern for FileNames', options: { input: ['main.js'], plugins: { transform() { this.emitFile({ type: 'asset', name: 'test.txt', source: 'hello world' }); return null; } }, output: { entryFileNames: fileInfo => { // This is checked separately as deepStrictEqual is having some issues assert.deepStrictEqual(Object.keys(fileInfo.modules), [ID_MAIN]); delete fileInfo.modules; assert.deepStrictEqual( fileInfo, { exports: [], facadeModuleId: ID_MAIN, isDynamicEntry: false, isEntry: true, isImplicitEntry: false, name: '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 => { // This is checked separately as deepStrictEqual is having some issues assert.deepStrictEqual(Object.keys(fileInfo.modules), [ID_DEB]); delete fileInfo.modules; assert.deepStrictEqual( fileInfo, { exports: ['default'], facadeModuleId: ID_DEB, isDynamicEntry: true, isEntry: false, isImplicitEntry: false, name: 'deb', type: 'chunk' }, 'chunk info' ); return 'chunk-[name]-[hash]-[format].js'; } } } }; rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/000077500000000000000000000000001415504077600315605ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/000077500000000000000000000000001415504077600323215ustar00rootroot00000000000000chunk-deb-c542d45b-amd.js000066400000000000000000000001601415504077600363260ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amddefine(['exports'], (function (exports) { 'use strict'; var deb = 'string'; exports["default"] = deb; })); entry-main-57ef342e-amd.js000066400000000000000000000003151415504077600365630ustar00rootroot00000000000000rollup-2.61.1/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-c542d45b-amd'], resolve, reject); }).then(console.log); })); rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/txt/000077500000000000000000000000001415504077600331405ustar00rootroot000000000000007468331f-test.txt000066400000000000000000000000131415504077600355760ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/txthello worldrollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/000077500000000000000000000000001415504077600323375ustar00rootroot00000000000000chunk-deb-19c947c3-cjs.js000066400000000000000000000000761415504077600363220ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs'use strict'; var deb = 'string'; exports["default"] = deb; entry-main-9f49db65-cjs.js000066400000000000000000000002161415504077600366270ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs'use strict'; console.log('main'); Promise.resolve().then(function () { return require('./chunk-deb-19c947c3-cjs.js'); }).then(console.log); rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/txt/000077500000000000000000000000001415504077600331565ustar00rootroot000000000000007468331f-test.txt000066400000000000000000000000131415504077600356140ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/txthello worldrollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/000077500000000000000000000000001415504077600321675ustar00rootroot00000000000000chunk-deb-607fe03f-es.js000066400000000000000000000000601415504077600360450ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/esvar deb = 'string'; export { deb as default }; entry-main-137667a0-es.js000066400000000000000000000001151415504077600361270ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/esconsole.log('main'); import('./chunk-deb-607fe03f-es.js').then(console.log); rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/txt/000077500000000000000000000000001415504077600330065ustar00rootroot000000000000007468331f-test.txt000066400000000000000000000000131415504077600354440ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/es/txthello worldrollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/system/000077500000000000000000000000001415504077600331045ustar00rootroot00000000000000chunk-deb-3a28869f-system.js000066400000000000000000000002301415504077600376300ustar00rootroot00000000000000rollup-2.61.1/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-e573b571-system.js000066400000000000000000000003231415504077600400460ustar00rootroot00000000000000rollup-2.61.1/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-3a28869f-system.js').then(console.log); }) }; })); rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/system/txt/000077500000000000000000000000001415504077600337235ustar00rootroot000000000000007468331f-test.txt000066400000000000000000000000131415504077600363610ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/system/txthello worldrollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns/deb.js000066400000000000000000000000311415504077600307020ustar00rootroot00000000000000export default 'string'; rollup-2.61.1/test/chunking-form/samples/emit-file/filenames-function-patterns/main.js000066400000000000000000000000701415504077600310770ustar00rootroot00000000000000console.log('main'); import('./deb').then(console.log); rollup-2.61.1/test/chunking-form/samples/emit-file/named-user-chunks/000077500000000000000000000000001415504077600255255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/named-user-chunks/_config.js000066400000000000000000000016231415504077600274710ustar00rootroot00000000000000const assert = require('assert'); let referenceIdName; let referenceIdFileName1; let referenceIdFileName2; module.exports = { 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-2.61.1/test/chunking-form/samples/emit-file/named-user-chunks/_expected/000077500000000000000000000000001415504077600274655ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/named-user-chunks/_expected/amd/000077500000000000000000000000001415504077600302265ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/named-user-chunks/_expected/amd/explicit-name1.js000066400000000000000000000002761415504077600334110ustar00rootroot00000000000000define(['exports', './mainChunk'], (function (exports, mainChunk) { 'use strict'; exports.value = mainChunk.value; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/emit-file/named-user-chunks/_expected/amd/explicit-name2.js000066400000000000000000000002761415504077600334120ustar00rootroot00000000000000define(['exports', './mainChunk'], (function (exports, mainChunk) { 'use strict'; exports.value = mainChunk.value; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/emit-file/named-user-chunks/_expected/amd/mainChunk.js000066400000000000000000000002541415504077600325020ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const value = 42; exports.value = value; Object.defineProperty(exports, '__esModule', { value: true }); })); mainChunkFacade.js000066400000000000000000000002761415504077600335130ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/named-user-chunks/_expected/amddefine(['exports', './mainChunk'], (function (exports, mainChunk) { 'use strict'; exports.value = mainChunk.value; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/emit-file/named-user-chunks/_expected/cjs/000077500000000000000000000000001415504077600302445ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/named-user-chunks/_expected/cjs/explicit-name1.js000066400000000000000000000002361415504077600334230ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var mainChunk = require('./mainChunk.js'); exports.value = mainChunk.value; rollup-2.61.1/test/chunking-form/samples/emit-file/named-user-chunks/_expected/cjs/explicit-name2.js000066400000000000000000000002361415504077600334240ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var mainChunk = require('./mainChunk.js'); exports.value = mainChunk.value; rollup-2.61.1/test/chunking-form/samples/emit-file/named-user-chunks/_expected/cjs/mainChunk.js000066400000000000000000000001711415504077600325160ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const value = 42; exports.value = value; mainChunkFacade.js000066400000000000000000000002361415504077600335250ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/named-user-chunks/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var mainChunk = require('./mainChunk.js'); exports.value = mainChunk.value; rollup-2.61.1/test/chunking-form/samples/emit-file/named-user-chunks/_expected/es/000077500000000000000000000000001415504077600300745ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/named-user-chunks/_expected/es/explicit-name1.js000066400000000000000000000000501415504077600332450ustar00rootroot00000000000000export { value } from './mainChunk.js'; rollup-2.61.1/test/chunking-form/samples/emit-file/named-user-chunks/_expected/es/explicit-name2.js000066400000000000000000000000501415504077600332460ustar00rootroot00000000000000export { value } from './mainChunk.js'; rollup-2.61.1/test/chunking-form/samples/emit-file/named-user-chunks/_expected/es/mainChunk.js000066400000000000000000000000451415504077600323460ustar00rootroot00000000000000const value = 42; export { value }; rollup-2.61.1/test/chunking-form/samples/emit-file/named-user-chunks/_expected/es/mainChunkFacade.js000066400000000000000000000000501415504077600334260ustar00rootroot00000000000000export { value } from './mainChunk.js'; rollup-2.61.1/test/chunking-form/samples/emit-file/named-user-chunks/_expected/system/000077500000000000000000000000001415504077600310115ustar00rootroot00000000000000explicit-name1.js000066400000000000000000000003071415504077600341100ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003071415504077600341110ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/emit-file/named-user-chunks/_expected/system/mainChunk.js000066400000000000000000000002241415504077600332620ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('value', 42); }) }; })); mainChunkFacade.js000066400000000000000000000003071415504077600342710ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/emit-file/named-user-chunks/main.js000066400000000000000000000000311415504077600270010ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/000077500000000000000000000000001415504077600252325ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_config.js000066400000000000000000000012161415504077600271740ustar00rootroot00000000000000const fs = require('fs'); const path = require('path'); module.exports = { description: 'allows referencing emitted files', options: { strictDeprecations: false, input: ['main.js'], preserveEntrySignatures: false, output: { chunkFileNames: 'nested/chunk.js' }, plugins: { 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: fs.readFileSync(id) })};`; } } } } }; rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/000077500000000000000000000000001415504077600271725ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/amd/000077500000000000000000000000001415504077600277335ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/amd/assets/000077500000000000000000000000001415504077600312355ustar00rootroot00000000000000logo1-a5ec488b.svg000066400000000000000000000064341415504077600341500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/amd/assets logo2-6d5979e4.svg000066400000000000000000000064341415504077600340260ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/amd/assets rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/amd/main.js000066400000000000000000000011071415504077600312140ustar00rootroot00000000000000define(['require', 'exports'], (function (require, exports) { 'use strict'; var logo = new URL(require.toUrl('./assets/logo1-a5ec488b.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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/amd/nested/000077500000000000000000000000001415504077600312155ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/amd/nested/chunk.js000066400000000000000000000003031415504077600326570ustar00rootroot00000000000000define(['require', '../main'], (function (require, main) { 'use strict'; var logo = new URL(require.toUrl('../assets/logo2-6d5979e4.svg'), document.baseURI).href; main.showImage(logo); })); rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/000077500000000000000000000000001415504077600277515ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/assets/000077500000000000000000000000001415504077600312535ustar00rootroot00000000000000logo1-a5ec488b.svg000066400000000000000000000064341415504077600341660ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/assets logo2-6d5979e4.svg000066400000000000000000000064341415504077600340440ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/assets rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/main.js000066400000000000000000000012151415504077600312320ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var logo = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/logo1-a5ec488b.svg').href : new URL('assets/logo1-a5ec488b.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-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/nested/000077500000000000000000000000001415504077600312335ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/cjs/nested/chunk.js000066400000000000000000000005141415504077600327010ustar00rootroot00000000000000'use strict'; var main = require('../main.js'); var logo = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/../assets/logo2-6d5979e4.svg').href : new URL('../assets/logo2-6d5979e4.svg', document.currentScript && document.currentScript.src || document.baseURI).href); main.showImage(logo); rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/es/000077500000000000000000000000001415504077600276015ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/es/assets/000077500000000000000000000000001415504077600311035ustar00rootroot00000000000000logo1-a5ec488b.svg000066400000000000000000000064341415504077600340160ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/es/assets logo2-6d5979e4.svg000066400000000000000000000064341415504077600336740ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/es/assets rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/es/main.js000066400000000000000000000005231415504077600310630ustar00rootroot00000000000000var logo = new URL('assets/logo1-a5ec488b.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-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/es/nested/000077500000000000000000000000001415504077600310635ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/es/nested/chunk.js000066400000000000000000000002121415504077600325240ustar00rootroot00000000000000import { s as showImage } from '../main.js'; var logo = new URL('../assets/logo2-6d5979e4.svg', import.meta.url).href; showImage(logo); rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/system/000077500000000000000000000000001415504077600305165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/system/assets/000077500000000000000000000000001415504077600320205ustar00rootroot00000000000000logo1-a5ec488b.svg000066400000000000000000000064341415504077600347330ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/system/assets logo2-6d5979e4.svg000066400000000000000000000064341415504077600346110ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/system/assets rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/system/main.js000066400000000000000000000007611415504077600320040ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { exports('s', showImage); var logo = new URL('assets/logo1-a5ec488b.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-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/system/nested/000077500000000000000000000000001415504077600320005ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/_expected/system/nested/chunk.js000066400000000000000000000004621415504077600334500ustar00rootroot00000000000000System.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-6d5979e4.svg', module.meta.url).href; showImage(logo); }) }; })); rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/index-amd.html000066400000000000000000000003461415504077600277710ustar00rootroot00000000000000 AMD rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/index-es.html000066400000000000000000000002701415504077600276330ustar00rootroot00000000000000 Title rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/index-system.html000066400000000000000000000004111415504077600305450ustar00rootroot00000000000000 SystemJS rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/logo1.svg000066400000000000000000000064341415504077600270030ustar00rootroot00000000000000 rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/logo2.svg000066400000000000000000000064341415504077600270040ustar00rootroot00000000000000 rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/main.js000066400000000000000000000001631415504077600265140ustar00rootroot00000000000000import logo from './logo1.svg'; import { showImage } from './show-image'; showImage(logo); import('./nested.js'); rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/nested.js000066400000000000000000000001341415504077600270500ustar00rootroot00000000000000import logo from './logo2.svg'; import { showImage } from './show-image'; showImage(logo); rollup-2.61.1/test/chunking-form/samples/emit-file/reference-files/show-image.js000066400000000000000000000003071415504077600276300ustar00rootroot00000000000000export function showImage(url) { console.log(url); if (typeof document !== 'undefined') { const image = document.createElement('img'); image.src = url; document.body.appendChild(image); } } rollup-2.61.1/test/chunking-form/samples/emit-file/sanitize-file-name/000077500000000000000000000000001415504077600256555ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/sanitize-file-name/_config.js000066400000000000000000000006211415504077600276160ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/000077500000000000000000000000001415504077600276155ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/amd/000077500000000000000000000000001415504077600303565ustar00rootroot00000000000000generated-_virtual.js000066400000000000000000000001041415504077600344110ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/amddefine((function () { 'use strict'; console.log('virtual'); })); rollup-2.61.1/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/amd/main.js000066400000000000000000000001321415504077600316340ustar00rootroot00000000000000define((function () { 'use strict'; var value = 42; console.log('main', value); })); rollup-2.61.1/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/cjs/000077500000000000000000000000001415504077600303745ustar00rootroot00000000000000generated-_virtual.js000066400000000000000000000000471415504077600344350ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/cjs'use strict'; console.log('virtual'); rollup-2.61.1/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/cjs/main.js000066400000000000000000000000741415504077600316570ustar00rootroot00000000000000'use strict'; var value = 42; console.log('main', value); rollup-2.61.1/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/es/000077500000000000000000000000001415504077600302245ustar00rootroot00000000000000generated-_virtual.js000066400000000000000000000000301415504077600342550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/esconsole.log('virtual'); rollup-2.61.1/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/es/main.js000066400000000000000000000000551415504077600315060ustar00rootroot00000000000000var value = 42; console.log('main', value); rollup-2.61.1/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/system/000077500000000000000000000000001415504077600311415ustar00rootroot00000000000000generated-_virtual.js000066400000000000000000000002011415504077600351720ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('virtual'); }) }; })); rollup-2.61.1/test/chunking-form/samples/emit-file/sanitize-file-name/_expected/system/main.js000066400000000000000000000002311415504077600324170ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var value = 42; console.log('main', value); }) }; })); rollup-2.61.1/test/chunking-form/samples/emit-file/sanitize-file-name/buildStart.js000066400000000000000000000001011415504077600303200ustar00rootroot00000000000000import value from './dep.js'; console.log('startBuild', value); rollup-2.61.1/test/chunking-form/samples/emit-file/sanitize-file-name/dep.js000066400000000000000000000000231415504077600267560ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/emit-file/sanitize-file-name/main.js000066400000000000000000000000731415504077600271370ustar00rootroot00000000000000import value from './dep.js'; console.log('main', value); rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/000077500000000000000000000000001415504077600254025ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_config.js000066400000000000000000000071401415504077600273460ustar00rootroot00000000000000let 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 = { 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 banner = import.meta.ROLLUP_FILE_URL_${banner};\n` + `export const bannerNamed = import.meta.ROLLUP_FILE_URL_${bannerNamed};\n` + `export const footer = import.meta.ROLLUP_FILE_URL_${footer};\n` + `export const footerNamed = import.meta.ROLLUP_FILE_URL_${footerNamed};\n` + `export const intro = import.meta.ROLLUP_FILE_URL_${intro};\n` + `export const introNamed = import.meta.ROLLUP_FILE_URL_${introNamed};\n` + `export const outro = import.meta.ROLLUP_FILE_URL_${outro};\n` + `export const outroNamed = import.meta.ROLLUP_FILE_URL_${outroNamed};\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-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/000077500000000000000000000000001415504077600273425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/000077500000000000000000000000001415504077600301035ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assets/000077500000000000000000000000001415504077600314055ustar00rootroot00000000000000banner-2b65cc0c.txt000066400000000000000000000000061415504077600345350ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assetsbannerfooter-e1d2fccb.txt000066400000000000000000000000061415504077600347300ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assetsfootergenerateBundle-ea61028d.txt000066400000000000000000000001011415504077600361330ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assetsgenerateBundle amd with assets/generateBundle-format-78d67aa8.txtgenerateBundle-format-78d67aa8.txt000066400000000000000000000000031415504077600374410ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assetsamdintro-520a8116.txt000066400000000000000000000000051415504077600342020ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assetsintrooutro-21f77720.txt000066400000000000000000000000051415504077600342270ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assetsoutrorenderChunk-a91c7c32.txt000066400000000000000000000000131415504077600354630ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assetsrenderChunkrenderStart-66600c78.txt000066400000000000000000000000131415504077600353570ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/assetsrenderStartrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/banner.txt000066400000000000000000000000061415504077600321050ustar00rootroot00000000000000bannerrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/footer.txt000066400000000000000000000000061415504077600321360ustar00rootroot00000000000000footergenerateBundle-format.txt000066400000000000000000000000031415504077600347700ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/amdamdrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/generateBundle.txt000066400000000000000000000001011415504077600335600ustar00rootroot00000000000000generateBundle amd with assets/generateBundle-format-78d67aa8.txtrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/intro.txt000066400000000000000000000000051415504077600317720ustar00rootroot00000000000000introrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/main.js000066400000000000000000000027361415504077600313750ustar00rootroot00000000000000define(['require', 'exports'], (function (require, exports) { 'use strict'; const renderStart = new URL(require.toUrl('./assets/renderStart-66600c78.txt'), document.baseURI).href; const renderStartNamed = new URL(require.toUrl('./renderStart.txt'), document.baseURI).href; const renderStartNamedImmediately = 'renderStart.txt'; const banner = new URL(require.toUrl('./assets/banner-2b65cc0c.txt'), document.baseURI).href; const bannerNamed = new URL(require.toUrl('./banner.txt'), document.baseURI).href; const footer = new URL(require.toUrl('./assets/footer-e1d2fccb.txt'), document.baseURI).href; const footerNamed = new URL(require.toUrl('./footer.txt'), document.baseURI).href; const intro = new URL(require.toUrl('./assets/intro-520a8116.txt'), document.baseURI).href; const introNamed = new URL(require.toUrl('./intro.txt'), document.baseURI).href; const outro = new URL(require.toUrl('./assets/outro-21f77720.txt'), document.baseURI).href; const outroNamed = new URL(require.toUrl('./outro.txt'), document.baseURI).href; exports.banner = banner; exports.bannerNamed = bannerNamed; exports.footer = footer; exports.footerNamed = footerNamed; exports.intro = intro; exports.introNamed = introNamed; exports.outro = outro; exports.outroNamed = outroNamed; exports.renderStart = renderStart; exports.renderStartNamed = renderStartNamed; exports.renderStartNamedImmediately = renderStartNamedImmediately; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/outro.txt000066400000000000000000000000051415504077600320070ustar00rootroot00000000000000outrorollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/renderChunk.txt000066400000000000000000000000131415504077600331060ustar00rootroot00000000000000renderChunkrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/amd/renderStart.txt000066400000000000000000000000131415504077600331330ustar00rootroot00000000000000renderStartrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/000077500000000000000000000000001415504077600301215ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assets/000077500000000000000000000000001415504077600314235ustar00rootroot00000000000000banner-2b65cc0c.txt000066400000000000000000000000061415504077600345530ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assetsbannerfooter-e1d2fccb.txt000066400000000000000000000000061415504077600347460ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assetsfootergenerateBundle-7ba089df.txt000066400000000000000000000001011415504077600362430ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assetsgenerateBundle cjs with assets/generateBundle-format-ef46b0c8.txtgenerateBundle-format-ef46b0c8.txt000066400000000000000000000000031415504077600375270ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assetscjsintro-520a8116.txt000066400000000000000000000000051415504077600342200ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assetsintrooutro-21f77720.txt000066400000000000000000000000051415504077600342450ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assetsoutrorenderChunk-a91c7c32.txt000066400000000000000000000000131415504077600355010ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assetsrenderChunkrenderStart-66600c78.txt000066400000000000000000000000131415504077600353750ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/assetsrenderStartrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/banner.txt000066400000000000000000000000061415504077600321230ustar00rootroot00000000000000bannerrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/footer.txt000066400000000000000000000000061415504077600321540ustar00rootroot00000000000000footergenerateBundle-format.txt000066400000000000000000000000031415504077600350060ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjscjsrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/generateBundle.txt000066400000000000000000000001011415504077600335760ustar00rootroot00000000000000generateBundle cjs with assets/generateBundle-format-ef46b0c8.txtrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/intro.txt000066400000000000000000000000051415504077600320100ustar00rootroot00000000000000introrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/main.js000066400000000000000000000056531415504077600314140ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const renderStart = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/renderStart-66600c78.txt').href : new URL('assets/renderStart-66600c78.txt', document.currentScript && document.currentScript.src || document.baseURI).href); const renderStartNamed = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/renderStart.txt').href : new URL('renderStart.txt', document.currentScript && document.currentScript.src || document.baseURI).href); const renderStartNamedImmediately = 'renderStart.txt'; const banner = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/banner-2b65cc0c.txt').href : new URL('assets/banner-2b65cc0c.txt', document.currentScript && document.currentScript.src || document.baseURI).href); const bannerNamed = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/banner.txt').href : new URL('banner.txt', document.currentScript && document.currentScript.src || document.baseURI).href); const footer = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/footer-e1d2fccb.txt').href : new URL('assets/footer-e1d2fccb.txt', document.currentScript && document.currentScript.src || document.baseURI).href); const footerNamed = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/footer.txt').href : new URL('footer.txt', document.currentScript && document.currentScript.src || document.baseURI).href); const intro = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/intro-520a8116.txt').href : new URL('assets/intro-520a8116.txt', document.currentScript && document.currentScript.src || document.baseURI).href); const introNamed = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/intro.txt').href : new URL('intro.txt', document.currentScript && document.currentScript.src || document.baseURI).href); const outro = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/outro-21f77720.txt').href : new URL('assets/outro-21f77720.txt', document.currentScript && document.currentScript.src || document.baseURI).href); const outroNamed = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/outro.txt').href : new URL('outro.txt', document.currentScript && document.currentScript.src || document.baseURI).href); exports.banner = banner; exports.bannerNamed = bannerNamed; exports.footer = footer; exports.footerNamed = footerNamed; exports.intro = intro; exports.introNamed = introNamed; exports.outro = outro; exports.outroNamed = outroNamed; exports.renderStart = renderStart; exports.renderStartNamed = renderStartNamed; exports.renderStartNamedImmediately = renderStartNamedImmediately; rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/outro.txt000066400000000000000000000000051415504077600320250ustar00rootroot00000000000000outrorollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/renderChunk.txt000066400000000000000000000000131415504077600331240ustar00rootroot00000000000000renderChunkrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/cjs/renderStart.txt000066400000000000000000000000131415504077600331510ustar00rootroot00000000000000renderStartrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/000077500000000000000000000000001415504077600277515ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assets/000077500000000000000000000000001415504077600312535ustar00rootroot00000000000000banner-2b65cc0c.txt000066400000000000000000000000061415504077600344030ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assetsbannerfooter-e1d2fccb.txt000066400000000000000000000000061415504077600345760ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assetsfootergenerateBundle-7e84678a.txt000066400000000000000000000001001415504077600357430ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assetsgenerateBundle es with assets/generateBundle-format-8b573c58.txtgenerateBundle-format-8b573c58.txt000066400000000000000000000000021415504077600372250ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assetsesintro-520a8116.txt000066400000000000000000000000051415504077600340500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assetsintrooutro-21f77720.txt000066400000000000000000000000051415504077600340750ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assetsoutrorenderChunk-a91c7c32.txt000066400000000000000000000000131415504077600353310ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assetsrenderChunkrenderStart-66600c78.txt000066400000000000000000000000131415504077600352250ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/assetsrenderStartrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/banner.txt000066400000000000000000000000061415504077600317530ustar00rootroot00000000000000bannerrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/footer.txt000066400000000000000000000000061415504077600320040ustar00rootroot00000000000000footergenerateBundle-format.txt000066400000000000000000000000021415504077600346350ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/esesrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/generateBundle.txt000066400000000000000000000001001415504077600334250ustar00rootroot00000000000000generateBundle es with assets/generateBundle-format-8b573c58.txtrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/intro.txt000066400000000000000000000000051415504077600316400ustar00rootroot00000000000000introrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/main.js000066400000000000000000000016341415504077600312370ustar00rootroot00000000000000const renderStart = new URL('assets/renderStart-66600c78.txt', import.meta.url).href; const renderStartNamed = new URL('renderStart.txt', import.meta.url).href; const renderStartNamedImmediately = 'renderStart.txt'; const banner = new URL('assets/banner-2b65cc0c.txt', import.meta.url).href; const bannerNamed = new URL('banner.txt', import.meta.url).href; const footer = new URL('assets/footer-e1d2fccb.txt', import.meta.url).href; const footerNamed = new URL('footer.txt', import.meta.url).href; const intro = new URL('assets/intro-520a8116.txt', import.meta.url).href; const introNamed = new URL('intro.txt', import.meta.url).href; const outro = new URL('assets/outro-21f77720.txt', import.meta.url).href; const outroNamed = new URL('outro.txt', import.meta.url).href; export { banner, bannerNamed, footer, footerNamed, intro, introNamed, outro, outroNamed, renderStart, renderStartNamed, renderStartNamedImmediately }; rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/outro.txt000066400000000000000000000000051415504077600316550ustar00rootroot00000000000000outrorollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/renderChunk.txt000066400000000000000000000000131415504077600327540ustar00rootroot00000000000000renderChunkrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/es/renderStart.txt000066400000000000000000000000131415504077600330010ustar00rootroot00000000000000renderStartrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/000077500000000000000000000000001415504077600306665ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assets/000077500000000000000000000000001415504077600321705ustar00rootroot00000000000000banner-2b65cc0c.txt000066400000000000000000000000061415504077600353200ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assetsbannerfooter-e1d2fccb.txt000066400000000000000000000000061415504077600355130ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assetsfootergenerateBundle-dd5a26a4.txt000066400000000000000000000001041415504077600370010ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assetsgenerateBundle system with assets/generateBundle-format-7df86840.txtgenerateBundle-format-7df86840.txt000066400000000000000000000000061415504077600401500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assetssystemintro-520a8116.txt000066400000000000000000000000051415504077600347650ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assetsintrooutro-21f77720.txt000066400000000000000000000000051415504077600350120ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assetsoutrorenderChunk-a91c7c32.txt000066400000000000000000000000131415504077600362460ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assetsrenderChunkrenderStart-66600c78.txt000066400000000000000000000000131415504077600361420ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/assetsrenderStartrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/banner.txt000066400000000000000000000000061415504077600326700ustar00rootroot00000000000000bannerrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/footer.txt000066400000000000000000000000061415504077600327210ustar00rootroot00000000000000footergenerateBundle-format.txt000066400000000000000000000000061415504077600355560ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/systemsystemgenerateBundle.txt000066400000000000000000000001041415504077600342670ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/systemgenerateBundle system with assets/generateBundle-format-7df86840.txtrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/intro.txt000066400000000000000000000000051415504077600325550ustar00rootroot00000000000000introrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/main.js000066400000000000000000000022371415504077600321540ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const renderStart = exports('renderStart', new URL('assets/renderStart-66600c78.txt', module.meta.url).href); const renderStartNamed = exports('renderStartNamed', new URL('renderStart.txt', module.meta.url).href); const renderStartNamedImmediately = exports('renderStartNamedImmediately', 'renderStart.txt'); const banner = exports('banner', new URL('assets/banner-2b65cc0c.txt', module.meta.url).href); const bannerNamed = exports('bannerNamed', new URL('banner.txt', module.meta.url).href); const footer = exports('footer', new URL('assets/footer-e1d2fccb.txt', module.meta.url).href); const footerNamed = exports('footerNamed', new URL('footer.txt', module.meta.url).href); const intro = exports('intro', new URL('assets/intro-520a8116.txt', module.meta.url).href); const introNamed = exports('introNamed', new URL('intro.txt', module.meta.url).href); const outro = exports('outro', new URL('assets/outro-21f77720.txt', module.meta.url).href); const outroNamed = exports('outroNamed', new URL('outro.txt', module.meta.url).href); }) }; })); rollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/outro.txt000066400000000000000000000000051415504077600325720ustar00rootroot00000000000000outrorollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/renderChunk.txt000066400000000000000000000000131415504077600336710ustar00rootroot00000000000000renderChunkrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/_expected/system/renderStart.txt000066400000000000000000000000131415504077600337160ustar00rootroot00000000000000renderStartrollup-2.61.1/test/chunking-form/samples/emit-file/set-asset-source/main.js000066400000000000000000000000251415504077600266610ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/chunking-form/samples/empty-chunks/000077500000000000000000000000001415504077600227505ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/empty-chunks/_config.js000066400000000000000000000002211415504077600247050ustar00rootroot00000000000000module.exports = { description: 'empty chunk pruning', expectedWarnings: ['EMPTY_BUNDLE'], options: { input: ['main1.js', 'main2.js'] } }; rollup-2.61.1/test/chunking-form/samples/empty-chunks/_expected/000077500000000000000000000000001415504077600247105ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/empty-chunks/_expected/amd/000077500000000000000000000000001415504077600254515ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/empty-chunks/_expected/amd/main1.js000066400000000000000000000000541415504077600270130ustar00rootroot00000000000000define((function () { 'use strict'; })); rollup-2.61.1/test/chunking-form/samples/empty-chunks/_expected/amd/main2.js000066400000000000000000000000541415504077600270140ustar00rootroot00000000000000define((function () { 'use strict'; })); rollup-2.61.1/test/chunking-form/samples/empty-chunks/_expected/cjs/000077500000000000000000000000001415504077600254675ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/empty-chunks/_expected/cjs/main1.js000066400000000000000000000000171415504077600270300ustar00rootroot00000000000000'use strict'; rollup-2.61.1/test/chunking-form/samples/empty-chunks/_expected/cjs/main2.js000066400000000000000000000000171415504077600270310ustar00rootroot00000000000000'use strict'; rollup-2.61.1/test/chunking-form/samples/empty-chunks/_expected/es/000077500000000000000000000000001415504077600253175ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/empty-chunks/_expected/es/main1.js000066400000000000000000000000011415504077600266510ustar00rootroot00000000000000 rollup-2.61.1/test/chunking-form/samples/empty-chunks/_expected/es/main2.js000066400000000000000000000000011415504077600266520ustar00rootroot00000000000000 rollup-2.61.1/test/chunking-form/samples/empty-chunks/_expected/system/000077500000000000000000000000001415504077600262345ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/empty-chunks/_expected/system/main1.js000066400000000000000000000001471415504077600276010ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/empty-chunks/_expected/system/main2.js000066400000000000000000000001471415504077600276020ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/empty-chunks/dep.js000066400000000000000000000000751415504077600240600ustar00rootroot00000000000000import {treeshaken} from './secondaryDep.js'; treeshaken(); rollup-2.61.1/test/chunking-form/samples/empty-chunks/main1.js000066400000000000000000000000221415504077600243050ustar00rootroot00000000000000import './dep.js';rollup-2.61.1/test/chunking-form/samples/empty-chunks/main2.js000066400000000000000000000000221415504077600243060ustar00rootroot00000000000000import './dep.js';rollup-2.61.1/test/chunking-form/samples/empty-chunks/secondaryDep.js000066400000000000000000000000401415504077600257200ustar00rootroot00000000000000export function treeshaken () {}rollup-2.61.1/test/chunking-form/samples/empty-module-no-treeshake/000077500000000000000000000000001415504077600253255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/empty-module-no-treeshake/_config.js000066400000000000000000000032051415504077600272670ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const { getObject } = require('../../../utils'); module.exports = { description: 'associates empty modules with chunks if tree-shaking is disabled for them', options: { 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( Array.from(this.getModuleIds(), 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'] } ); } } } }; rollup-2.61.1/test/chunking-form/samples/empty-module-no-treeshake/_expected/000077500000000000000000000000001415504077600272655ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/empty-module-no-treeshake/_expected/amd/000077500000000000000000000000001415504077600300265ustar00rootroot00000000000000generated-emptyTransformed.js000066400000000000000000000000541415504077600356030ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/empty-module-no-treeshake/_expected/amddefine((function () { 'use strict'; })); rollup-2.61.1/test/chunking-form/samples/empty-module-no-treeshake/_expected/amd/main1.js000066400000000000000000000001641415504077600313720ustar00rootroot00000000000000define(['./generated-emptyTransformed'], (function (emptyTransformed) { 'use strict'; console.log('main1'); })); rollup-2.61.1/test/chunking-form/samples/empty-module-no-treeshake/_expected/amd/main2.js000066400000000000000000000001641415504077600313730ustar00rootroot00000000000000define(['./generated-emptyTransformed'], (function (emptyTransformed) { 'use strict'; console.log('main2'); })); rollup-2.61.1/test/chunking-form/samples/empty-module-no-treeshake/_expected/cjs/000077500000000000000000000000001415504077600300445ustar00rootroot00000000000000generated-emptyTransformed.js000066400000000000000000000000171415504077600356200ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/empty-module-no-treeshake/_expected/cjs'use strict'; rollup-2.61.1/test/chunking-form/samples/empty-module-no-treeshake/_expected/cjs/main1.js000066400000000000000000000001221415504077600314020ustar00rootroot00000000000000'use strict'; require('./generated-emptyTransformed.js'); console.log('main1'); rollup-2.61.1/test/chunking-form/samples/empty-module-no-treeshake/_expected/cjs/main2.js000066400000000000000000000001221415504077600314030ustar00rootroot00000000000000'use strict'; require('./generated-emptyTransformed.js'); console.log('main2'); rollup-2.61.1/test/chunking-form/samples/empty-module-no-treeshake/_expected/es/000077500000000000000000000000001415504077600276745ustar00rootroot00000000000000generated-emptyTransformed.js000066400000000000000000000000011415504077600354410ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/empty-module-no-treeshake/_expected/es rollup-2.61.1/test/chunking-form/samples/empty-module-no-treeshake/_expected/es/main1.js000066400000000000000000000001011415504077600312270ustar00rootroot00000000000000import './generated-emptyTransformed.js'; console.log('main1'); rollup-2.61.1/test/chunking-form/samples/empty-module-no-treeshake/_expected/es/main2.js000066400000000000000000000001011415504077600312300ustar00rootroot00000000000000import './generated-emptyTransformed.js'; console.log('main2'); rollup-2.61.1/test/chunking-form/samples/empty-module-no-treeshake/_expected/system/000077500000000000000000000000001415504077600306115ustar00rootroot00000000000000generated-emptyTransformed.js000066400000000000000000000001471415504077600363710ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/empty-module-no-treeshake/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/empty-module-no-treeshake/_expected/system/main1.js000066400000000000000000000002751415504077600321600ustar00rootroot00000000000000System.register(['./generated-emptyTransformed.js'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { console.log('main1'); }) }; })); rollup-2.61.1/test/chunking-form/samples/empty-module-no-treeshake/_expected/system/main2.js000066400000000000000000000002751415504077600321610ustar00rootroot00000000000000System.register(['./generated-emptyTransformed.js'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { console.log('main2'); }) }; })); rollup-2.61.1/test/chunking-form/samples/empty-module-no-treeshake/main1.js000066400000000000000000000001311415504077600266630ustar00rootroot00000000000000import 'empty'; import 'emptyResolved'; import 'emptyTransformed'; console.log('main1'); rollup-2.61.1/test/chunking-form/samples/empty-module-no-treeshake/main2.js000066400000000000000000000001271415504077600266710ustar00rootroot00000000000000import 'empty'; import 'emptyLoaded'; import 'emptyTransformed'; console.log('main2'); rollup-2.61.1/test/chunking-form/samples/entry-aliases/000077500000000000000000000000001415504077600231015ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entry-aliases/_config.js000066400000000000000000000003511415504077600250420ustar00rootroot00000000000000module.exports = { description: 'alias module dependency inlining', options: { input: { 'main1.js': 'main1.js', 'main1-alias.js': 'main1.js', 'main2.js': 'main2.js' }, output: { entryFileNames: '[name]' } } }; rollup-2.61.1/test/chunking-form/samples/entry-aliases/_expected/000077500000000000000000000000001415504077600250415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entry-aliases/_expected/amd/000077500000000000000000000000001415504077600256025ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entry-aliases/_expected/amd/generated-dep.js000066400000000000000000000001521415504077600306420ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var name = 'name'; exports.name = name; })); rollup-2.61.1/test/chunking-form/samples/entry-aliases/_expected/amd/main1-alias.js000066400000000000000000000002641415504077600302360ustar00rootroot00000000000000define(['exports', './generated-dep'], (function (exports, dep) { 'use strict'; exports.name = dep.name; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/entry-aliases/_expected/amd/main1.js000066400000000000000000000002641415504077600271470ustar00rootroot00000000000000define(['exports', './generated-dep'], (function (exports, dep) { 'use strict'; exports.name = dep.name; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/entry-aliases/_expected/amd/main2.js000066400000000000000000000001331415504077600271430ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log(dep.name); })); rollup-2.61.1/test/chunking-form/samples/entry-aliases/_expected/cjs/000077500000000000000000000000001415504077600256205ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entry-aliases/_expected/cjs/generated-dep.js000066400000000000000000000000701415504077600306570ustar00rootroot00000000000000'use strict'; var name = 'name'; exports.name = name; rollup-2.61.1/test/chunking-form/samples/entry-aliases/_expected/cjs/main1-alias.js000066400000000000000000000002241415504077600302500ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var dep = require('./generated-dep.js'); exports.name = dep.name; rollup-2.61.1/test/chunking-form/samples/entry-aliases/_expected/cjs/main1.js000066400000000000000000000002241415504077600271610ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var dep = require('./generated-dep.js'); exports.name = dep.name; rollup-2.61.1/test/chunking-form/samples/entry-aliases/_expected/cjs/main2.js000066400000000000000000000001201415504077600271550ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log(dep.name); rollup-2.61.1/test/chunking-form/samples/entry-aliases/_expected/es/000077500000000000000000000000001415504077600254505ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entry-aliases/_expected/es/generated-dep.js000066400000000000000000000000521415504077600305070ustar00rootroot00000000000000var name = 'name'; export { name as n }; rollup-2.61.1/test/chunking-form/samples/entry-aliases/_expected/es/main1-alias.js000066400000000000000000000000601415504077600300760ustar00rootroot00000000000000export { n as name } from './generated-dep.js'; rollup-2.61.1/test/chunking-form/samples/entry-aliases/_expected/es/main1.js000066400000000000000000000000601415504077600270070ustar00rootroot00000000000000export { n as name } from './generated-dep.js'; rollup-2.61.1/test/chunking-form/samples/entry-aliases/_expected/es/main2.js000066400000000000000000000001041415504077600270070ustar00rootroot00000000000000import { n as name } from './generated-dep.js'; console.log(name); rollup-2.61.1/test/chunking-form/samples/entry-aliases/_expected/system/000077500000000000000000000000001415504077600263655ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entry-aliases/_expected/system/generated-dep.js000066400000000000000000000002211415504077600314220ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var name = exports('n', 'name'); }) }; })); rollup-2.61.1/test/chunking-form/samples/entry-aliases/_expected/system/main1-alias.js000066400000000000000000000003061415504077600310160ustar00rootroot00000000000000System.register(['./generated-dep.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('name', module.n); }], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/entry-aliases/_expected/system/main1.js000066400000000000000000000003061415504077600277270ustar00rootroot00000000000000System.register(['./generated-dep.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('name', module.n); }], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/entry-aliases/_expected/system/main2.js000066400000000000000000000003251415504077600277310ustar00rootroot00000000000000System.register(['./generated-dep.js'], (function () { 'use strict'; var name; return { setters: [function (module) { name = module.n; }], execute: (function () { console.log(name); }) }; })); rollup-2.61.1/test/chunking-form/samples/entry-aliases/dep.js000066400000000000000000000000321415504077600242020ustar00rootroot00000000000000export var name = 'name'; rollup-2.61.1/test/chunking-form/samples/entry-aliases/main1.js000066400000000000000000000000411415504077600244370ustar00rootroot00000000000000export { name } from './dep.js'; rollup-2.61.1/test/chunking-form/samples/entry-aliases/main2.js000066400000000000000000000000641415504077600244450ustar00rootroot00000000000000import { name } from './dep.js'; console.log(name); rollup-2.61.1/test/chunking-form/samples/entry-chunk-export-mode/000077500000000000000000000000001415504077600250315ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entry-chunk-export-mode/_config.js000066400000000000000000000001671415504077600267770ustar00rootroot00000000000000module.exports = { description: 'entry chunk export mode checks', options: { input: ['main1.js', 'main2.js'] } }; rollup-2.61.1/test/chunking-form/samples/entry-chunk-export-mode/_expected/000077500000000000000000000000001415504077600267715ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entry-chunk-export-mode/_expected/amd/000077500000000000000000000000001415504077600275325ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entry-chunk-export-mode/_expected/amd/main1.js000066400000000000000000000001071415504077600310730ustar00rootroot00000000000000define(['./main2'], (function (main2) { 'use strict'; main2(); })); rollup-2.61.1/test/chunking-form/samples/entry-chunk-export-mode/_expected/amd/main2.js000066400000000000000000000001541415504077600310760ustar00rootroot00000000000000define((function () { 'use strict'; function fn () { console.log('main fn'); } return fn; })); rollup-2.61.1/test/chunking-form/samples/entry-chunk-export-mode/_expected/cjs/000077500000000000000000000000001415504077600275505ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entry-chunk-export-mode/_expected/cjs/main1.js000066400000000000000000000000741415504077600311140ustar00rootroot00000000000000'use strict'; var main2 = require('./main2.js'); main2(); rollup-2.61.1/test/chunking-form/samples/entry-chunk-export-mode/_expected/cjs/main2.js000066400000000000000000000001221415504077600311070ustar00rootroot00000000000000'use strict'; function fn () { console.log('main fn'); } module.exports = fn; rollup-2.61.1/test/chunking-form/samples/entry-chunk-export-mode/_expected/es/000077500000000000000000000000001415504077600274005ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entry-chunk-export-mode/_expected/es/main1.js000066400000000000000000000000441415504077600307410ustar00rootroot00000000000000import fn from './main2.js'; fn(); rollup-2.61.1/test/chunking-form/samples/entry-chunk-export-mode/_expected/es/main2.js000066400000000000000000000001101415504077600307340ustar00rootroot00000000000000function fn () { console.log('main fn'); } export { fn as default }; rollup-2.61.1/test/chunking-form/samples/entry-chunk-export-mode/_expected/system/000077500000000000000000000000001415504077600303155ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entry-chunk-export-mode/_expected/system/main1.js000066400000000000000000000003051415504077600316560ustar00rootroot00000000000000System.register(['./main2.js'], (function () { 'use strict'; var fn; return { setters: [function (module) { fn = module["default"]; }], execute: (function () { fn(); }) }; })); rollup-2.61.1/test/chunking-form/samples/entry-chunk-export-mode/_expected/system/main2.js000066400000000000000000000003221415504077600316560ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('default', fn); function fn () { console.log('main fn'); } }) }; })); rollup-2.61.1/test/chunking-form/samples/entry-chunk-export-mode/main1.js000066400000000000000000000000451415504077600263730ustar00rootroot00000000000000import fn from './main2.js'; fn(); rollup-2.61.1/test/chunking-form/samples/entry-chunk-export-mode/main2.js000066400000000000000000000000741415504077600263760ustar00rootroot00000000000000export default function fn () { console.log('main fn'); } rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/000077500000000000000000000000001415504077600260235ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/_config.js000066400000000000000000000002461415504077600277670ustar00rootroot00000000000000module.exports = { description: 'Handles entry points that contain no own code except imports and exports', options: { input: ['main.js', 'm1.js', 'm2.js'] } }; rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/_expected/000077500000000000000000000000001415504077600277635ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/_expected/amd/000077500000000000000000000000001415504077600305245ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/_expected/amd/generated-m1.js000066400000000000000000000002461415504077600333350ustar00rootroot00000000000000define(['exports', './m2'], (function (exports, m2) { 'use strict'; var ms = /*#__PURE__*/Object.freeze({ __proto__: null, m2: m2 }); exports.ms = ms; })); rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/_expected/amd/m1.js000066400000000000000000000002401415504077600313730ustar00rootroot00000000000000define(['exports', './m2'], (function (exports, m2) { 'use strict'; exports.m2 = m2; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/_expected/amd/m2.js000066400000000000000000000001101415504077600313700ustar00rootroot00000000000000define((function () { 'use strict'; var m2 = 'm2'; return m2; })); rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/_expected/amd/main.js000066400000000000000000000001421415504077600320030ustar00rootroot00000000000000define(['./generated-m1', './m2'], (function (m1, m2) { 'use strict'; console.log(m1.ms); })); rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/_expected/cjs/000077500000000000000000000000001415504077600305425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/_expected/cjs/generated-m1.js000066400000000000000000000002031415504077600333440ustar00rootroot00000000000000'use strict'; var m2 = require('./m2.js'); var ms = /*#__PURE__*/Object.freeze({ __proto__: null, m2: m2 }); exports.ms = ms; rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/_expected/cjs/m1.js000066400000000000000000000002001415504077600314050ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var m2 = require('./m2.js'); exports.m2 = m2; rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/_expected/cjs/m2.js000066400000000000000000000000641415504077600314160ustar00rootroot00000000000000'use strict'; var m2 = 'm2'; module.exports = m2; rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/_expected/cjs/main.js000066400000000000000000000001371415504077600320250ustar00rootroot00000000000000'use strict'; var m1 = require('./generated-m1.js'); require('./m2.js'); console.log(m1.ms); rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/_expected/es/000077500000000000000000000000001415504077600303725ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/_expected/es/generated-m1.js000066400000000000000000000001641415504077600332020ustar00rootroot00000000000000import m2 from './m2.js'; var ms = /*#__PURE__*/Object.freeze({ __proto__: null, m2: m2 }); export { ms as m }; rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/_expected/es/m1.js000066400000000000000000000000511415504077600312410ustar00rootroot00000000000000export { default as m2 } from './m2.js'; rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/_expected/es/m2.js000066400000000000000000000000521415504077600312430ustar00rootroot00000000000000var m2 = 'm2'; export { m2 as default }; rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/_expected/es/main.js000066400000000000000000000001211415504077600316460ustar00rootroot00000000000000import { m as ms } from './generated-m1.js'; import './m2.js'; console.log(ms); rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/_expected/system/000077500000000000000000000000001415504077600313075ustar00rootroot00000000000000generated-m1.js000066400000000000000000000004451415504077600340420ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/entry-point-without-own-code/_expected/system/m1.js000066400000000000000000000003021415504077600321550ustar00rootroot00000000000000System.register(['./m2.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('m2', module["default"]); }], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/_expected/system/m2.js000066400000000000000000000002231415504077600321600ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var m2 = exports('default', 'm2'); }) }; })); rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/_expected/system/main.js000066400000000000000000000003511415504077600325700ustar00rootroot00000000000000System.register(['./generated-m1.js', './m2.js'], (function () { 'use strict'; var ms; return { setters: [function (module) { ms = module.m; }, function () {}], execute: (function () { console.log(ms); }) }; })); rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/m1.js000066400000000000000000000000521415504077600266730ustar00rootroot00000000000000import m2 from './m2.js'; export { m2 }; rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/m2.js000066400000000000000000000000251415504077600266740ustar00rootroot00000000000000export default 'm2'; rollup-2.61.1/test/chunking-form/samples/entry-point-without-own-code/main.js000066400000000000000000000000611415504077600273020ustar00rootroot00000000000000import * as ms from './m1.js'; console.log(ms); rollup-2.61.1/test/chunking-form/samples/entrypoint-aliasing/000077500000000000000000000000001415504077600243215ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entrypoint-aliasing/_config.js000066400000000000000000000002261415504077600262630ustar00rootroot00000000000000module.exports = { description: 'entry point facade creation', options: { input: { main1alias: 'main1.js', main2alias: 'main2.js' } } }; rollup-2.61.1/test/chunking-form/samples/entrypoint-aliasing/_expected/000077500000000000000000000000001415504077600262615ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entrypoint-aliasing/_expected/amd/000077500000000000000000000000001415504077600270225ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entrypoint-aliasing/_expected/amd/generated-main2.js000066400000000000000000000003061415504077600323210ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var dep = { x: 42 }; function log (x) { if (dep) { console.log(x); } } exports.dep = dep; exports.log = log; })); rollup-2.61.1/test/chunking-form/samples/entrypoint-aliasing/_expected/amd/main1alias.js000066400000000000000000000001551415504077600314000ustar00rootroot00000000000000define(['./generated-main2'], (function (main2alias) { 'use strict'; main2alias.log(main2alias.dep); })); rollup-2.61.1/test/chunking-form/samples/entrypoint-aliasing/_expected/amd/main2alias.js000066400000000000000000000001461415504077600314010ustar00rootroot00000000000000define(['./generated-main2'], (function (main2alias) { 'use strict'; return main2alias.log; })); rollup-2.61.1/test/chunking-form/samples/entrypoint-aliasing/_expected/cjs/000077500000000000000000000000001415504077600270405ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entrypoint-aliasing/_expected/cjs/generated-main2.js000066400000000000000000000002061415504077600323360ustar00rootroot00000000000000'use strict'; var dep = { x: 42 }; function log (x) { if (dep) { console.log(x); } } exports.dep = dep; exports.log = log; rollup-2.61.1/test/chunking-form/samples/entrypoint-aliasing/_expected/cjs/main1alias.js000066400000000000000000000001421415504077600314120ustar00rootroot00000000000000'use strict'; var main2alias = require('./generated-main2.js'); main2alias.log(main2alias.dep); rollup-2.61.1/test/chunking-form/samples/entrypoint-aliasing/_expected/cjs/main2alias.js000066400000000000000000000001451415504077600314160ustar00rootroot00000000000000'use strict'; var main2alias = require('./generated-main2.js'); module.exports = main2alias.log; rollup-2.61.1/test/chunking-form/samples/entrypoint-aliasing/_expected/es/000077500000000000000000000000001415504077600266705ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entrypoint-aliasing/_expected/es/generated-main2.js000066400000000000000000000001601415504077600321650ustar00rootroot00000000000000var dep = { x: 42 }; function log (x) { if (dep) { console.log(x); } } export { dep as d, log as l }; rollup-2.61.1/test/chunking-form/samples/entrypoint-aliasing/_expected/es/main1alias.js000066400000000000000000000001061415504077600312420ustar00rootroot00000000000000import { l as log, d as dep } from './generated-main2.js'; log(dep); rollup-2.61.1/test/chunking-form/samples/entrypoint-aliasing/_expected/es/main2alias.js000066400000000000000000000000651415504077600312470ustar00rootroot00000000000000export { l as default } from './generated-main2.js'; rollup-2.61.1/test/chunking-form/samples/entrypoint-aliasing/_expected/system/000077500000000000000000000000001415504077600276055ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entrypoint-aliasing/_expected/system/generated-main2.js000066400000000000000000000004201415504077600331010ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/entrypoint-aliasing/_expected/system/main1alias.js000066400000000000000000000003441415504077600321630ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/entrypoint-aliasing/_expected/system/main2alias.js000066400000000000000000000003131415504077600321600ustar00rootroot00000000000000System.register(['./generated-main2.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('default', module.l); }], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/entrypoint-aliasing/dep.js000066400000000000000000000000301415504077600254200ustar00rootroot00000000000000export default { x: 42 }rollup-2.61.1/test/chunking-form/samples/entrypoint-aliasing/main1.js000066400000000000000000000001041415504077600256570ustar00rootroot00000000000000import dep from './dep.js'; import log from './main2.js'; log(dep);rollup-2.61.1/test/chunking-form/samples/entrypoint-aliasing/main2.js000066400000000000000000000001451415504077600256650ustar00rootroot00000000000000import dep from './dep.js'; export default function log (x) { if (dep) { console.log(x); } }rollup-2.61.1/test/chunking-form/samples/entrypoint-facade/000077500000000000000000000000001415504077600237355ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entrypoint-facade/_config.js000066400000000000000000000001641415504077600257000ustar00rootroot00000000000000module.exports = { description: 'entry point facade creation', options: { input: ['main1.js', 'main2.js'] } }; rollup-2.61.1/test/chunking-form/samples/entrypoint-facade/_expected/000077500000000000000000000000001415504077600256755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entrypoint-facade/_expected/amd/000077500000000000000000000000001415504077600264365ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entrypoint-facade/_expected/amd/generated-main2.js000066400000000000000000000003061415504077600317350ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var dep = { x: 42 }; function log (x) { if (dep) { console.log(x); } } exports.dep = dep; exports.log = log; })); rollup-2.61.1/test/chunking-form/samples/entrypoint-facade/_expected/amd/main1.js000066400000000000000000000001361415504077600300010ustar00rootroot00000000000000define(['./generated-main2'], (function (main2) { 'use strict'; main2.log(main2.dep); })); rollup-2.61.1/test/chunking-form/samples/entrypoint-facade/_expected/amd/main2.js000066400000000000000000000001341415504077600300000ustar00rootroot00000000000000define(['./generated-main2'], (function (main2) { 'use strict'; return main2.log; })); rollup-2.61.1/test/chunking-form/samples/entrypoint-facade/_expected/cjs/000077500000000000000000000000001415504077600264545ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entrypoint-facade/_expected/cjs/generated-main2.js000066400000000000000000000002061415504077600317520ustar00rootroot00000000000000'use strict'; var dep = { x: 42 }; function log (x) { if (dep) { console.log(x); } } exports.dep = dep; exports.log = log; rollup-2.61.1/test/chunking-form/samples/entrypoint-facade/_expected/cjs/main1.js000066400000000000000000000001231415504077600300130ustar00rootroot00000000000000'use strict'; var main2 = require('./generated-main2.js'); main2.log(main2.dep); rollup-2.61.1/test/chunking-form/samples/entrypoint-facade/_expected/cjs/main2.js000066400000000000000000000001331415504077600300150ustar00rootroot00000000000000'use strict'; var main2 = require('./generated-main2.js'); module.exports = main2.log; rollup-2.61.1/test/chunking-form/samples/entrypoint-facade/_expected/es/000077500000000000000000000000001415504077600263045ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entrypoint-facade/_expected/es/generated-main2.js000066400000000000000000000001601415504077600316010ustar00rootroot00000000000000var dep = { x: 42 }; function log (x) { if (dep) { console.log(x); } } export { dep as d, log as l }; rollup-2.61.1/test/chunking-form/samples/entrypoint-facade/_expected/es/main1.js000066400000000000000000000001061415504077600276440ustar00rootroot00000000000000import { l as log, d as dep } from './generated-main2.js'; log(dep); rollup-2.61.1/test/chunking-form/samples/entrypoint-facade/_expected/es/main2.js000066400000000000000000000000651415504077600276510ustar00rootroot00000000000000export { l as default } from './generated-main2.js'; rollup-2.61.1/test/chunking-form/samples/entrypoint-facade/_expected/system/000077500000000000000000000000001415504077600272215ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/entrypoint-facade/_expected/system/generated-main2.js000066400000000000000000000004201415504077600325150ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/entrypoint-facade/_expected/system/main1.js000066400000000000000000000003441415504077600305650ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/entrypoint-facade/_expected/system/main2.js000066400000000000000000000003131415504077600305620ustar00rootroot00000000000000System.register(['./generated-main2.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('default', module.l); }], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/entrypoint-facade/dep.js000066400000000000000000000000301415504077600250340ustar00rootroot00000000000000export default { x: 42 }rollup-2.61.1/test/chunking-form/samples/entrypoint-facade/main1.js000066400000000000000000000001041415504077600252730ustar00rootroot00000000000000import dep from './dep.js'; import log from './main2.js'; log(dep);rollup-2.61.1/test/chunking-form/samples/entrypoint-facade/main2.js000066400000000000000000000001451415504077600253010ustar00rootroot00000000000000import dep from './dep.js'; export default function log (x) { if (dep) { console.log(x); } }rollup-2.61.1/test/chunking-form/samples/export-default-from-entry/000077500000000000000000000000001415504077600253645ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/export-default-from-entry/_config.js000066400000000000000000000002011415504077600273170ustar00rootroot00000000000000module.exports = { description: 'correctly imports the default from an entry point', options: { input: ['main', 'dep'] } }; rollup-2.61.1/test/chunking-form/samples/export-default-from-entry/_expected/000077500000000000000000000000001415504077600273245ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/export-default-from-entry/_expected/amd/000077500000000000000000000000001415504077600300655ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/export-default-from-entry/_expected/amd/dep.js000066400000000000000000000001101415504077600311630ustar00rootroot00000000000000define((function () { 'use strict'; var dep = 42; return dep; })); rollup-2.61.1/test/chunking-form/samples/export-default-from-entry/_expected/amd/main.js000066400000000000000000000002461415504077600313510ustar00rootroot00000000000000define(['exports', './dep'], (function (exports, dep) { 'use strict'; exports.value = dep; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/export-default-from-entry/_expected/cjs/000077500000000000000000000000001415504077600301035ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/export-default-from-entry/_expected/cjs/dep.js000066400000000000000000000000641415504077600312110ustar00rootroot00000000000000'use strict'; var dep = 42; module.exports = dep; rollup-2.61.1/test/chunking-form/samples/export-default-from-entry/_expected/cjs/main.js000066400000000000000000000002061415504077600313630ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var dep = require('./dep.js'); exports.value = dep; rollup-2.61.1/test/chunking-form/samples/export-default-from-entry/_expected/es/000077500000000000000000000000001415504077600277335ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/export-default-from-entry/_expected/es/dep.js000066400000000000000000000000521415504077600310360ustar00rootroot00000000000000var dep = 42; export { dep as default }; rollup-2.61.1/test/chunking-form/samples/export-default-from-entry/_expected/es/main.js000066400000000000000000000000551415504077600312150ustar00rootroot00000000000000export { default as value } from './dep.js'; rollup-2.61.1/test/chunking-form/samples/export-default-from-entry/_expected/system/000077500000000000000000000000001415504077600306505ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/export-default-from-entry/_expected/system/dep.js000066400000000000000000000002221415504077600317520ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var dep = exports('default', 42); }) }; })); rollup-2.61.1/test/chunking-form/samples/export-default-from-entry/_expected/system/main.js000066400000000000000000000003061415504077600321310ustar00rootroot00000000000000System.register(['./dep.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('value', module["default"]); }], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/export-default-from-entry/dep.js000066400000000000000000000000231415504077600264650ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/export-default-from-entry/main.js000066400000000000000000000000501415504077600266410ustar00rootroot00000000000000export {default as value} from './dep'; rollup-2.61.1/test/chunking-form/samples/external-imports/000077500000000000000000000000001415504077600236365ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/external-imports/_config.js000066400000000000000000000003551415504077600256030ustar00rootroot00000000000000module.exports = { 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'] } }; rollup-2.61.1/test/chunking-form/samples/external-imports/_expected/000077500000000000000000000000001415504077600255765ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/external-imports/_expected/amd/000077500000000000000000000000001415504077600263375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/external-imports/_expected/amd/main-default.js000066400000000000000000000011731415504077600312450ustar00rootroot00000000000000define(['external-all', 'external-default', 'external-default-named', 'external-default-namespace'], (function (foo, bar, baz, quux) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var foo__default = /*#__PURE__*/_interopDefaultLegacy(foo); var bar__default = /*#__PURE__*/_interopDefaultLegacy(bar); var baz__default = /*#__PURE__*/_interopDefaultLegacy(baz); var quux__default = /*#__PURE__*/_interopDefaultLegacy(quux); console.log(foo__default["default"], bar__default["default"], baz__default["default"], quux__default["default"]); })); rollup-2.61.1/test/chunking-form/samples/external-imports/_expected/amd/main-named.js000066400000000000000000000003401415504077600307000ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/external-imports/_expected/amd/main-namespace.js000066400000000000000000000016141415504077600315550ustar00rootroot00000000000000define(['external-all', 'external-namespace', 'external-default-namespace', 'external-named-namespace'], (function (foo, bar, quux, quux$1) { 'use strict'; 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 foo__namespace = /*#__PURE__*/_interopNamespace(foo); var bar__namespace = /*#__PURE__*/_interopNamespace(bar); var quux__namespace = /*#__PURE__*/_interopNamespace(quux); var quux__namespace$1 = /*#__PURE__*/_interopNamespace(quux$1); console.log(foo__namespace, bar__namespace, quux__namespace, quux__namespace$1); })); rollup-2.61.1/test/chunking-form/samples/external-imports/_expected/cjs/000077500000000000000000000000001415504077600263555ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/external-imports/_expected/cjs/main-default.js000066400000000000000000000012221415504077600312560ustar00rootroot00000000000000'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 _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var foo__default = /*#__PURE__*/_interopDefaultLegacy(foo); var bar__default = /*#__PURE__*/_interopDefaultLegacy(bar); var baz__default = /*#__PURE__*/_interopDefaultLegacy(baz); var quux__default = /*#__PURE__*/_interopDefaultLegacy(quux); console.log(foo__default["default"], bar__default["default"], baz__default["default"], quux__default["default"]); rollup-2.61.1/test/chunking-form/samples/external-imports/_expected/cjs/main-named.js000066400000000000000000000003741415504077600307250ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/external-imports/_expected/cjs/main-namespace.js000066400000000000000000000016231415504077600315730ustar00rootroot00000000000000'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 _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 foo__namespace = /*#__PURE__*/_interopNamespace(foo); var bar__namespace = /*#__PURE__*/_interopNamespace(bar); var quux__namespace = /*#__PURE__*/_interopNamespace(quux); var quux__namespace$1 = /*#__PURE__*/_interopNamespace(quux$1); console.log(foo__namespace, bar__namespace, quux__namespace, quux__namespace$1); rollup-2.61.1/test/chunking-form/samples/external-imports/_expected/es/000077500000000000000000000000001415504077600262055ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/external-imports/_expected/es/main-default.js000066400000000000000000000003441415504077600311120ustar00rootroot00000000000000import 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-2.61.1/test/chunking-form/samples/external-imports/_expected/es/main-named.js000066400000000000000000000003141415504077600305470ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/external-imports/_expected/es/main-namespace.js000066400000000000000000000003361415504077600314230ustar00rootroot00000000000000import * 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-2.61.1/test/chunking-form/samples/external-imports/_expected/system/000077500000000000000000000000001415504077600271225ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/external-imports/_expected/system/main-default.js000066400000000000000000000010271415504077600320260ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/external-imports/_expected/system/main-named.js000066400000000000000000000007021415504077600314650ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/external-imports/_expected/system/main-namespace.js000066400000000000000000000007021415504077600323350ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/external-imports/main-default.js000066400000000000000000000002771415504077600265500ustar00rootroot00000000000000import 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-2.61.1/test/chunking-form/samples/external-imports/main-named.js000066400000000000000000000003131415504077600261770ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/external-imports/main-namespace.js000066400000000000000000000003271415504077600270540ustar00rootroot00000000000000import * 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-2.61.1/test/chunking-form/samples/external-reexports/000077500000000000000000000000001415504077600241745ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/external-reexports/_config.js000066400000000000000000000003571415504077600261430ustar00rootroot00000000000000module.exports = { 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'] } }; rollup-2.61.1/test/chunking-form/samples/external-reexports/_expected/000077500000000000000000000000001415504077600261345ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/external-reexports/_expected/amd/000077500000000000000000000000001415504077600266755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/external-reexports/_expected/amd/main-default.js000066400000000000000000000024511415504077600316030ustar00rootroot00000000000000define(['exports', 'external-all', 'external-default', 'external-default-named', 'external-default-namespace'], (function (exports, externalAll, externalDefault, externalDefaultNamed, externalDefaultNamespace) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var externalAll__default = /*#__PURE__*/_interopDefaultLegacy(externalAll); var externalDefault__default = /*#__PURE__*/_interopDefaultLegacy(externalDefault); var externalDefaultNamed__default = /*#__PURE__*/_interopDefaultLegacy(externalDefaultNamed); var externalDefaultNamespace__default = /*#__PURE__*/_interopDefaultLegacy(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"]; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/external-reexports/_expected/amd/main-named.js000066400000000000000000000014001415504077600312340ustar00rootroot00000000000000define(['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; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/external-reexports/_expected/amd/main-namespace.js000066400000000000000000000025651415504077600321210ustar00rootroot00000000000000define(['exports', 'external-all', 'external-namespace', 'external-default-namespace', 'external-named-namespace'], (function (exports, externalAll, externalNamespace$1, externalDefaultNamespace, externalNamedNamespace) { 'use strict'; 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 externalAll__namespace = /*#__PURE__*/_interopNamespace(externalAll); var externalNamespace__namespace = /*#__PURE__*/_interopNamespace(externalNamespace$1); var externalDefaultNamespace__namespace = /*#__PURE__*/_interopNamespace(externalDefaultNamespace); var externalNamedNamespace__namespace = /*#__PURE__*/_interopNamespace(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/external-reexports/_expected/cjs/000077500000000000000000000000001415504077600267135ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/external-reexports/_expected/cjs/main-default.js000066400000000000000000000024341415504077600316220ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var externalAll = require('external-all'); var externalDefault = require('external-default'); var externalDefaultNamed = require('external-default-named'); var externalDefaultNamespace = require('external-default-namespace'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var externalAll__default = /*#__PURE__*/_interopDefaultLegacy(externalAll); var externalDefault__default = /*#__PURE__*/_interopDefaultLegacy(externalDefault); var externalDefaultNamed__default = /*#__PURE__*/_interopDefaultLegacy(externalDefaultNamed); var externalDefaultNamespace__default = /*#__PURE__*/_interopDefaultLegacy(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-2.61.1/test/chunking-form/samples/external-reexports/_expected/cjs/main-named.js000066400000000000000000000013701415504077600312600ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/chunking-form/samples/external-reexports/_expected/cjs/main-namespace.js000066400000000000000000000025411415504077600321310ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var externalAll = require('external-all'); var externalNamespace$1 = require('external-namespace'); var externalDefaultNamespace = require('external-default-namespace'); var externalNamedNamespace = require('external-named-namespace'); 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 externalAll__namespace = /*#__PURE__*/_interopNamespace(externalAll); var externalNamespace__namespace = /*#__PURE__*/_interopNamespace(externalNamespace$1); var externalDefaultNamespace__namespace = /*#__PURE__*/_interopNamespace(externalDefaultNamespace); var externalNamedNamespace__namespace = /*#__PURE__*/_interopNamespace(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-2.61.1/test/chunking-form/samples/external-reexports/_expected/es/000077500000000000000000000000001415504077600265435ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/external-reexports/_expected/es/main-default.js000066400000000000000000000003311415504077600314440ustar00rootroot00000000000000export { 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-2.61.1/test/chunking-form/samples/external-reexports/_expected/es/main-named.js000066400000000000000000000002511415504077600311050ustar00rootroot00000000000000export { foo } from 'external-all'; export { bar } from 'external-named'; export { baz } from 'external-default-named'; export { quux } from 'external-named-namespace'; rollup-2.61.1/test/chunking-form/samples/external-reexports/_expected/es/main-namespace.js000066400000000000000000000010071415504077600317550ustar00rootroot00000000000000import * 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-2.61.1/test/chunking-form/samples/external-reexports/_expected/system/000077500000000000000000000000001415504077600274605ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/external-reexports/_expected/system/main-default.js000066400000000000000000000007221415504077600323650ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/external-reexports/_expected/system/main-named.js000066400000000000000000000006631415504077600320310ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/external-reexports/_expected/system/main-namespace.js000066400000000000000000000010471415504077600326760ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/external-reexports/main-default.js000066400000000000000000000003311415504077600270750ustar00rootroot00000000000000export { 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-2.61.1/test/chunking-form/samples/external-reexports/main-named.js000066400000000000000000000002511415504077600265360ustar00rootroot00000000000000export { foo } from 'external-all'; export { bar } from 'external-named'; export { baz } from 'external-default-named'; export { quux } from 'external-named-namespace'; rollup-2.61.1/test/chunking-form/samples/external-reexports/main-namespace.js000066400000000000000000000004531415504077600274120ustar00rootroot00000000000000export * 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-2.61.1/test/chunking-form/samples/filenames-patterns/000077500000000000000000000000001415504077600241225ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/filenames-patterns/_config.js000066400000000000000000000003551415504077600260670ustar00rootroot00000000000000module.exports = { description: 'filenames custom pattern', options: { input: ['main1.js', 'main2.js'], output: { entryFileNames: 'entry-[name]-[hash]-[format].js', chunkFileNames: 'chunk-[name]-[hash]-[format].js' } } }; rollup-2.61.1/test/chunking-form/samples/filenames-patterns/_expected/000077500000000000000000000000001415504077600260625ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/filenames-patterns/_expected/amd/000077500000000000000000000000001415504077600266235ustar00rootroot00000000000000chunk-main2-6a714ad3-amd.js000066400000000000000000000003061415504077600331040ustar00rootroot00000000000000rollup-2.61.1/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-f47d0370-amd.js000066400000000000000000000001471415504077600330630ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/filenames-patterns/_expected/amddefine(['./chunk-main2-6a714ad3-amd'], (function (main2) { 'use strict'; main2.log(main2.dep); })); entry-main2-4db8cd0c-amd.js000066400000000000000000000001451415504077600332770ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/filenames-patterns/_expected/amddefine(['./chunk-main2-6a714ad3-amd'], (function (main2) { 'use strict'; return main2.log; })); rollup-2.61.1/test/chunking-form/samples/filenames-patterns/_expected/cjs/000077500000000000000000000000001415504077600266415ustar00rootroot00000000000000chunk-main2-397efa8f-cjs.js000066400000000000000000000002061415504077600332410ustar00rootroot00000000000000rollup-2.61.1/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-5358eeba-cjs.js000066400000000000000000000001341415504077600332560ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/filenames-patterns/_expected/cjs'use strict'; var main2 = require('./chunk-main2-397efa8f-cjs.js'); main2.log(main2.dep); entry-main2-6a001c26-cjs.js000066400000000000000000000001441415504077600331010ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/filenames-patterns/_expected/cjs'use strict'; var main2 = require('./chunk-main2-397efa8f-cjs.js'); module.exports = main2.log; rollup-2.61.1/test/chunking-form/samples/filenames-patterns/_expected/es/000077500000000000000000000000001415504077600264715ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/filenames-patterns/_expected/es/chunk-main2-bb2aced4-es.js000066400000000000000000000001601415504077600331110ustar00rootroot00000000000000var dep = { x: 42 }; function log (x) { if (dep) { console.log(x); } } export { dep as d, log as l }; rollup-2.61.1/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main1-352fcfce-es.js000066400000000000000000000001161415504077600330740ustar00rootroot00000000000000import { l as log, d as dep } from './chunk-main2-bb2aced4-es.js'; log(dep); rollup-2.61.1/test/chunking-form/samples/filenames-patterns/_expected/es/entry-main2-8ebb5d84-es.js000066400000000000000000000000751415504077600330260ustar00rootroot00000000000000export { l as default } from './chunk-main2-bb2aced4-es.js'; rollup-2.61.1/test/chunking-form/samples/filenames-patterns/_expected/system/000077500000000000000000000000001415504077600274065ustar00rootroot00000000000000chunk-main2-97f5caac-system.js000066400000000000000000000004201415504077600346170ustar00rootroot00000000000000rollup-2.61.1/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-e6585a3e-system.js000066400000000000000000000003601415504077600345150ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/filenames-patterns/_expected/systemSystem.register(['./chunk-main2-97f5caac-system.js'], (function () { 'use strict'; var log, dep; return { setters: [function (module) { log = module.l; dep = module.d; }], execute: (function () { log(dep); }) }; })); entry-main2-2e964c97-system.js000066400000000000000000000003271415504077600344500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/filenames-patterns/_expected/systemSystem.register(['./chunk-main2-97f5caac-system.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('default', module.l); }], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/filenames-patterns/dep.js000066400000000000000000000000301415504077600252210ustar00rootroot00000000000000export default { x: 42 }rollup-2.61.1/test/chunking-form/samples/filenames-patterns/main1.js000066400000000000000000000001041415504077600254600ustar00rootroot00000000000000import dep from './dep.js'; import log from './main2.js'; log(dep);rollup-2.61.1/test/chunking-form/samples/filenames-patterns/main2.js000066400000000000000000000001451415504077600254660ustar00rootroot00000000000000import dep from './dep.js'; export default function log (x) { if (dep) { console.log(x); } }rollup-2.61.1/test/chunking-form/samples/generated-code/000077500000000000000000000000001415504077600231675ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-false/000077500000000000000000000000001415504077600274175ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-false/_config.js000066400000000000000000000002531415504077600313610ustar00rootroot00000000000000module.exports = { description: 'does not use arrow functions', options: { input: ['main', 'main2'], output: { generatedCode: { arrowFunctions: false } } } }; rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/000077500000000000000000000000001415504077600313575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/amd/000077500000000000000000000000001415504077600321205ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000005051415504077600351640ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/amd/main.js000066400000000000000000000001471415504077600334040ustar00rootroot00000000000000define(['./generated-dep1'], (function (dep1) { 'use strict'; console.log(dep1.foo, dep1.bar); })); rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/amd/main2.js000066400000000000000000000003251415504077600334640ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/cjs/000077500000000000000000000000001415504077600321365ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000004131415504077600352000ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/cjs/main.js000066400000000000000000000001341415504077600334160ustar00rootroot00000000000000'use strict'; var dep1 = require('./generated-dep1.js'); console.log(dep1.foo, dep1.bar); rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/cjs/main2.js000066400000000000000000000002271415504077600335030ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-dep1.js'); }).then(function (n) { return n.dep1; }).then(console.log); rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/es/000077500000000000000000000000001415504077600317665ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000003531415504077600350330ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/es/main.js000066400000000000000000000001221415504077600332430ustar00rootroot00000000000000import { f as foo, b as bar } from './generated-dep1.js'; console.log(foo, bar); rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/es/main2.js000066400000000000000000000001241415504077600333270ustar00rootroot00000000000000import('./generated-dep1.js').then(function (n) { return n.d; }).then(console.log); rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-false/_expected/system/000077500000000000000000000000001415504077600327035ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000005651415504077600357550ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003601415504077600341050ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003231415504077600341660ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-false/dep1.js000066400000000000000000000001021415504077600305770ustar00rootroot00000000000000import { foo } from './dep2.js'; export const bar = 'dep1' + foo; rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-false/dep2.js000066400000000000000000000001021415504077600306000ustar00rootroot00000000000000export const foo = 'dep2'; import('./dep1.js').then(console.log); rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-false/main.js000066400000000000000000000001321415504077600306750ustar00rootroot00000000000000import { bar } from './dep1.js'; import { foo } from './dep2.js'; console.log(foo, bar); rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-false/main2.js000066400000000000000000000000471415504077600307640ustar00rootroot00000000000000import('./dep1.js').then(console.log); rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-true/000077500000000000000000000000001415504077600273045ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-true/_config.js000066400000000000000000000002421415504077600312440ustar00rootroot00000000000000module.exports = { description: 'uses arrow functions', options: { input: ['main', 'main2'], output: { generatedCode: { arrowFunctions: true } } } }; rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/000077500000000000000000000000001415504077600312445ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/amd/000077500000000000000000000000001415504077600320055ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000004631415504077600350540ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/amd/main.js000066400000000000000000000001471415504077600332710ustar00rootroot00000000000000define(['./generated-dep1'], (function (dep1) { 'use strict'; console.log(dep1.foo, dep1.bar); })); rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/amd/main2.js000066400000000000000000000002661415504077600333550ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise((resolve, reject) => require(['./generated-dep1'], resolve, reject)).then(n => n.dep1).then(console.log); })); rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/cjs/000077500000000000000000000000001415504077600320235ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000003711415504077600350700ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/cjs/main.js000066400000000000000000000001341415504077600333030ustar00rootroot00000000000000'use strict'; var dep1 = require('./generated-dep1.js'); console.log(dep1.foo, dep1.bar); rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/cjs/main2.js000066400000000000000000000001611415504077600333650ustar00rootroot00000000000000'use strict'; Promise.resolve().then(() => require('./generated-dep1.js')).then(n => n.dep1).then(console.log); rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/es/000077500000000000000000000000001415504077600316535ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000003311415504077600347140ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/es/main.js000066400000000000000000000001221415504077600331300ustar00rootroot00000000000000import { f as foo, b as bar } from './generated-dep1.js'; console.log(foo, bar); rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/es/main2.js000066400000000000000000000001001415504077600332060ustar00rootroot00000000000000import('./generated-dep1.js').then(n => n.d).then(console.log); rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-true/_expected/system/000077500000000000000000000000001415504077600325705ustar00rootroot00000000000000generated-dep1.js000066400000000000000000000005431415504077600356360ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003501415504077600337710ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002771415504077600340630ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-true/dep1.js000066400000000000000000000001021415504077600304640ustar00rootroot00000000000000import { foo } from './dep2.js'; export const bar = 'dep1' + foo; rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-true/dep2.js000066400000000000000000000001021415504077600304650ustar00rootroot00000000000000export const foo = 'dep2'; import('./dep1.js').then(console.log); rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-true/main.js000066400000000000000000000001321415504077600305620ustar00rootroot00000000000000import { bar } from './dep1.js'; import { foo } from './dep2.js'; console.log(foo, bar); rollup-2.61.1/test/chunking-form/samples/generated-code/arrow-functions-true/main2.js000066400000000000000000000000471415504077600306510ustar00rootroot00000000000000import('./dep1.js').then(console.log); rollup-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-false/000077500000000000000000000000001415504077600307415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_config.js000066400000000000000000000003731415504077600327060ustar00rootroot00000000000000module.exports = { description: 'escapes reserved names used as props', options: { input: ['main', 'main2'], external: ['external'], output: { exports: 'named', generatedCode: { reservedNamesAsProps: false }, name: 'bundle' } } }; rollup-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_expected/000077500000000000000000000000001415504077600327015ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_expected/amd/000077500000000000000000000000001415504077600334425ustar00rootroot00000000000000main.js000066400000000000000000000002651415504077600346500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_expected/amddefine(['exports', './main2'], (function (exports, main2) { 'use strict'; exports.foo = main2["default"]; Object.defineProperty(exports, '__esModule', { value: true }); })); main2.js000066400000000000000000000002571415504077600347330ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_expected/cjs/000077500000000000000000000000001415504077600334605ustar00rootroot00000000000000main.js000066400000000000000000000002251415504077600346620ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var main2 = require('./main2.js'); exports.foo = main2["default"]; main2.js000066400000000000000000000001741415504077600347470ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_expected/es/000077500000000000000000000000001415504077600333105ustar00rootroot00000000000000main.js000066400000000000000000000000551415504077600345130ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_expected/esexport { default as foo } from './main2.js'; main2.js000066400000000000000000000000561415504077600345760ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_expected/esvar main2 = 42; export { main2 as default }; system/000077500000000000000000000000001415504077600341465ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-false/_expectedmain.js000066400000000000000000000003201415504077600354230ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002361415504077600355130ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-false/main.js000066400000000000000000000000551415504077600322230ustar00rootroot00000000000000export { default as foo } from './main2.js'; rollup-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-false/main2.js000066400000000000000000000000231415504077600323000ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-true/000077500000000000000000000000001415504077600306265ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_config.js000066400000000000000000000003721415504077600325720ustar00rootroot00000000000000module.exports = { description: 'escapes reserved names used as props', options: { input: ['main', 'main2'], external: ['external'], output: { exports: 'named', generatedCode: { reservedNamesAsProps: true }, name: 'bundle' } } }; rollup-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_expected/000077500000000000000000000000001415504077600325665ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_expected/amd/000077500000000000000000000000001415504077600333275ustar00rootroot00000000000000main.js000066400000000000000000000002621415504077600345320ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_expected/amddefine(['exports', './main2'], (function (exports, main2) { 'use strict'; exports.foo = main2.default; Object.defineProperty(exports, '__esModule', { value: true }); })); main2.js000066400000000000000000000002541415504077600346150ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_expected/cjs/000077500000000000000000000000001415504077600333455ustar00rootroot00000000000000main.js000066400000000000000000000002221415504077600345440ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var main2 = require('./main2.js'); exports.foo = main2.default; main2.js000066400000000000000000000001711415504077600346310ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_expected/es/000077500000000000000000000000001415504077600331755ustar00rootroot00000000000000main.js000066400000000000000000000000551415504077600344000ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_expected/esexport { default as foo } from './main2.js'; main2.js000066400000000000000000000000561415504077600344630ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_expected/esvar main2 = 42; export { main2 as default }; system/000077500000000000000000000000001415504077600340335ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-true/_expectedmain.js000066400000000000000000000003151415504077600353140ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002361415504077600354000ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-true/main.js000066400000000000000000000000551415504077600321100ustar00rootroot00000000000000export { default as foo } from './main2.js'; rollup-2.61.1/test/chunking-form/samples/generated-code/reserved-names-as-props-true/main2.js000066400000000000000000000000231415504077600321650ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/000077500000000000000000000000001415504077600245575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/000077500000000000000000000000001415504077600317075ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_config.js000066400000000000000000000005301415504077600336470ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expected/000077500000000000000000000000001415504077600336475ustar00rootroot00000000000000amd/000077500000000000000000000000001415504077600343315ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expectedgenerated-dep.js000066400000000000000000000001001415504077600373620ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expected/amddefine((function () { 'use strict'; console.log('dep'); })); main.js000066400000000000000000000000541415504077600356120ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expected/amddefine((function () { 'use strict'; })); cjs/000077500000000000000000000000001415504077600343475ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expectedgenerated-dep.js000066400000000000000000000000431415504077600374060ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expected/cjs'use strict'; console.log('dep'); main.js000066400000000000000000000000171415504077600356270ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expected/cjs'use strict'; es/000077500000000000000000000000001415504077600341775ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expectedgenerated-dep.js000066400000000000000000000000241415504077600372350ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expected/esconsole.log('dep'); main.js000066400000000000000000000000011415504077600354500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expected/es system/000077500000000000000000000000001415504077600351145ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expectedgenerated-dep.js000066400000000000000000000001751415504077600401610ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('dep'); }) }; })); main.js000066400000000000000000000001471415504077600364000ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/dep.js000066400000000000000000000000241415504077600330110ustar00rootroot00000000000000console.log('dep'); rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/dependant-entry-no-effects/main.js000066400000000000000000000000001415504077600331570ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/000077500000000000000000000000001415504077600334725ustar00rootroot00000000000000_config.js000066400000000000000000000112621415504077600353570ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entryconst assert = require('assert'); const path = require('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 = { 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))), { 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", dynamicallyImportedIds: [], dynamicImporters: [], hasModuleSideEffects: true, id: ID_MAIN, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIds: [ID_LIB], importers: [], isEntry: true, isExternal: false, meta: {}, syntheticNamedExports: false }); assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(ID_DEP))), { 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", dynamicallyImportedIds: [], dynamicImporters: [], hasModuleSideEffects: true, id: ID_DEP, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIds: [ID_LIB], importers: [], isEntry: true, isExternal: false, 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/000077500000000000000000000000001415504077600353535ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entryamd/000077500000000000000000000000001415504077600361145ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expectedgenerated-dep.js000066400000000000000000000001341415504077600411540ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expected/amddefine(['./generated-lib'], (function (lib) { 'use strict'; console.log(lib.value); })); generated-lib.js000066400000000000000000000001531415504077600411530ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value = 42; exports.value = value; })); main.js000066400000000000000000000001341415504077600373740ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expected/amddefine(['./generated-lib'], (function (lib) { 'use strict'; console.log(lib.value); })); cjs/000077500000000000000000000000001415504077600361325ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expectedgenerated-dep.js000066400000000000000000000001211415504077600411660ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000711415504077600411700ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expected/cjs'use strict'; const value = 42; exports.value = value; main.js000066400000000000000000000001211415504077600374060ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600357625ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expectedgenerated-dep.js000066400000000000000000000001061415504077600410210ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expected/esimport { v as value } from './generated-lib.js'; console.log(value); generated-lib.js000066400000000000000000000000521415504077600410170ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expected/esconst value = 42; export { value as v }; main.js000066400000000000000000000001061415504077600372410ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expected/esimport { v as value } from './generated-lib.js'; console.log(value); system/000077500000000000000000000000001415504077600366775ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entry/_expectedgenerated-dep.js000066400000000000000000000003301415504077600417350ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002201415504077600417310ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003301415504077600401550ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000631415504077600345200ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entryimport { value } from './lib'; console.log(value); lib.js000066400000000000000000000000311415504077600345110ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entryexport const value = 42; main.js000066400000000000000000000000631415504077600346740ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-emitted-entryimport { value } from './lib'; console.log(value); rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/000077500000000000000000000000001415504077600320415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_config.js000066400000000000000000000110751415504077600340070ustar00rootroot00000000000000const assert = require('assert'); const path = require('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 = { 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))), { 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", dynamicallyImportedIds: [], dynamicImporters: [], hasModuleSideEffects: true, id: ID_MAIN, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIds: [ID_LIB], importers: [], isEntry: true, isExternal: false, meta: {}, syntheticNamedExports: false }); assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(ID_DEP))), { 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", dynamicallyImportedIds: [], dynamicImporters: [], hasModuleSideEffects: true, id: ID_DEP, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIds: [ID_LIB], importers: [], isEntry: true, isExternal: false, 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-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expected/000077500000000000000000000000001415504077600340015ustar00rootroot00000000000000amd/000077500000000000000000000000001415504077600344635ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expecteddep.js000066400000000000000000000001341415504077600355670ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expected/amddefine(['./generated-lib'], (function (lib) { 'use strict'; console.log(lib.value); })); generated-lib.js000066400000000000000000000001531415504077600375220ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value = 42; exports.value = value; })); main.js000066400000000000000000000001341415504077600357430ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expected/amddefine(['./generated-lib'], (function (lib) { 'use strict'; console.log(lib.value); })); cjs/000077500000000000000000000000001415504077600345015ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expecteddep.js000066400000000000000000000001211415504077600356010ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000711415504077600375370ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expected/cjs'use strict'; const value = 42; exports.value = value; main.js000066400000000000000000000001211415504077600357550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expected/cjs'use strict'; var lib = require('./generated-lib.js'); console.log(lib.value); es/000077500000000000000000000000001415504077600343315ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expecteddep.js000066400000000000000000000001061415504077600354340ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expected/esimport { v as value } from './generated-lib.js'; console.log(value); generated-lib.js000066400000000000000000000000521415504077600373660ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expected/esconst value = 42; export { value as v }; main.js000066400000000000000000000001061415504077600356100ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expected/esimport { v as value } from './generated-lib.js'; console.log(value); system/000077500000000000000000000000001415504077600352465ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/_expecteddep.js000066400000000000000000000003301415504077600363500ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002201415504077600403000ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003301415504077600365240ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/dep.js000066400000000000000000000000631415504077600331460ustar00rootroot00000000000000import { value } from './lib'; console.log(value); rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/lib.js000066400000000000000000000000311415504077600331370ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/implicitly-dependent-entry/main.js000066400000000000000000000000631415504077600333220ustar00rootroot00000000000000import { value } from './lib'; console.log(value); rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/000077500000000000000000000000001415504077600310365ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_config.js000066400000000000000000000231661415504077600330100ustar00rootroot00000000000000const assert = require('assert'); const path = require('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 = { 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))), { 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", dynamicallyImportedIds: [], dynamicImporters: [], hasModuleSideEffects: true, id: ID_MAIN1, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [ID_DEP], importedIds: [ID_LIB1, ID_LIB1B, ID_LIB2], importers: [], isEntry: true, isExternal: false, meta: {}, syntheticNamedExports: false }); assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(ID_MAIN2))), { 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", dynamicallyImportedIds: [], dynamicImporters: [], hasModuleSideEffects: true, id: ID_MAIN2, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [ID_DEP], importedIds: [ID_LIB1, ID_LIB1B, ID_LIB3], importers: [], isEntry: true, isExternal: false, meta: {}, syntheticNamedExports: false }); assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(ID_DEP))), { 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", dynamicallyImportedIds: [], dynamicImporters: [], hasModuleSideEffects: true, id: ID_DEP, implicitlyLoadedAfterOneOf: [ID_MAIN1, ID_MAIN2], implicitlyLoadedBefore: [], importedIds: [ID_LIB1, ID_LIB2, ID_LIB3], importers: [], isEntry: false, isExternal: false, meta: {}, syntheticNamedExports: false }); } } } }; rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/000077500000000000000000000000001415504077600327765ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/amd/000077500000000000000000000000001415504077600335375ustar00rootroot00000000000000generated-dep.js000066400000000000000000000002531415504077600365220ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002351415504077600367430ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001541415504077600366020ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const lib2 = 'lib2'; exports.lib2 = lib2; })); generated-lib3.js000066400000000000000000000001541415504077600366030ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const lib3 = 'lib3'; exports.lib3 = lib3; })); main1.js000066400000000000000000000002351415504077600350230ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002341415504077600350230ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/cjs/000077500000000000000000000000001415504077600335555ustar00rootroot00000000000000generated-dep.js000066400000000000000000000003021415504077600365330ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001511415504077600367560ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000721415504077600366170ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/cjs'use strict'; const lib2 = 'lib2'; exports.lib2 = lib2; generated-lib3.js000066400000000000000000000000721415504077600366200ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/cjs'use strict'; const lib3 = 'lib3'; exports.lib3 = lib3; main1.js000066400000000000000000000002431415504077600350400ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002421415504077600350400ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/es/000077500000000000000000000000001415504077600334055ustar00rootroot00000000000000generated-dep.js000066400000000000000000000002641415504077600363720ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001201415504077600366020ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/esconst lib1 = 'lib1'; const lib1b = 'lib1b'; export { lib1b as a, lib1 as l }; generated-lib2.js000066400000000000000000000000541415504077600364470ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/esconst lib2 = 'lib2'; export { lib2 as l }; generated-lib3.js000066400000000000000000000000541415504077600364500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/esconst lib3 = 'lib3'; export { lib3 as l }; main1.js000066400000000000000000000002321415504077600346660ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002311415504077600346660ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600342435ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expectedgenerated-dep.js000066400000000000000000000005671415504077600373150ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002741415504077600375310ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002231415504077600373620ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002231415504077600373630ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const lib3 = exports('l', 'lib3'); }) }; })); main1.js000066400000000000000000000005241415504077600356070ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000005231415504077600356070ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/dep.js000066400000000000000000000001741415504077600321460ustar00rootroot00000000000000import { lib1 } from './lib1'; import { lib2 } from './lib2'; import { lib3 } from './lib3'; console.log(lib1, lib2, lib3); rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/lib1.js000066400000000000000000000000341415504077600322200ustar00rootroot00000000000000export const lib1 = 'lib1'; rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/lib1b.js000066400000000000000000000000361415504077600323640ustar00rootroot00000000000000export const lib1b = 'lib1b'; rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/lib2.js000066400000000000000000000000341415504077600322210ustar00rootroot00000000000000export const lib2 = 'lib2'; rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/lib3.js000066400000000000000000000000341415504077600322220ustar00rootroot00000000000000export const lib3 = 'lib3'; rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/main1.js000066400000000000000000000002111415504077600323730ustar00rootroot00000000000000import { lib1 } from './lib1'; import { lib1b } from './lib1b'; import { lib2 } from './lib2'; console.log('main1', lib1, lib1b, lib2); rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/multiple-dependencies/main2.js000066400000000000000000000002101415504077600323730ustar00rootroot00000000000000import { lib1 } from './lib1'; import { lib1b } from './lib1b'; import { lib3 } from './lib3'; console.log('main2', lib1, lib1b, lib3); rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/000077500000000000000000000000001415504077600335375ustar00rootroot00000000000000_config.js000066400000000000000000000005041415504077600354210ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extensionmodule.exports = { 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/000077500000000000000000000000001415504077600354205ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extensionamd/000077500000000000000000000000001415504077600361615ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expectedgenerated-dep.js000066400000000000000000000004411415504077600412220ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001341415504077600425260ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expected/amddefine(['./generated-dep'], (function (dep) { 'use strict'; console.log(dep.value); })); main.js000066400000000000000000000001011415504077600374330ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expected/amddefine((function () { 'use strict'; console.log('main'); })); cjs/000077500000000000000000000000001415504077600361775ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expectedgenerated-dep.js000066400000000000000000000003121415504077600412350ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001211415504077600425400ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000441415504077600374570ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expected/cjs'use strict'; console.log('main'); es/000077500000000000000000000000001415504077600360275ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expectedgenerated-dep.js000066400000000000000000000001741415504077600410730ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001061415504077600423730ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expected/esimport { v as value } from './generated-dep.js'; console.log(value); main.js000066400000000000000000000000251415504077600373060ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expected/esconsole.log('main'); system/000077500000000000000000000000001415504077600367445ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expectedgenerated-dep.js000066400000000000000000000004051415504077600420050ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003301415504077600433070ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001761415504077600402320ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extension/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); dep.js000066400000000000000000000001451415504077600345660ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extensionimport { value } from './lib'; console.log(value); import('./dynamicDep'); export const dep = 'dep'; dynamicDep.js000066400000000000000000000000631415504077600360720ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extensionimport { value } from './lib'; console.log(value); lib.js000066400000000000000000000000311415504077600345560ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extensionexport const value = 42; main.js000066400000000000000000000000251415504077600347370ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-allow-extensionconsole.log('main'); rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/000077500000000000000000000000001415504077600315015ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_config.js000066400000000000000000000004701415504077600334440ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expected/000077500000000000000000000000001415504077600334415ustar00rootroot00000000000000amd/000077500000000000000000000000001415504077600341235ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expectedgenerated-dep.js000066400000000000000000000003711415504077600371660ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001341415504077600404700ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expected/amddefine(['./generated-dep'], (function (dep) { 'use strict'; console.log(dep.value); })); main.js000066400000000000000000000001011415504077600353750ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expected/amddefine((function () { 'use strict'; console.log('main'); })); cjs/000077500000000000000000000000001415504077600341415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expectedgenerated-dep.js000066400000000000000000000002441415504077600372030ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001211415504077600405020ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expected/cjs'use strict'; var dep = require('./generated-dep.js'); console.log(dep.value); main.js000066400000000000000000000000441415504077600354210ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expected/cjs'use strict'; console.log('main'); es/000077500000000000000000000000001415504077600337715ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expectedgenerated-dep.js000066400000000000000000000001441415504077600370320ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001061415504077600403350ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expected/esimport { v as value } from './generated-dep.js'; console.log(value); main.js000066400000000000000000000000251415504077600352500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expected/esconsole.log('main'); system/000077500000000000000000000000001415504077600347065ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expectedgenerated-dep.js000066400000000000000000000003371415504077600377530ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003301415504077600412510ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001761415504077600361740ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/dep.js000066400000000000000000000001451415504077600326070ustar00rootroot00000000000000import { value } from './lib'; console.log(value); import('./dynamicDep'); export const dep = 'dep'; dynamicDep.js000066400000000000000000000000631415504077600340340ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-falseimport { value } from './lib'; console.log(value); rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/lib.js000066400000000000000000000000311415504077600325770ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-false/main.js000066400000000000000000000000251415504077600327600ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/000077500000000000000000000000001415504077600317175ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_config.js000066400000000000000000000004731415504077600336650ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/000077500000000000000000000000001415504077600336575ustar00rootroot00000000000000amd/000077500000000000000000000000001415504077600343415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expectedgenerated-dep.js000066400000000000000000000004411415504077600374020ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001611415504077600374630ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001341415504077600407060ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/amddefine(['./generated-dep'], (function (dep) { 'use strict'; console.log(dep.value); })); main.js000066400000000000000000000001011415504077600356130ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/amddefine((function () { 'use strict'; console.log('main'); })); cjs/000077500000000000000000000000001415504077600343575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expectedgenerated-dep.js000066400000000000000000000003121415504077600374150ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001221415504077600374760ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001211415504077600407200ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/cjs'use strict'; var dep = require('./generated-dep.js'); console.log(dep.value); main.js000066400000000000000000000000441415504077600356370ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/cjs'use strict'; console.log('main'); es/000077500000000000000000000000001415504077600342075ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expectedgenerated-dep.js000066400000000000000000000002011415504077600372420ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000571415504077600373350ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/esexport { d as dep } from './generated-dep.js'; generated-dynamicDep.js000066400000000000000000000001061415504077600405530ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/esimport { v as value } from './generated-dep.js'; console.log(value); main.js000066400000000000000000000000251415504077600354660ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/esconsole.log('main'); system/000077500000000000000000000000001415504077600351245ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expectedgenerated-dep.js000066400000000000000000000004031415504077600401630ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003051415504077600402460ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003301415504077600414670ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001761415504077600364120ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/dep.js000066400000000000000000000001451415504077600330250ustar00rootroot00000000000000import { value } from './lib'; console.log(value); import('./dynamicDep'); export const dep = 'dep'; dynamicDep.js000066400000000000000000000000631415504077600342520ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-strictimport { value } from './lib'; console.log(value); rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/lib.js000066400000000000000000000000311415504077600330150ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/preserve-signature-strict/main.js000066400000000000000000000000251415504077600331760ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/000077500000000000000000000000001415504077600307265ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_config.js000066400000000000000000000010141415504077600326640ustar00rootroot00000000000000const assert = require('assert'); let referenceId; module.exports = { 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-2.61.1/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expected/000077500000000000000000000000001415504077600326665ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expected/amd/000077500000000000000000000000001415504077600334275ustar00rootroot00000000000000generated-dep.js000066400000000000000000000001611415504077600364100ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003271415504077600364120ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003011415504077600346240ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expected/cjs/000077500000000000000000000000001415504077600334455ustar00rootroot00000000000000generated-dep.js000066400000000000000000000001221415504077600364230ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002401415504077600364220ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002031415504077600346430ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expected/es/000077500000000000000000000000001415504077600332755ustar00rootroot00000000000000generated-dep.js000066400000000000000000000000571415504077600362620ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expected/esexport { d as dep } from './generated-lib.js'; generated-lib.js000066400000000000000000000002121415504077600362510ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001011415504077600344700ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expected/esimport('./generated-lib.js').then(function (n) { return n.l; }); system/000077500000000000000000000000001415504077600341335ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/_expectedgenerated-dep.js000066400000000000000000000003051415504077600371730ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000004121415504077600371700ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003001415504077600354060ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/dep.js000066400000000000000000000000521415504077600320310ustar00rootroot00000000000000import './lib'; export const dep = 'dep'; rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/lib.js000066400000000000000000000000661415504077600320340ustar00rootroot00000000000000import { dep } from './dep'; console.log('lib', dep); rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/same-chunk-dependency/main.js000066400000000000000000000000211415504077600322010ustar00rootroot00000000000000import('./lib'); rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/000077500000000000000000000000001415504077600327275ustar00rootroot00000000000000_config.js000066400000000000000000000006351415504077600346160ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effectmodule.exports = { 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/000077500000000000000000000000001415504077600346105ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effectamd/000077500000000000000000000000001415504077600353515ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expectedgenerated-button.js000066400000000000000000000002031415504077600411510ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001521415504077600405710ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002511415504077600366310ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const foo = 'foo'; exports.foo = foo; Object.defineProperty(exports, '__esModule', { value: true }); })); cjs/000077500000000000000000000000001415504077600353675ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expectedgenerated-button.js000066400000000000000000000001431415504077600411720ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001131415504077600406040ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001661415504077600366540ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const foo = 'foo'; exports.foo = foo; es/000077500000000000000000000000001415504077600352175ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expectedgenerated-button.js000066400000000000000000000001141415504077600410200ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000411415504077600404340ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expected/esexport { foo } from './main.js'; main.js000066400000000000000000000000441415504077600364770ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expected/esconst foo = 'foo'; export { foo }; system/000077500000000000000000000000001415504077600361345ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/_expectedgenerated-button.js000066400000000000000000000003511415504077600417400ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002761415504077600413630ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002231415504077600374130ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000471415504077600345220ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effectexport { bar } from './shared/button'; core.js000066400000000000000000000000501415504077600341310ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effectexport { foo } from './shared/core.js'; main.js000066400000000000000000000000501415504077600341250ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effectexport { foo } from './shared/core.js'; shared/000077500000000000000000000000001415504077600341165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effectbutton.js000066400000000000000000000001011415504077600357570ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/sharedimport { foo } from './core.js'; export const bar = foo + 'bar'; core.js000066400000000000000000000000321415504077600353770ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-no-side-effect/sharedexport const foo = 'foo'; rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/000077500000000000000000000000001415504077600320075ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_config.js000066400000000000000000000004421415504077600337510ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expected/000077500000000000000000000000001415504077600337475ustar00rootroot00000000000000amd/000077500000000000000000000000001415504077600344315ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expectedgenerated-implicit.js000066400000000000000000000001521415504077600405330ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expected/amddefine(['exports', './main'], (function (exports, main) { 'use strict'; exports.foo = main.foo; })); main.js000066400000000000000000000002541415504077600357140ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const foo = 'shared'; exports.foo = foo; Object.defineProperty(exports, '__esModule', { value: true }); })); cjs/000077500000000000000000000000001415504077600344475ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expectedgenerated-implicit.js000066400000000000000000000001131415504077600405460ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expected/cjs'use strict'; var main = require('./main.js'); exports.foo = main.foo; main.js000066400000000000000000000001711415504077600357300ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const foo = 'shared'; exports.foo = foo; es/000077500000000000000000000000001415504077600342775ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expectedgenerated-implicit.js000066400000000000000000000000411415504077600403760ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expected/esexport { foo } from './main.js'; main.js000066400000000000000000000000471415504077600355620ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expected/esconst foo = 'shared'; export { foo }; system/000077500000000000000000000000001415504077600352145ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/_expectedgenerated-implicit.js000066400000000000000000000002761415504077600413250ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002261415504077600364760ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000351415504077600340760ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexportexport * from './shared.js'; rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/main.js000066400000000000000000000000351415504077600332670ustar00rootroot00000000000000export * from './shared.js'; rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/shared-dependency-reexport/shared.js000066400000000000000000000000351415504077600336110ustar00rootroot00000000000000export const foo = 'shared'; rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/single-dependency/000077500000000000000000000000001415504077600301545ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/single-dependency/_config.js000066400000000000000000000111261415504077600321170ustar00rootroot00000000000000const assert = require('assert'); const path = require('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 = { 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))), { 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", dynamicallyImportedIds: [], dynamicImporters: [], hasModuleSideEffects: true, id: ID_MAIN, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [ID_DEP], importedIds: [ID_LIB], importers: [], isEntry: true, isExternal: false, meta: {}, syntheticNamedExports: false }); assert.deepStrictEqual(JSON.parse(JSON.stringify(this.getModuleInfo(ID_DEP))), { 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", dynamicallyImportedIds: [], dynamicImporters: [], hasModuleSideEffects: true, id: ID_DEP, implicitlyLoadedAfterOneOf: [ID_MAIN], implicitlyLoadedBefore: [], importedIds: [ID_LIB], importers: [], isEntry: false, isExternal: false, 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-2.61.1/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/000077500000000000000000000000001415504077600321145ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/amd/000077500000000000000000000000001415504077600326555ustar00rootroot00000000000000generated-dep.js000066400000000000000000000001251415504077600356360ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/amddefine(['./main'], (function (main) { 'use strict'; console.log(main.value); })); main.js000066400000000000000000000003021415504077600340530ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value = 42; console.log(value); exports.value = value; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/cjs/000077500000000000000000000000001415504077600326735ustar00rootroot00000000000000generated-dep.js000066400000000000000000000001121415504077600356500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/cjs'use strict'; var main = require('./main.js'); console.log(main.value); main.js000066400000000000000000000002161415504077600340750ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const value = 42; console.log(value); exports.value = value; rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/es/000077500000000000000000000000001415504077600325235ustar00rootroot00000000000000generated-dep.js000066400000000000000000000000751415504077600355100ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/esimport { v as value } from './main.js'; console.log(value); main.js000066400000000000000000000000771415504077600337320ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/esconst value = 42; console.log(value); export { value as v }; rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/single-dependency/_expected/system/000077500000000000000000000000001415504077600334405ustar00rootroot00000000000000generated-dep.js000066400000000000000000000003171415504077600364240ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002501415504077600346400ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/implicit-dependencies/single-dependency/dep.js000066400000000000000000000000631415504077600312610ustar00rootroot00000000000000import { value } from './lib'; console.log(value); rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/single-dependency/lib.js000066400000000000000000000000311415504077600312520ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/chunking-form/samples/implicit-dependencies/single-dependency/main.js000066400000000000000000000000631415504077600314350ustar00rootroot00000000000000import { value } from './lib'; console.log(value); rollup-2.61.1/test/chunking-form/samples/import-meta-url/000077500000000000000000000000001415504077600233575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/import-meta-url/_config.js000066400000000000000000000002461415504077600253230ustar00rootroot00000000000000module.exports = { description: 'supports import.meta.url', options: { preserveEntrySignatures: false, output: { chunkFileNames: 'nested/chunk.js' } } }; rollup-2.61.1/test/chunking-form/samples/import-meta-url/_expected/000077500000000000000000000000001415504077600253175ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/import-meta-url/_expected/amd/000077500000000000000000000000001415504077600260605ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/import-meta-url/_expected/amd/main.js000066400000000000000000000007461415504077600273510ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/import-meta-url/_expected/amd/nested/000077500000000000000000000000001415504077600273425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/import-meta-url/_expected/amd/nested/chunk.js000066400000000000000000000002221415504077600310040ustar00rootroot00000000000000define(['module', '../main'], (function (module, main) { 'use strict'; main.log('nested: ' + new URL(module.uri, document.baseURI).href); })); rollup-2.61.1/test/chunking-form/samples/import-meta-url/_expected/cjs/000077500000000000000000000000001415504077600260765ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/import-meta-url/_expected/cjs/main.js000066400000000000000000000010201415504077600273510ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function log(url) { if (typeof document === 'undefined') { console.log(url); } else { document.body.innerHTML += url + '
'; } } log('main: ' + (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href))); Promise.resolve().then(function () { return require('./nested/chunk.js'); }); exports.log = log; rollup-2.61.1/test/chunking-form/samples/import-meta-url/_expected/cjs/nested/000077500000000000000000000000001415504077600273605ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/import-meta-url/_expected/cjs/nested/chunk.js000066400000000000000000000004251415504077600310270ustar00rootroot00000000000000'use strict'; var main = require('../main.js'); main.log('nested: ' + (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('nested/chunk.js', document.baseURI).href))); rollup-2.61.1/test/chunking-form/samples/import-meta-url/_expected/es/000077500000000000000000000000001415504077600257265ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/import-meta-url/_expected/es/main.js000066400000000000000000000003371415504077600272130ustar00rootroot00000000000000function 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-2.61.1/test/chunking-form/samples/import-meta-url/_expected/es/nested/000077500000000000000000000000001415504077600272105ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/import-meta-url/_expected/es/nested/chunk.js000066400000000000000000000001131415504077600306510ustar00rootroot00000000000000import { l as log } from '../main.js'; log('nested: ' + import.meta.url); rollup-2.61.1/test/chunking-form/samples/import-meta-url/_expected/system/000077500000000000000000000000001415504077600266435ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/import-meta-url/_expected/system/main.js000066400000000000000000000005671415504077600301350ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/import-meta-url/_expected/system/nested/000077500000000000000000000000001415504077600301255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/import-meta-url/_expected/system/nested/chunk.js000066400000000000000000000003521415504077600315730ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/import-meta-url/index-amd.html000066400000000000000000000003431415504077600261130ustar00rootroot00000000000000 AMD rollup-2.61.1/test/chunking-form/samples/import-meta-url/index-es.html000066400000000000000000000002741415504077600257640ustar00rootroot00000000000000 ES Module rollup-2.61.1/test/chunking-form/samples/import-meta-url/index-system.html000066400000000000000000000004061415504077600266760ustar00rootroot00000000000000 SystemJS rollup-2.61.1/test/chunking-form/samples/import-meta-url/log.js000066400000000000000000000002211415504077600244710ustar00rootroot00000000000000export function log(url) { if (typeof document === 'undefined') { console.log(url); } else { document.body.innerHTML += url + '
'; } } rollup-2.61.1/test/chunking-form/samples/import-meta-url/main.js000066400000000000000000000001241415504077600246360ustar00rootroot00000000000000import {log} from './log'; log('main: ' + import.meta.url); import('./nested.js'); rollup-2.61.1/test/chunking-form/samples/import-meta-url/nested.js000066400000000000000000000000771415504077600252030ustar00rootroot00000000000000import {log} from './log'; log('nested: ' + import.meta.url); rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/000077500000000000000000000000001415504077600255515ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/_config.js000066400000000000000000000002221415504077600275070ustar00rootroot00000000000000module.exports = { description: 'chunk duplicate import deshadowing', options: { input: ['main1.js', 'main2.js', 'first.js', 'head.js'] } }; rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/_expected/000077500000000000000000000000001415504077600275115ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/_expected/amd/000077500000000000000000000000001415504077600302525ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/_expected/amd/first.js000066400000000000000000000001211415504077600317310ustar00rootroot00000000000000define((function () { 'use strict'; var head2 = 'first'; return head2; })); rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/_expected/amd/head.js000066400000000000000000000001161415504077600315070ustar00rootroot00000000000000define(['./first'], (function (first) { 'use strict'; return first; })); rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/_expected/amd/main1.js000066400000000000000000000001471415504077600316170ustar00rootroot00000000000000define(['./first'], (function (first) { 'use strict'; console.log(first); console.log(first); })); rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/_expected/amd/main2.js000066400000000000000000000001471415504077600316200ustar00rootroot00000000000000define(['./first'], (function (first) { 'use strict'; console.log(first); console.log(first); })); rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/_expected/cjs/000077500000000000000000000000001415504077600302705ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/_expected/cjs/first.js000066400000000000000000000000751415504077600317570ustar00rootroot00000000000000'use strict'; var head2 = 'first'; module.exports = head2; rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/_expected/cjs/head.js000066400000000000000000000001151415504077600315240ustar00rootroot00000000000000'use strict'; var first = require('./first.js'); module.exports = first; rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/_expected/cjs/main1.js000066400000000000000000000001331415504077600316300ustar00rootroot00000000000000'use strict'; var first = require('./first.js'); console.log(first); console.log(first); rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/_expected/cjs/main2.js000066400000000000000000000001331415504077600316310ustar00rootroot00000000000000'use strict'; var first = require('./first.js'); console.log(first); console.log(first); rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/_expected/es/000077500000000000000000000000001415504077600301205ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/_expected/es/first.js000066400000000000000000000000631415504077600316040ustar00rootroot00000000000000var head2 = 'first'; export { head2 as default }; rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/_expected/es/head.js000066400000000000000000000000461415504077600313570ustar00rootroot00000000000000export { default } from './first.js'; rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/_expected/es/main1.js000066400000000000000000000001111415504077600314540ustar00rootroot00000000000000import head2 from './first.js'; console.log(head2); console.log(head2); rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/_expected/es/main2.js000066400000000000000000000001111415504077600314550ustar00rootroot00000000000000import head2 from './first.js'; console.log(head2); console.log(head2); rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/_expected/system/000077500000000000000000000000001415504077600310355ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/_expected/system/first.js000066400000000000000000000002311415504077600325160ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var head2 = exports('default', 'first'); }) }; })); rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/_expected/system/head.js000066400000000000000000000003121415504077600322700ustar00rootroot00000000000000System.register(['./first.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('default', module["default"]); }], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/_expected/system/main1.js000066400000000000000000000003601415504077600323770ustar00rootroot00000000000000System.register(['./first.js'], (function () { 'use strict'; var head2; return { setters: [function (module) { head2 = module["default"]; }], execute: (function () { console.log(head2); console.log(head2); }) }; })); rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/_expected/system/main2.js000066400000000000000000000003601415504077600324000ustar00rootroot00000000000000System.register(['./first.js'], (function () { 'use strict'; var head2; return { setters: [function (module) { head2 = module["default"]; }], execute: (function () { console.log(head2); console.log(head2); }) }; })); rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/first.js000066400000000000000000000000271415504077600272350ustar00rootroot00000000000000export default 'first';rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/head.js000066400000000000000000000000451415504077600270070ustar00rootroot00000000000000export { default } from './first.js';rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/main1.js000066400000000000000000000001501415504077600271100ustar00rootroot00000000000000import head1 from './first.js'; import head2 from './head.js'; console.log(head1); console.log(head2); rollup-2.61.1/test/chunking-form/samples/import-variable-duplicates/main2.js000066400000000000000000000001501415504077600271110ustar00rootroot00000000000000import head1 from './first.js'; import head2 from './head.js'; console.log(head1); console.log(head2); rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/000077500000000000000000000000001415504077600250615ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/000077500000000000000000000000001415504077600323135ustar00rootroot00000000000000_config.js000066400000000000000000000001431415504077600341740ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-sharedmodule.exports = { description: 'chained dynamic import that imports something already loaded' }; _expected/000077500000000000000000000000001415504077600341745ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-sharedamd/000077500000000000000000000000001415504077600347355ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expectedgenerated-dynamic1.js000066400000000000000000000002731415504077600407360ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001601415504077600407320ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000004541415504077600362220ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); cjs/000077500000000000000000000000001415504077600347535ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expectedgenerated-dynamic1.js000066400000000000000000000001741415504077600407540ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001211415504077600407450ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003271415504077600362370ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const shared = 'shared'; Promise.resolve().then(function () { return require('./generated-dynamic1.js'); }); exports.shared = shared; es/000077500000000000000000000000001415504077600346035ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expectedgenerated-dynamic1.js000066400000000000000000000000741415504077600406030ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expected/esimport('./generated-dynamic2.js'); console.log('dynamic1'); generated-dynamic2.js000066400000000000000000000000441415504077600406010ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expected/esexport { shared } from './main.js'; main.js000066400000000000000000000001211415504077600360570ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expected/esconst shared = 'shared'; import('./generated-dynamic1.js'); export { shared }; system/000077500000000000000000000000001415504077600355205ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/_expectedgenerated-dynamic1.js000066400000000000000000000002761415504077600415240ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003041415504077600415150ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003221415504077600367770ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000621415504077600342750ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-sharedimport('./dynamic2.js'); console.log('dynamic1'); dynamic2.js000066400000000000000000000000461415504077600343000ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-sharedexport { shared } from './shared.js'; rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-shared/main.js000066400000000000000000000000771415504077600336010ustar00rootroot00000000000000export { shared } from './shared.js'; import('./dynamic1.js'); shared.js000066400000000000000000000000401415504077600340320ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/chained-dynamic-with-sharedexport const shared = 'shared'; rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/000077500000000000000000000000001415504077600320025ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_config.js000066400000000000000000000001071415504077600337420ustar00rootroot00000000000000module.exports = { description: 'handles circular dynamic imports' }; rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expected/000077500000000000000000000000001415504077600337425ustar00rootroot00000000000000amd/000077500000000000000000000000001415504077600344245ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expectedgenerated-dynamic1.js000066400000000000000000000002731415504077600404250ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002551415504077600404260ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000004311415504077600357040ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600344425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expectedgenerated-dynamic1.js000066400000000000000000000001741415504077600404430ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001561415504077600404440ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003141415504077600357220ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600342725ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expectedgenerated-dynamic1.js000066400000000000000000000000741415504077600402720ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expected/esimport('./generated-dynamic2.js'); console.log('dynamic1'); generated-dynamic2.js000066400000000000000000000000561415504077600402730ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expected/esimport('./main.js'); console.log('dynamic2'); main.js000066400000000000000000000001331415504077600355510ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expected/esimport('./generated-dynamic2.js'); import('./generated-dynamic1.js'); console.log('main'); system/000077500000000000000000000000001415504077600352075ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/_expectedgenerated-dynamic1.js000066400000000000000000000002761415504077600412130ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002601415504077600412050ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003471415504077600364750ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000621415504077600337640ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-importsimport('./dynamic2.js'); console.log('dynamic1'); dynamic2.js000066400000000000000000000000561415504077600337700ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-importsimport('./main.js'); console.log('dynamic2'); rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/circular-dynamic-imports/main.js000066400000000000000000000001071415504077600332620ustar00rootroot00000000000000import('./dynamic2.js'); import('./dynamic1.js'); console.log('main'); rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-1/000077500000000000000000000000001415504077600335345ustar00rootroot00000000000000_config.js000066400000000000000000000001431415504077600354150ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-1module.exports = { description: 'inlines dynamic imports that are already statically imported' }; _expected/000077500000000000000000000000001415504077600354155ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-1amd/000077500000000000000000000000001415504077600361565ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-1/_expectedmain.js000066400000000000000000000012631415504077600374420ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); cjs/000077500000000000000000000000001415504077600361745ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-1/_expectedmain.js000066400000000000000000000011601415504077600374540ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-1/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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/000077500000000000000000000000001415504077600360245ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-1/_expectedmain.js000066400000000000000000000010341415504077600373040ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600367415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-1/_expectedmain.js000066400000000000000000000012731415504077600402260ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001321415504077600346400ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001321415504077600346410ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002621415504077600347370ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-2/000077500000000000000000000000001415504077600335355ustar00rootroot00000000000000_config.js000066400000000000000000000001661415504077600354230ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-2module.exports = { description: 'inlines dynamic imports that are already statically imported by their importers' }; _expected/000077500000000000000000000000001415504077600354165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-2amd/000077500000000000000000000000001415504077600361575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-2/_expectedmain.js000066400000000000000000000010071415504077600374370ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600361755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-2/_expectedmain.js000066400000000000000000000007341415504077600374630ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600360255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-2/_expectedmain.js000066400000000000000000000007151415504077600373120ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600367425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-2/_expectedmain.js000066400000000000000000000011401415504077600402200ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001461415504077600355220ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000731415504077600355220ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-already-contained-2console.log('dynamic2'); export const value2 = 'dynamic2'; main.js000066400000000000000000000002411415504077600347350ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/000077500000000000000000000000001415504077600336705ustar00rootroot00000000000000_config.js000066400000000000000000000001621415504077600355520ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stagemodule.exports = { description: 'handles if a dynamically imported module imports another module dynamically' }; _expected/000077500000000000000000000000001415504077600355515ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stageamd/000077500000000000000000000000001415504077600363125ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expectedgenerated-dynamic1.js000066400000000000000000000002411415504077600423060ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002231415504077600423070ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000005121415504077600375720ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); cjs/000077500000000000000000000000001415504077600363305ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expectedgenerated-dynamic1.js000066400000000000000000000001431415504077600423250ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001631415504077600423300ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003641415504077600376150ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const value = 'shared'; console.log('dynamic1', value); Promise.resolve().then(function () { return require('./generated-dynamic1.js'); }); exports.value = value; es/000077500000000000000000000000001415504077600361605ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expectedgenerated-dynamic1.js000066400000000000000000000000431415504077600421540ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expected/esimport('./generated-dynamic2.js'); generated-dynamic2.js000066400000000000000000000001471415504077600421620ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expected/esimport { value } from './main.js'; export { value } from './main.js'; console.log('dynamic2', value); main.js000066400000000000000000000001571415504077600374450ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600370755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stage/_expectedgenerated-dynamic1.js000066400000000000000000000002421415504077600430720ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000004111415504077600430710ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003631415504077600403610ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000371415504077600347170ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stageexport const value = 'shared'; dynamic1.js000066400000000000000000000000311415504077600356460ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stageimport('./dynamic2.js'); dynamic2.js000066400000000000000000000001251415504077600356530ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic-multi-stageimport { value } from './dep.js'; console.log('dynamic2', value); export { value }; main.js000066400000000000000000000001561415504077600350750ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/000077500000000000000000000000001415504077600314375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_config.js000066400000000000000000000001621415504077600334000ustar00rootroot00000000000000module.exports = { description: 'handles if a dynamically imported module imports another module dynamically' }; rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expected/000077500000000000000000000000001415504077600333775ustar00rootroot00000000000000amd/000077500000000000000000000000001415504077600340615ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expectedgenerated-dynamic1.js000066400000000000000000000004111415504077600400540ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002551415504077600400630ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002411415504077600353400ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600340775ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expectedgenerated-dynamic1.js000066400000000000000000000002641415504077600401000ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002151415504077600400750ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001431415504077600353570ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expected/cjs'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic1.js'); }); es/000077500000000000000000000000001415504077600337275ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expectedgenerated-dynamic1.js000066400000000000000000000001571415504077600377310ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002031415504077600377220ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expected/esimport { value } from './generated-dynamic1.js'; export { value } from './generated-dynamic1.js'; console.log('dynamic2', value); main.js000066400000000000000000000000431415504077600352060ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expected/esimport('./generated-dynamic1.js'); system/000077500000000000000000000000001415504077600346445ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/_expectedgenerated-dynamic1.js000066400000000000000000000003631415504077600406450ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000004271415504077600406470ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002421415504077600361240ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/dep.js000066400000000000000000000000371415504077600325450ustar00rootroot00000000000000export const value = 'shared'; rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/dynamic1.js000066400000000000000000000001561415504077600335040ustar00rootroot00000000000000import { value } from './dep.js'; console.log('dynamic1', value); import('./dynamic2.js'); export { value }; rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/dynamic2.js000066400000000000000000000001251415504077600335010ustar00rootroot00000000000000import { value } from './dep.js'; console.log('dynamic2', value); export { value }; rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-import-dynamic/main.js000066400000000000000000000000311415504077600327130ustar00rootroot00000000000000import('./dynamic1.js'); rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/000077500000000000000000000000001415504077600312155ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_config.js000066400000000000000000000002341415504077600331560ustar00rootroot00000000000000module.exports = { description: 'keeps chunks separate when not in memory for all dynamic imports', options: { input: ['main1', 'main2', 'main3'] } }; rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/000077500000000000000000000000001415504077600331555ustar00rootroot00000000000000amd/000077500000000000000000000000001415504077600336375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expectedgenerated-dep.js000066400000000000000000000001611415504077600366770ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001501415504077600375510ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003341415504077600373770ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001701415504077600352000ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001701415504077600352010ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002701415504077600352030ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600336555ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expectedgenerated-dep.js000066400000000000000000000000771415504077600367230ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/cjs'use strict'; const value1 = 'dep'; exports.value1 = value1; generated-dynamic.js000066400000000000000000000001351415504077600375720ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002571415504077600374210ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001471415504077600352220ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001471415504077600352230ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001711415504077600352210ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/es/000077500000000000000000000000001415504077600335645ustar00rootroot00000000000000generated-dep.js000066400000000000000000000000571415504077600365510ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/esconst value1 = 'dep'; export { value1 as v }; generated-dynamic.js000066400000000000000000000001231415504077600374170ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001641415504077600372460ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001241415504077600350450ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/esimport './generated-shared.js'; import './generated-dep.js'; console.log('main1'); main2.js000066400000000000000000000001241415504077600350460ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/esimport './generated-shared.js'; import './generated-dep.js'; console.log('main2'); main3.js000066400000000000000000000000711415504077600350500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expected/esimport('./generated-dynamic.js'); console.log('main3'); system/000077500000000000000000000000001415504077600344225ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/_expectedgenerated-dep.js000066400000000000000000000002241415504077600374620ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003461415504077600403430ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000004401415504077600401600ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003311415504077600357620ustar00rootroot00000000000000rollup-2.61.1/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: [function () {}, function () {}], execute: (function () { console.log('main1'); }) }; })); main2.js000066400000000000000000000003311415504077600357630ustar00rootroot00000000000000rollup-2.61.1/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: [function () {}, function () {}], execute: (function () { console.log('main2'); }) }; })); main3.js000066400000000000000000000002731415504077600357710ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/dep.js000066400000000000000000000000351415504077600323210ustar00rootroot00000000000000export const value1 = 'dep'; rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/dynamic.js000066400000000000000000000001031415504077600331710ustar00rootroot00000000000000import { value1 } from './dep.js'; console.log('dynamic', value1); rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/main1.js000066400000000000000000000000551415504077600325600ustar00rootroot00000000000000import './shared.js'; console.log('main1'); rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/main2.js000066400000000000000000000000551415504077600325610ustar00rootroot00000000000000import './shared.js'; console.log('main2'); rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/main3.js000066400000000000000000000000571415504077600325640ustar00rootroot00000000000000import('./dynamic.js'); console.log('main3'); rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/dynamic-not-in-memory/shared.js000066400000000000000000000001321415504077600330150ustar00rootroot00000000000000import { value1 } from './dep.js'; import('./dynamic.js'); console.log('shared', value1); multi-entry-different-and-shared-dependencies/000077500000000000000000000000001415504077600356675ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks_config.js000066400000000000000000000003131415504077600376260ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependenciesmodule.exports = { description: 'avoids chunks for always loaded dependencies if multiple entry points with different dependencies have dynamic imports', options: { input: ['main1', 'main2'] } }; _expected/000077500000000000000000000000001415504077600376275ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependenciesamd/000077500000000000000000000000001415504077600403705ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expectedgenerated-dynamic.js000066400000000000000000000005161415504077600443100ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002571415504077600456100ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001771415504077600470740ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000010771415504077600417400ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); main2.js000066400000000000000000000006711415504077600417400ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); cjs/000077500000000000000000000000001415504077600404065ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expectedgenerated-dynamic.js000066400000000000000000000004761415504077600443330ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001731415504077600456230ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001151415504077600471020ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000010131415504077600417440ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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.js000066400000000000000000000005651415504077600417600ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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/000077500000000000000000000000001415504077600402365ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expectedgenerated-dynamic.js000066400000000000000000000004661415504077600441620ustar00rootroot00000000000000rollup-2.61.1/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'; export { v as value1 } from './generated-from-main-1-and-dynamic.js'; import { v as value2 } from './generated-from-main-1-and-2.js'; export { v as value2 } from './generated-from-main-1-and-2.js'; console.log('dynamic1', value1, value2); generated-from-main-1-and-2.js000066400000000000000000000001371415504077600454530ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000751415504077600467370ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expected/esconst value1 = 'main1 and dynamic'; export { value1 as v }; main1.js000066400000000000000000000005671415504077600416110ustar00rootroot00000000000000rollup-2.61.1/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'; export { 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'; export { v as value2, a as value3 } from './generated-from-main-1-and-2.js'; console.log('main1', value1, value2, value3); import('./generated-dynamic.js'); main2.js000066400000000000000000000003431415504077600416020ustar00rootroot00000000000000rollup-2.61.1/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'; export { v as value2, a as value3 } from './generated-from-main-1-and-2.js'; console.log('main2', value2, value3); import('./generated-dynamic.js'); system/000077500000000000000000000000001415504077600411535ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependencies/_expectedgenerated-dynamic.js000066400000000000000000000006451415504077600450760ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003101415504077600463610ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002421415504077600476500ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000010201415504077600425070ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000006071415504077600425220ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002431415504077600376500ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000351415504077600377340ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependenciesexport const value2 = 'all'; from-main-1-and-2.js000066400000000000000000000000511415504077600411430ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependenciesexport const value3 = 'main1 and main2'; from-main-1-and-dynamic.js000066400000000000000000000000531415504077600424300ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-and-shared-dependenciesexport const value1 = 'main1 and dynamic'; main1.js000066400000000000000000000003711415504077600372330ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002621415504077600372330ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/000077500000000000000000000000001415504077600337425ustar00rootroot00000000000000_config.js000066400000000000000000000003131415504077600356220ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependenciesmodule.exports = { description: 'avoids chunks for always loaded dependencies if multiple entry points with different dependencies have dynamic imports', options: { input: ['main1', 'main2'] } }; _expected/000077500000000000000000000000001415504077600356235ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependenciesamd/000077500000000000000000000000001415504077600363645ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expectedgenerated-dep1.js000066400000000000000000000001651415504077600415110ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001651415504077600415120ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003461415504077600423050ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000007051415504077600377310ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); main2.js000066400000000000000000000005231415504077600377300ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); cjs/000077500000000000000000000000001415504077600364025ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expectedgenerated-dep1.js000066400000000000000000000001031415504077600415170ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/cjs'use strict'; const value1 = 'shared1'; exports.value1 = value1; generated-dep2.js000066400000000000000000000001031415504077600415200ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/cjs'use strict'; const value2 = 'shared2'; exports.value2 = value2; generated-dynamic.js000066400000000000000000000003261415504077600423210ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000006211415504077600377440ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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.js000066400000000000000000000004201415504077600377420ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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/000077500000000000000000000000001415504077600362325ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expectedgenerated-dep1.js000066400000000000000000000000631415504077600413540ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/esconst value1 = 'shared1'; export { value1 as v }; generated-dep2.js000066400000000000000000000000631415504077600413550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/esconst value2 = 'shared2'; export { value2 as v }; generated-dynamic.js000066400000000000000000000003661415504077600421550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/esimport { v as value1 } from './generated-dep1.js'; export { v as value1 } from './generated-dep1.js'; import { v as value2 } from './generated-dep2.js'; export { v as value2 } from './generated-dep2.js'; console.log('dynamic1', value1, value2); main1.js000066400000000000000000000005001415504077600375700ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/esimport { v as value1 } from './generated-dep1.js'; export { v as value1 } from './generated-dep1.js'; import { v as value2 } from './generated-dep2.js'; export { v as value2 } from './generated-dep2.js'; const something = 'something'; console.log('main1', value1, value2, something); import('./generated-dynamic.js'); main2.js000066400000000000000000000002471415504077600376010ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expected/esimport { v as value2 } from './generated-dep2.js'; export { v as value2 } from './generated-dep2.js'; console.log('main2', value2); import('./generated-dynamic.js'); system/000077500000000000000000000000001415504077600371475ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependencies/_expectedgenerated-dep1.js000066400000000000000000000002301415504077600422650ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002301415504077600422660ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000006051415504077600430660ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000007441415504077600405170ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000005001415504077600405060ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000411415504077600350450ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependenciesexport const value1 = 'shared1'; dep2.js000066400000000000000000000000411415504077600350460ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependenciesexport const value2 = 'shared2'; dynamic.js000066400000000000000000000002141415504077600356420ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003371415504077600352310ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001551415504077600352300ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000461415504077600372230ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-different-dependenciesexport const something = 'something'; multi-entry-partly-already-loaded-dynamic/000077500000000000000000000000001415504077600350735ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks_config.js000066400000000000000000000003131415504077600370320ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamicmodule.exports = { description: 'avoids chunks for always loaded dependencies if multiple entry points with different dependencies have dynamic imports', options: { input: ['main1', 'main2'] } }; _expected/000077500000000000000000000000001415504077600370335ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamicamd/000077500000000000000000000000001415504077600375745ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expectedgenerated-dep2.js000066400000000000000000000001651415504077600427220ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002641415504077600435750ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002401415504077600435700ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000006221415504077600411370ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); main2.js000066400000000000000000000005241415504077600411410ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); cjs/000077500000000000000000000000001415504077600376125ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expectedgenerated-dep2.js000066400000000000000000000001031415504077600427300ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002321415504077600436060ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002001415504077600436020ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000005151415504077600411560ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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.js000066400000000000000000000004211415504077600411530ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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/000077500000000000000000000000001415504077600374425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expectedgenerated-dep2.js000066400000000000000000000000631415504077600425650ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/esconst value2 = 'shared2'; export { value2 as v }; generated-dynamic1.js000066400000000000000000000002121415504077600434340ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/esimport { value1 } from './main1.js'; export { value1 } from './main1.js'; import './generated-dep2.js'; console.log('dynamic1', value1); generated-dynamic2.js000066400000000000000000000002101415504077600434330ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/esimport { v as value2 } from './generated-dep2.js'; export { v as value2 } from './generated-dep2.js'; console.log('dynamic2', value2); main1.js000066400000000000000000000003371415504077600410100ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/esimport { v as value2 } from './generated-dep2.js'; export { v as value2 } from './generated-dep2.js'; const value1 = 'shared1'; console.log('main1', value1, value2); import('./generated-dynamic1.js'); export { value1 }; main2.js000066400000000000000000000002501415504077600410030ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expected/esimport { v as value2 } from './generated-dep2.js'; export { v as value2 } from './generated-dep2.js'; console.log('main2', value2); import('./generated-dynamic2.js'); system/000077500000000000000000000000001415504077600403575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamic/_expectedgenerated-dep2.js000066400000000000000000000002301415504077600434760ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000004671415504077600443650ustar00rootroot00000000000000rollup-2.61.1/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); }, function () {}], execute: (function () { console.log('dynamic1', value1); }) }; })); generated-dynamic2.js000066400000000000000000000004171415504077600443610ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000005721415504077600417260ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000005011415504077600417170ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000411415504077600362550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamicexport const value1 = 'shared1'; dep2.js000066400000000000000000000000411415504077600362560ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamicexport const value2 = 'shared2'; dynamic1.js000066400000000000000000000001301415504077600371300ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamicimport { value1 } from './dep1.js'; console.log('dynamic1', value1); export { value1 }; dynamic2.js000066400000000000000000000001301415504077600371310ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-partly-already-loaded-dynamicimport { value2 } from './dep2.js'; console.log('dynamic2', value2); export { value2 }; main1.js000066400000000000000000000002421415504077600364340ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001561415504077600364410ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600357275ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks_config.js000066400000000000000000000003131415504077600376660ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-importmodule.exports = { description: 'avoids chunks for always loaded dependencies if multiple entry points with different dependencies have dynamic imports', options: { input: ['main1', 'main2'] } }; _expected/000077500000000000000000000000001415504077600376675ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-importamd/000077500000000000000000000000001415504077600404305ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expectedgenerated-dynamic.js000066400000000000000000000001611415504077600443440ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000004071415504077600441710ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001401415504077600417660ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001401415504077600417670ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600404465ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expectedgenerated-dynamic.js000066400000000000000000000001461415504077600443650ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002621415504077600442060ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001101415504077600420010ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001101415504077600420020ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600402765ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expectedgenerated-dynamic.js000066400000000000000000000001261415504077600442130ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001611415504077600440340ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000671415504077600416440ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expected/esimport './generated-shared.js'; console.log('main1'); main2.js000066400000000000000000000000671415504077600416450ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expected/esimport './generated-shared.js'; console.log('main2'); system/000077500000000000000000000000001415504077600412135ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-import/_expectedgenerated-dynamic.js000066400000000000000000000003511415504077600451300ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003531415504077600447540ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002631415504077600425570ustar00rootroot00000000000000rollup-2.61.1/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: [function () {}], execute: (function () { console.log('main1'); }) }; })); main2.js000066400000000000000000000002631415504077600425600ustar00rootroot00000000000000rollup-2.61.1/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: [function () {}], execute: (function () { console.log('main2'); }) }; })); dep.js000066400000000000000000000000351415504077600370330ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-importexport const value1 = 'dep'; dynamic.js000066400000000000000000000001031415504077600377030ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-importimport { value1 } from './dep.js'; console.log('dynamic', value1); main1.js000066400000000000000000000000551415504077600372720ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-importimport './shared.js'; console.log('main1'); main2.js000066400000000000000000000000551415504077600372730ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/multi-entry-shared-static-with-dynamic-importimport './shared.js'; console.log('main2'); shared.js000066400000000000000000000001321415504077600375270ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-imports/000077500000000000000000000000001415504077600333105ustar00rootroot00000000000000_config.js000066400000000000000000000003001415504077600351640ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-importsmodule.exports = { 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/000077500000000000000000000000001415504077600351715ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-importsamd/000077500000000000000000000000001415504077600357325ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-imports/_expectedgenerated-dynamic.js000066400000000000000000000002221415504077600416440ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000007011415504077600372120ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); cjs/000077500000000000000000000000001415504077600357505ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-imports/_expectedgenerated-dynamic.js000066400000000000000000000001621415504077600416650ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000005341415504077600372340ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-imports/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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/000077500000000000000000000000001415504077600356005ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-imports/_expectedgenerated-dynamic.js000066400000000000000000000001461415504077600415170ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-imports/_expected/esimport { value } from './main.js'; export { value } from './main.js'; console.log('dynamic', value); main.js000066400000000000000000000002461415504077600370640ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600365155ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-imports/_expectedgenerated-dynamic.js000066400000000000000000000004101415504077600424260ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000004671415504077600400060ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001231415504077600340030ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-importsimport { value } from './dep.js'; console.log('a', value); import('./dynamic.js'); dep.js000066400000000000000000000000371415504077600343370ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-importsexport const value = 'shared'; dynamic.js000066400000000000000000000001231415504077600352070ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic-multiple-importsimport { value } from './dep.js'; console.log('dynamic', value); export { value }; main.js000066400000000000000000000001711415504077600345120ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/000077500000000000000000000000001415504077600277645ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/_config.js000066400000000000000000000002171415504077600317260ustar00rootroot00000000000000module.exports = { description: 'does not create a separate chunk if a dynamically imported chunk shares a dependency with its importer' }; rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/_expected/000077500000000000000000000000001415504077600317245ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/_expected/amd/000077500000000000000000000000001415504077600324655ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000002221415504077600363200ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000005051415504077600336700ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/_expected/cjs/000077500000000000000000000000001415504077600325035ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001621415504077600363410ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003571415504077600337130ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const value = 'shared'; console.log('main', value); Promise.resolve().then(function () { return require('./generated-dynamic.js'); }); exports.value = value; rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/_expected/es/000077500000000000000000000000001415504077600323335ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001461415504077600361730ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/_expected/esimport { value } from './main.js'; export { value } from './main.js'; console.log('dynamic', value); rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/_expected/es/main.js000066400000000000000000000001521415504077600336130ustar00rootroot00000000000000const value = 'shared'; console.log('main', value); import('./generated-dynamic.js'); export { value }; rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/_expected/system/000077500000000000000000000000001415504077600332505ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000004101415504077600371020ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003561415504077600344570ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/dep.js000066400000000000000000000000371415504077600310720ustar00rootroot00000000000000export const value = 'shared'; rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/dynamic.js000066400000000000000000000001231415504077600317420ustar00rootroot00000000000000import { value } from './dep.js'; console.log('dynamic', value); export { value }; rollup-2.61.1/test/chunking-form/samples/improved-dynamic-chunks/single-dynamic/main.js000066400000000000000000000001501415504077600312420ustar00rootroot00000000000000import { value } from './dep.js'; console.log('main', value); import('./dynamic.js'); export { value }; rollup-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/000077500000000000000000000000001415504077600274525ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/_config.js000066400000000000000000000003111415504077600314070ustar00rootroot00000000000000module.exports = { description: 'does not drop indirect reexports when preserving modules', expectedWarnings: ['MIXED_EXPORTS'], options: { output: { name: 'bundle', preserveModules: true } } }; rollup-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/000077500000000000000000000000001415504077600314125ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/amd/000077500000000000000000000000001415504077600321535ustar00rootroot00000000000000components/000077500000000000000000000000001415504077600342615ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/amdindex.js000066400000000000000000000003551415504077600357310ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); sub/000077500000000000000000000000001415504077600350525ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/amd/componentsindex.js000066400000000000000000000003311415504077600365140ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/amd/main.js000066400000000000000000000003701415504077600334350ustar00rootroot00000000000000define(['exports', './components/index', './components/sub/index'], (function (exports, index, index$1) { 'use strict'; exports.baz = index.baz; exports.foo = index$1.foo; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/cjs/000077500000000000000000000000001415504077600321715ustar00rootroot00000000000000components/000077500000000000000000000000001415504077600342775ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/cjsindex.js000066400000000000000000000003131415504077600357410ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/cjs/components'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var index = require('./sub/index.js'); const baz = { bar: index["default"] }; exports.foo = index.foo; exports.baz = baz; sub/000077500000000000000000000000001415504077600350705ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/cjs/componentsindex.js000066400000000000000000000002441415504077600365350ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/cjs/main.js000066400000000000000000000003501415504077600334510ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var index = require('./components/index.js'); var index$1 = require('./components/sub/index.js'); exports.baz = index.baz; exports.foo = index$1.foo; rollup-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/es/000077500000000000000000000000001415504077600320215ustar00rootroot00000000000000components/000077500000000000000000000000001415504077600341275ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/esindex.js000066400000000000000000000001571415504077600355770ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600347205ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/es/componentsindex.js000066400000000000000000000001101415504077600363550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/es/components/subconst foo = 'bar'; var bar = () => {}; export { bar as default, foo }; rollup-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/es/main.js000066400000000000000000000001361415504077600333030ustar00rootroot00000000000000export { baz } from './components/index.js'; export { foo } from './components/sub/index.js'; rollup-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/system/000077500000000000000000000000001415504077600327365ustar00rootroot00000000000000components/000077500000000000000000000000001415504077600350445ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/systemindex.js000066400000000000000000000004321415504077600365100ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600356355ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/_expected/system/componentsindex.js000066400000000000000000000003101415504077600372740ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000004511415504077600341410ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/components/000077500000000000000000000000001415504077600316375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/components/index.js000066400000000000000000000001251415504077600333020ustar00rootroot00000000000000import bar, { foo } from './sub/index'; export const baz = { bar }; export { foo }; rollup-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/components/sub/000077500000000000000000000000001415504077600324305ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/components/sub/index.js000066400000000000000000000000751415504077600340770ustar00rootroot00000000000000const foo = 'bar'; export { foo }; export default () => {}; rollup-2.61.1/test/chunking-form/samples/indirect-reexports-preserve-modules/main.js000066400000000000000000000001051415504077600307300ustar00rootroot00000000000000import { baz, foo } from './components/index'; export { baz, foo }; rollup-2.61.1/test/chunking-form/samples/interop-per-reexported-default-dependency/000077500000000000000000000000001415504077600305025ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/interop-per-reexported-default-dependency/_config.js000066400000000000000000000004711415504077600324460ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/000077500000000000000000000000001415504077600324425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/amd/000077500000000000000000000000001415504077600332035ustar00rootroot00000000000000auto.js000066400000000000000000000004241415504077600344320ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001531415504077600351050ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/amddefine(['external-default'], (function (externalDefault) { 'use strict'; return externalDefault; })); defaultOnly.js000066400000000000000000000001531415504077600357470ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/amddefine(['external-default'], (function (externalDefault) { 'use strict'; return externalDefault; })); esModule.js000066400000000000000000000001711415504077600352360ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/amddefine(['external-esModule'], (function (externalEsModule) { 'use strict'; return externalEsModule["default"]; })); rollup-2.61.1/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/cjs/000077500000000000000000000000001415504077600332215ustar00rootroot00000000000000auto.js000066400000000000000000000004161415504077600344510ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001471415504077600351260ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/cjs'use strict'; var externalDefault = require('external-default'); module.exports = externalDefault; defaultOnly.js000066400000000000000000000001471415504077600357700ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/cjs'use strict'; var externalDefault = require('external-default'); module.exports = externalDefault; esModule.js000066400000000000000000000001651415504077600352570ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/cjs'use strict'; var externalEsModule = require('external-esModule'); module.exports = externalEsModule["default"]; rollup-2.61.1/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/es/000077500000000000000000000000001415504077600330515ustar00rootroot00000000000000auto.js000066400000000000000000000000511415504077600342740ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/esexport { default } from 'external-auto'; default.js000066400000000000000000000000541415504077600347530ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/esexport { default } from 'external-default'; defaultOnly.js000066400000000000000000000000541415504077600356150ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/esexport { default } from 'external-default'; esModule.js000066400000000000000000000000551415504077600351050ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/esexport { default } from 'external-esModule'; rollup-2.61.1/test/chunking-form/samples/interop-per-reexported-default-dependency/_expected/system/000077500000000000000000000000001415504077600337665ustar00rootroot00000000000000auto.js000066400000000000000000000003151415504077600352140ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003201415504077600356640ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003201415504077600365260ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003211415504077600360160ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/interop-per-reexported-default-dependency/auto.js000066400000000000000000000000511415504077600320040ustar00rootroot00000000000000export { default } from 'external-auto'; rollup-2.61.1/test/chunking-form/samples/interop-per-reexported-default-dependency/default.js000066400000000000000000000000541415504077600324630ustar00rootroot00000000000000export { default } from 'external-default'; rollup-2.61.1/test/chunking-form/samples/interop-per-reexported-default-dependency/defaultOnly.js000066400000000000000000000000541415504077600333250ustar00rootroot00000000000000export { default } from 'external-default'; rollup-2.61.1/test/chunking-form/samples/interop-per-reexported-default-dependency/esModule.js000066400000000000000000000000551415504077600326150ustar00rootroot00000000000000export { default } from 'external-esModule'; rollup-2.61.1/test/chunking-form/samples/manual-chunk-avoid-facade/000077500000000000000000000000001415504077600252055ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-avoid-facade/_config.js000066400000000000000000000003041415504077600271440ustar00rootroot00000000000000module.exports = { description: 'avoid facades if possible when using manual chunks', options: { input: ['main1', 'main2'], output: { manualChunks: { manual: ['main2'] } } } }; rollup-2.61.1/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/000077500000000000000000000000001415504077600271455ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/amd/000077500000000000000000000000001415504077600277065ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/amd/main1.js000066400000000000000000000001471415504077600312530ustar00rootroot00000000000000define(['./main2'], (function (manual) { 'use strict'; console.log('main', manual.reexported); })); rollup-2.61.1/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/amd/main2.js000066400000000000000000000003201415504077600312450ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const value = 42; console.log('main2', value); exports.reexported = value; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/cjs/000077500000000000000000000000001415504077600277245ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/cjs/main1.js000066400000000000000000000001341415504077600312650ustar00rootroot00000000000000'use strict'; var manual = require('./main2.js'); console.log('main', manual.reexported); rollup-2.61.1/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/cjs/main2.js000066400000000000000000000002341415504077600312670ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const value = 42; console.log('main2', value); exports.reexported = value; rollup-2.61.1/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/es/000077500000000000000000000000001415504077600275545ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/es/main1.js000066400000000000000000000001171415504077600311160ustar00rootroot00000000000000import { reexported as value } from './main2.js'; console.log('main', value); rollup-2.61.1/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/es/main2.js000066400000000000000000000001211415504077600311120ustar00rootroot00000000000000const value = 42; console.log('main2', value); export { value as reexported }; rollup-2.61.1/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/system/000077500000000000000000000000001415504077600304715ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/system/main1.js000066400000000000000000000003411415504077600320320ustar00rootroot00000000000000System.register(['./main2.js'], (function () { 'use strict'; var value; return { setters: [function (module) { value = module.reexported; }], execute: (function () { console.log('main', value); }) }; })); rollup-2.61.1/test/chunking-form/samples/manual-chunk-avoid-facade/_expected/system/main2.js000066400000000000000000000002721415504077600320360ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('reexported', 42); console.log('main2', value); }) }; })); rollup-2.61.1/test/chunking-form/samples/manual-chunk-avoid-facade/dep.js000066400000000000000000000000311415504077600263050ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/chunking-form/samples/manual-chunk-avoid-facade/main1.js000066400000000000000000000000741415504077600265510ustar00rootroot00000000000000import { value } from './dep'; console.log('main', value); rollup-2.61.1/test/chunking-form/samples/manual-chunk-avoid-facade/main2.js000066400000000000000000000001371415504077600265520ustar00rootroot00000000000000import {value} from './dep.js'; console.log('main2', value); export { value as reexported }; rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-conflict/000077500000000000000000000000001415504077600274565ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_config.js000066400000000000000000000004351415504077600314220ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/000077500000000000000000000000001415504077600314165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/amd/000077500000000000000000000000001415504077600321575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/amd/main.js000066400000000000000000000003311415504077600334360ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; console.log('dep'); console.log('main'); const value = 42; exports.value = value; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/amd/main2.js000066400000000000000000000000751415504077600335250ustar00rootroot00000000000000define(['./main'], (function (outer) { 'use strict'; })); rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/cjs/000077500000000000000000000000001415504077600321755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/cjs/main.js000066400000000000000000000002441415504077600334570ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); console.log('dep'); console.log('main'); const value = 42; exports.value = value; rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/cjs/main2.js000066400000000000000000000000461415504077600335410ustar00rootroot00000000000000'use strict'; require('./main.js'); rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/es/000077500000000000000000000000001415504077600320255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/es/main.js000066400000000000000000000001201415504077600333000ustar00rootroot00000000000000console.log('dep'); console.log('main'); const value = 42; export { value }; rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/es/main2.js000066400000000000000000000000241415504077600333650ustar00rootroot00000000000000import './main.js'; rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/system/000077500000000000000000000000001415504077600327425ustar00rootroot00000000000000main.js000066400000000000000000000003051415504077600341430ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002171415504077600342270ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-conflict/_expected/systemSystem.register(['./main.js'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-conflict/dep.js000066400000000000000000000000241415504077600305600ustar00rootroot00000000000000console.log('dep'); rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-conflict/main.js000066400000000000000000000001031415504077600307320ustar00rootroot00000000000000import './dep.js'; console.log('main'); export const value = 42; rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-conflict/main2.js000066400000000000000000000000231415504077600310150ustar00rootroot00000000000000import './dep.js'; rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-conflict/outer.js000066400000000000000000000000501415504077600311450ustar00rootroot00000000000000import './main'; console.log('outer'); rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-match/000077500000000000000000000000001415504077600267515ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-match/_config.js000066400000000000000000000003561415504077600307170ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-match/_expected/000077500000000000000000000000001415504077600307115ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-match/_expected/amd/000077500000000000000000000000001415504077600314525ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-match/_expected/amd/main.js000066400000000000000000000003311415504077600327310ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; console.log('dep'); console.log('main'); const value = 42; exports.value = value; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-match/_expected/cjs/000077500000000000000000000000001415504077600314705ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-match/_expected/cjs/main.js000066400000000000000000000002441415504077600327520ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); console.log('dep'); console.log('main'); const value = 42; exports.value = value; rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-match/_expected/es/000077500000000000000000000000001415504077600313205ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-match/_expected/es/main.js000066400000000000000000000001201415504077600325730ustar00rootroot00000000000000console.log('dep'); console.log('main'); const value = 42; export { value }; rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-match/_expected/system/000077500000000000000000000000001415504077600322355ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-match/_expected/system/main.js000066400000000000000000000003051415504077600335150ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('dep'); console.log('main'); const value = exports('value', 42); }) }; })); rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-match/dep.js000066400000000000000000000000241415504077600300530ustar00rootroot00000000000000console.log('dep'); rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-match/main.js000066400000000000000000000001031415504077600302250ustar00rootroot00000000000000import './dep.js'; console.log('main'); export const value = 42; rollup-2.61.1/test/chunking-form/samples/manual-chunk-contains-entry-match/outer.js000066400000000000000000000000501415504077600304400ustar00rootroot00000000000000import './main'; console.log('outer'); rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-conflict/000077500000000000000000000000001415504077600262535ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-conflict/_config.js000066400000000000000000000003631415504077600302170ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/000077500000000000000000000000001415504077600302135ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/amd/000077500000000000000000000000001415504077600307545ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/amd/main.js000066400000000000000000000003311415504077600322330ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; console.log('dep'); console.log('main'); const value = 42; exports.value = value; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/amd/main2.js000066400000000000000000000000751415504077600323220ustar00rootroot00000000000000define(['./main'], (function (other) { 'use strict'; })); rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/cjs/000077500000000000000000000000001415504077600307725ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/cjs/main.js000066400000000000000000000002441415504077600322540ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); console.log('dep'); console.log('main'); const value = 42; exports.value = value; rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/cjs/main2.js000066400000000000000000000000461415504077600323360ustar00rootroot00000000000000'use strict'; require('./main.js'); rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/es/000077500000000000000000000000001415504077600306225ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/es/main.js000066400000000000000000000001201415504077600320750ustar00rootroot00000000000000console.log('dep'); console.log('main'); const value = 42; export { value }; rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/es/main2.js000066400000000000000000000000241415504077600321620ustar00rootroot00000000000000import './main.js'; rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/system/000077500000000000000000000000001415504077600315375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/system/main.js000066400000000000000000000003051415504077600330170ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('dep'); console.log('main'); const value = exports('value', 42); }) }; })); rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-conflict/_expected/system/main2.js000066400000000000000000000002171415504077600331030ustar00rootroot00000000000000System.register(['./main.js'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-conflict/dep.js000066400000000000000000000000241415504077600273550ustar00rootroot00000000000000console.log('dep'); rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-conflict/main.js000066400000000000000000000001031415504077600275270ustar00rootroot00000000000000import './dep.js'; console.log('main'); export const value = 42; rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-conflict/main2.js000066400000000000000000000000231415504077600276120ustar00rootroot00000000000000import './dep.js'; rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-match/000077500000000000000000000000001415504077600255465ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-match/_config.js000066400000000000000000000003641415504077600275130ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-match/_expected/000077500000000000000000000000001415504077600275065ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-match/_expected/amd/000077500000000000000000000000001415504077600302475ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-match/_expected/amd/main.js000066400000000000000000000003311415504077600315260ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; console.log('dep'); console.log('main'); const value = 42; exports.value = value; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-match/_expected/cjs/000077500000000000000000000000001415504077600302655ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-match/_expected/cjs/main.js000066400000000000000000000002441415504077600315470ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); console.log('dep'); console.log('main'); const value = 42; exports.value = value; rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-match/_expected/es/000077500000000000000000000000001415504077600301155ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-match/_expected/es/main.js000066400000000000000000000001201415504077600313700ustar00rootroot00000000000000console.log('dep'); console.log('main'); const value = 42; export { value }; rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-match/_expected/system/000077500000000000000000000000001415504077600310325ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-match/_expected/system/main.js000066400000000000000000000003051415504077600323120ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { console.log('dep'); console.log('main'); const value = exports('value', 42); }) }; })); rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-match/dep.js000066400000000000000000000000241415504077600266500ustar00rootroot00000000000000console.log('dep'); rollup-2.61.1/test/chunking-form/samples/manual-chunk-is-entry-match/main.js000066400000000000000000000001031415504077600270220ustar00rootroot00000000000000import './dep.js'; console.log('main'); export const value = 42; rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/000077500000000000000000000000001415504077600263135ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/_config.js000066400000000000000000000004261415504077600302570ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/_expected/000077500000000000000000000000001415504077600302535ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/_expected/amd/000077500000000000000000000000001415504077600310145ustar00rootroot00000000000000generated-manual-inner.js000066400000000000000000000001021415504077600356060ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/_expected/amddefine((function () { 'use strict'; console.log('inner'); })); generated-manual-middle.js000066400000000000000000000001541415504077600357400ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/_expected/amddefine(['./generated-manual-inner'], (function (manualInner) { 'use strict'; console.log('middle'); })); generated-manual-outer.js000066400000000000000000000001551415504077600356410ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/_expected/amddefine(['./generated-manual-middle'], (function (manualMiddle) { 'use strict'; console.log('outer'); })); rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/_expected/amd/main.js000066400000000000000000000002761415504077600323030ustar00rootroot00000000000000define(['./generated-manual-outer', './generated-manual-middle', './generated-manual-inner'], (function (manualOuter, manualMiddle, manualInner) { 'use strict'; console.log('main'); })); rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/_expected/cjs/000077500000000000000000000000001415504077600310325ustar00rootroot00000000000000generated-manual-inner.js000066400000000000000000000000451415504077600356320ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/_expected/cjs'use strict'; console.log('inner'); generated-manual-middle.js000066400000000000000000000001171415504077600357550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/_expected/cjs'use strict'; require('./generated-manual-inner.js'); console.log('middle'); generated-manual-outer.js000066400000000000000000000001171415504077600356550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/_expected/cjs'use strict'; require('./generated-manual-middle.js'); console.log('outer'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/_expected/cjs/main.js000066400000000000000000000002361415504077600323150ustar00rootroot00000000000000'use strict'; require('./generated-manual-outer.js'); require('./generated-manual-middle.js'); require('./generated-manual-inner.js'); console.log('main'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/_expected/es/000077500000000000000000000000001415504077600306625ustar00rootroot00000000000000generated-manual-inner.js000066400000000000000000000000261415504077600354610ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/_expected/esconsole.log('inner'); generated-manual-middle.js000066400000000000000000000000761415504077600356110ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/_expected/esimport './generated-manual-inner.js'; console.log('middle'); generated-manual-outer.js000066400000000000000000000000761415504077600355110ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/_expected/esimport './generated-manual-middle.js'; console.log('outer'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/_expected/es/main.js000066400000000000000000000002111415504077600321360ustar00rootroot00000000000000import './generated-manual-outer.js'; import './generated-manual-middle.js'; import './generated-manual-inner.js'; console.log('main'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/_expected/system/000077500000000000000000000000001415504077600315775ustar00rootroot00000000000000generated-manual-inner.js000066400000000000000000000001771415504077600364050ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('inner'); }) }; })); generated-manual-middle.js000066400000000000000000000002721415504077600365240ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/_expected/systemSystem.register(['./generated-manual-inner.js'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { console.log('middle'); }) }; })); generated-manual-outer.js000066400000000000000000000002721415504077600364240ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/_expected/systemSystem.register(['./generated-manual-middle.js'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { console.log('outer'); }) }; })); rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/_expected/system/main.js000066400000000000000000000004271415504077600330640ustar00rootroot00000000000000System.register(['./generated-manual-outer.js', './generated-manual-middle.js', './generated-manual-inner.js'], (function () { 'use strict'; return { setters: [function () {}, function () {}, function () {}], execute: (function () { console.log('main'); }) }; })); rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/inner.js000066400000000000000000000000261415504077600277620ustar00rootroot00000000000000console.log('inner'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/main.js000066400000000000000000000000531415504077600275730ustar00rootroot00000000000000import './outer.js'; console.log('main'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/middle.js000066400000000000000000000000551415504077600301070ustar00rootroot00000000000000import './inner.js'; console.log('middle'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-different-nested/outer.js000066400000000000000000000000551415504077600300070ustar00rootroot00000000000000import './middle.js'; console.log('outer'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-facades/000077500000000000000000000000001415504077600260755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-facades/_config.js000066400000000000000000000003101415504077600300310ustar00rootroot00000000000000module.exports = { description: 'creates facades for dynamic manual chunks if necessary', options: { input: ['main.js'], output: { manualChunks: { dynamic: ['dynamic1.js'] } } } }; rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-facades/_expected/000077500000000000000000000000001415504077600300355ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-facades/_expected/amd/000077500000000000000000000000001415504077600305765ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000011701415504077600344340ustar00rootroot00000000000000rollup-2.61.1/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, DYNAMIC_1: DYNAMIC_1, DEP: DEP, DYNAMIC_2: DYNAMIC_2, DYNAMIC_3: DYNAMIC_3 }); exports.DEP = DEP; exports.dynamic1 = dynamic1; exports.dynamic2 = dynamic2; exports.dynamic3 = dynamic3; })); rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-facades/_expected/amd/main.js000066400000000000000000000011051415504077600320550ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-facades/_expected/cjs/000077500000000000000000000000001415504077600306145ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000010611415504077600344510ustar00rootroot00000000000000rollup-2.61.1/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, DYNAMIC_1: DYNAMIC_1, DEP: DEP, DYNAMIC_2: DYNAMIC_2, DYNAMIC_3: DYNAMIC_3 }); exports.DEP = DEP; exports.dynamic1 = dynamic1; exports.dynamic2 = dynamic2; exports.dynamic3 = dynamic3; rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-facades/_expected/cjs/main.js000066400000000000000000000007751415504077600321070ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-facades/_expected/es/000077500000000000000000000000001415504077600304445ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000007721415504077600343110ustar00rootroot00000000000000rollup-2.61.1/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, DYNAMIC_1: DYNAMIC_1, DEP: DEP, DYNAMIC_2: DYNAMIC_2, DYNAMIC_3: DYNAMIC_3 }); export { DEP as D, dynamic3 as a, dynamic1 as b, dynamic2 as d }; rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-facades/_expected/es/main.js000066400000000000000000000005001415504077600317210ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-facades/_expected/system/000077500000000000000000000000001415504077600313615ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000012741415504077600352240ustar00rootroot00000000000000rollup-2.61.1/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, DYNAMIC_1: DYNAMIC_1, DEP: DEP, DYNAMIC_2: DYNAMIC_2, DYNAMIC_3: DYNAMIC_3 }); exports('b', dynamic1); }) }; })); rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-facades/_expected/system/main.js000066400000000000000000000007721415504077600326510ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-facades/dep.js000066400000000000000000000000321415504077600271760ustar00rootroot00000000000000export const DEP = 'DEP'; rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-facades/dynamic1.js000066400000000000000000000001761415504077600301440ustar00rootroot00000000000000export * from './dep.js'; export * from './dynamic2.js'; export * from './dynamic3.js'; export const DYNAMIC_1 = 'DYNAMIC_1'; rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-facades/dynamic2.js000066400000000000000000000000461415504077600301410ustar00rootroot00000000000000export const DYNAMIC_2 = 'DYNAMIC_2'; rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-facades/dynamic3.js000066400000000000000000000000461415504077600301420ustar00rootroot00000000000000export const DYNAMIC_3 = 'DYNAMIC_3'; rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-facades/main.js000066400000000000000000000002461415504077600273610ustar00rootroot00000000000000import { DEP } from './dep'; Promise.all([import('./dynamic1.js'), import('./dynamic2.js'), import('./dynamic3.js')]).then( results => console.log(results, DEP) ); rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/000077500000000000000000000000001415504077600272265ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/_config.js000066400000000000000000000002711415504077600311700ustar00rootroot00000000000000module.exports = { description: 'handles name conflicts in manual chunks', options: { input: ['main.js'], output: { manualChunks: { dynamic: ['dynamic1.js'] } } } }; rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/_expected/000077500000000000000000000000001415504077600311665ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/_expected/amd/000077500000000000000000000000001415504077600317275ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000007341415504077600355720ustar00rootroot00000000000000rollup-2.61.1/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_B: DYNAMIC_A, DYNAMIC_A: DYNAMIC_B }); exports.dynamic1 = dynamic1; exports.dynamic2 = dynamic2; })); rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/_expected/amd/main.js000066400000000000000000000006351415504077600332150ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/_expected/cjs/000077500000000000000000000000001415504077600317455ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000006341415504077600356070ustar00rootroot00000000000000rollup-2.61.1/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_B: DYNAMIC_A, DYNAMIC_A: DYNAMIC_B }); exports.dynamic1 = dynamic1; exports.dynamic2 = dynamic2; rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/_expected/cjs/main.js000066400000000000000000000005211415504077600332250ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/_expected/es/000077500000000000000000000000001415504077600315755ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000005741415504077600354420ustar00rootroot00000000000000rollup-2.61.1/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_B: DYNAMIC_A, DYNAMIC_A: DYNAMIC_B }); export { dynamic1 as a, dynamic2 as d }; rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/_expected/es/main.js000066400000000000000000000003221415504077600330540ustar00rootroot00000000000000import('./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-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/_expected/system/000077500000000000000000000000001415504077600325125ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000010371415504077600363520ustar00rootroot00000000000000rollup-2.61.1/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_B: DYNAMIC_A, DYNAMIC_A: DYNAMIC_B }); exports('a', dynamic1); }) }; })); main.js000066400000000000000000000005331415504077600337160ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/dynamic1.js000066400000000000000000000001471415504077600312730ustar00rootroot00000000000000console.log('dynamic1'); export { DYNAMIC_A as DYNAMIC_B, DYNAMIC_B as DYNAMIC_A } from './dynamic2'; rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/dynamic2.js000066400000000000000000000001461415504077600312730ustar00rootroot00000000000000console.log('dynamic2'); export const DYNAMIC_A = 'DYNAMIC_A'; export const DYNAMIC_B = 'DYNAMIC_B'; rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic-name-conflict/main.js000066400000000000000000000001721415504077600305100ustar00rootroot00000000000000import('./dynamic1.js').then(result => console.log(result)); import('./dynamic2.js').then(result => console.log(result)); rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic/000077500000000000000000000000001415504077600245115ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic/_config.js000066400000000000000000000002571415504077600264570ustar00rootroot00000000000000module.exports = { description: 'supports dynamic manual chunks', options: { input: ['main.js'], output: { manualChunks: { dynamic: ['dynamic.js'] } } } }; rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic/_expected/000077500000000000000000000000001415504077600264515ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic/_expected/amd/000077500000000000000000000000001415504077600272125ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic/_expected/amd/generated-dynamic.js000066400000000000000000000002401415504077600331240ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const DYNAMIC_USED_BY_A = 'DYNAMIC_USED_BY_A'; exports.DYNAMIC_USED_BY_A = DYNAMIC_USED_BY_A; })); rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic/_expected/amd/main.js000066400000000000000000000003361415504077600304760ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/manual-chunks-dynamic/_expected/cjs/000077500000000000000000000000001415504077600272305ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic/_expected/cjs/generated-dynamic.js000066400000000000000000000001561415504077600331500ustar00rootroot00000000000000'use strict'; const DYNAMIC_USED_BY_A = 'DYNAMIC_USED_BY_A'; exports.DYNAMIC_USED_BY_A = DYNAMIC_USED_BY_A; rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic/_expected/cjs/main.js000066400000000000000000000002401415504077600305060ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(({DYNAMIC_USED_BY_A}) => console.log(DYNAMIC_USED_BY_A)); rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic/_expected/es/000077500000000000000000000000001415504077600270605ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic/_expected/es/generated-dynamic.js000066400000000000000000000001161415504077600327740ustar00rootroot00000000000000const DYNAMIC_USED_BY_A = 'DYNAMIC_USED_BY_A'; export { DYNAMIC_USED_BY_A }; rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic/_expected/es/main.js000066400000000000000000000001401415504077600303350ustar00rootroot00000000000000import('./generated-dynamic.js').then(({DYNAMIC_USED_BY_A}) => console.log(DYNAMIC_USED_BY_A)); rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic/_expected/system/000077500000000000000000000000001415504077600277755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic/_expected/system/generated-dynamic.js000066400000000000000000000002751415504077600337170ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const DYNAMIC_USED_BY_A = exports('DYNAMIC_USED_BY_A', 'DYNAMIC_USED_BY_A'); }) }; })); rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic/_expected/system/main.js000066400000000000000000000003371415504077600312620ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/manual-chunks-dynamic/dynamic.js000066400000000000000000000000651415504077600264740ustar00rootroot00000000000000export const DYNAMIC_USED_BY_A = 'DYNAMIC_USED_BY_A';rollup-2.61.1/test/chunking-form/samples/manual-chunks-dynamic/main.js000066400000000000000000000001261415504077600257720ustar00rootroot00000000000000import('./dynamic.js').then(({DYNAMIC_USED_BY_A}) => console.log(DYNAMIC_USED_BY_A)); rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/000077500000000000000000000000001415504077600247125ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/_config.js000066400000000000000000000003711415504077600266550ustar00rootroot00000000000000module.exports = { 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]}`; } } } } }; rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/_expected/000077500000000000000000000000001415504077600266525ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/_expected/amd/000077500000000000000000000000001415504077600274135ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/_expected/amd/generated-chunk-b.js000066400000000000000000000001311415504077600332270ustar00rootroot00000000000000define((function () { 'use strict'; console.log('dep2'); console.log('dep-b'); })); rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/_expected/amd/generated-chunk-c.js000066400000000000000000000001411415504077600332310ustar00rootroot00000000000000define(['./generated-chunk-b'], (function (chunkB) { 'use strict'; console.log('dep-c'); })); rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/_expected/amd/main-a.js000066400000000000000000000002601415504077600311110ustar00rootroot00000000000000define(['./generated-chunk-c', './generated-chunk-b'], (function (chunkC, chunkB) { 'use strict'; console.log('dep1'); console.log('dep-a'); console.log('main-a'); })); rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/_expected/cjs/000077500000000000000000000000001415504077600274315ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/_expected/cjs/generated-chunk-b.js000066400000000000000000000000731415504077600332520ustar00rootroot00000000000000'use strict'; console.log('dep2'); console.log('dep-b'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/_expected/cjs/generated-chunk-c.js000066400000000000000000000001111415504077600332440ustar00rootroot00000000000000'use strict'; require('./generated-chunk-b.js'); console.log('dep-c'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/_expected/cjs/main-a.js000066400000000000000000000002321415504077600311260ustar00rootroot00000000000000'use strict'; require('./generated-chunk-c.js'); require('./generated-chunk-b.js'); console.log('dep1'); console.log('dep-a'); console.log('main-a'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/_expected/es/000077500000000000000000000000001415504077600272615ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/_expected/es/generated-chunk-b.js000066400000000000000000000000541415504077600331010ustar00rootroot00000000000000console.log('dep2'); console.log('dep-b'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/_expected/es/generated-chunk-c.js000066400000000000000000000000701415504077600331000ustar00rootroot00000000000000import './generated-chunk-b.js'; console.log('dep-c'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/_expected/es/main-a.js000066400000000000000000000002071415504077600307600ustar00rootroot00000000000000import './generated-chunk-c.js'; import './generated-chunk-b.js'; console.log('dep1'); console.log('dep-a'); console.log('main-a'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/_expected/system/000077500000000000000000000000001415504077600301765ustar00rootroot00000000000000generated-chunk-b.js000066400000000000000000000002301415504077600337330ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('dep2'); console.log('dep-b'); }) }; })); generated-chunk-c.js000066400000000000000000000002641415504077600337430ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/_expected/systemSystem.register(['./generated-chunk-b.js'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { console.log('dep-c'); }) }; })); rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/_expected/system/main-a.js000066400000000000000000000004221415504077600316740ustar00rootroot00000000000000System.register(['./generated-chunk-c.js', './generated-chunk-b.js'], (function () { 'use strict'; return { setters: [function () {}, function () {}], execute: (function () { console.log('dep1'); console.log('dep-a'); console.log('main-a'); }) }; })); rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/dep-a.js000066400000000000000000000000721415504077600262350ustar00rootroot00000000000000import './dep-c'; import './dep1'; console.log('dep-a'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/dep-b.js000066400000000000000000000000501415504077600262320ustar00rootroot00000000000000import './dep2'; console.log('dep-b'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/dep-c.js000066400000000000000000000000501415504077600262330ustar00rootroot00000000000000import './dep2'; console.log('dep-c'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/dep1.js000066400000000000000000000000251415504077600260760ustar00rootroot00000000000000console.log('dep1'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/dep2.js000066400000000000000000000000251415504077600260770ustar00rootroot00000000000000console.log('dep2'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-function/main-a.js000066400000000000000000000000741415504077600264130ustar00rootroot00000000000000import './dep-a'; import './dep-b'; console.log('main-a'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-nested/000077500000000000000000000000001415504077600243475ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-nested/_config.js000066400000000000000000000003171415504077600263120ustar00rootroot00000000000000module.exports = { description: 'manual chunks can contain nested modules', options: { input: ['main.js'], output: { manualChunks: { manual: ['middle.js', 'inner.js', 'outer.js'] } } } }; rollup-2.61.1/test/chunking-form/samples/manual-chunks-nested/_expected/000077500000000000000000000000001415504077600263075ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-nested/_expected/amd/000077500000000000000000000000001415504077600270505ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-nested/_expected/amd/generated-manual.js000066400000000000000000000001631415504077600326170ustar00rootroot00000000000000define((function () { 'use strict'; console.log('inner'); console.log('middle'); console.log('outer'); })); rollup-2.61.1/test/chunking-form/samples/manual-chunks-nested/_expected/amd/main.js000066400000000000000000000001371415504077600303330ustar00rootroot00000000000000define(['./generated-manual'], (function (manual) { 'use strict'; console.log('main'); })); rollup-2.61.1/test/chunking-form/samples/manual-chunks-nested/_expected/cjs/000077500000000000000000000000001415504077600270665ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-nested/_expected/cjs/generated-manual.js000066400000000000000000000001241415504077600326320ustar00rootroot00000000000000'use strict'; console.log('inner'); console.log('middle'); console.log('outer'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-nested/_expected/cjs/main.js000066400000000000000000000001071415504077600303460ustar00rootroot00000000000000'use strict'; require('./generated-manual.js'); console.log('main'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-nested/_expected/es/000077500000000000000000000000001415504077600267165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-nested/_expected/es/generated-manual.js000066400000000000000000000001051415504077600324610ustar00rootroot00000000000000console.log('inner'); console.log('middle'); console.log('outer'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-nested/_expected/es/main.js000066400000000000000000000000661415504077600302020ustar00rootroot00000000000000import './generated-manual.js'; console.log('main'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-nested/_expected/system/000077500000000000000000000000001415504077600276335ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks-nested/_expected/system/generated-manual.js000066400000000000000000000002641415504077600334040ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('inner'); console.log('middle'); console.log('outer'); }) }; })); rollup-2.61.1/test/chunking-form/samples/manual-chunks-nested/_expected/system/main.js000066400000000000000000000002621415504077600311150ustar00rootroot00000000000000System.register(['./generated-manual.js'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { console.log('main'); }) }; })); rollup-2.61.1/test/chunking-form/samples/manual-chunks-nested/inner.js000066400000000000000000000000261415504077600260160ustar00rootroot00000000000000console.log('inner'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-nested/main.js000066400000000000000000000000531415504077600256270ustar00rootroot00000000000000import './outer.js'; console.log('main'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-nested/middle.js000066400000000000000000000000551415504077600261430ustar00rootroot00000000000000import './inner.js'; console.log('middle'); rollup-2.61.1/test/chunking-form/samples/manual-chunks-nested/outer.js000066400000000000000000000000551415504077600260430ustar00rootroot00000000000000import './middle.js'; console.log('outer'); rollup-2.61.1/test/chunking-form/samples/manual-chunks/000077500000000000000000000000001415504077600230675ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks/_config.js000066400000000000000000000003071415504077600250310ustar00rootroot00000000000000module.exports = { description: 'manual chunks support', options: { input: ['main.js'], output: { manualChunks: { lib1: ['lib1.js'], deps2and3: ['dep2.js', 'dep3.js'] } } } }; rollup-2.61.1/test/chunking-form/samples/manual-chunks/_expected/000077500000000000000000000000001415504077600250275ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks/_expected/amd/000077500000000000000000000000001415504077600255705ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks/_expected/amd/generated-deps2and3.js000066400000000000000000000004761415504077600316540ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/manual-chunks/_expected/amd/generated-lib1.js000066400000000000000000000002061415504077600307070ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function fn () { console.log('lib1 fn'); } exports.fn = fn; })); rollup-2.61.1/test/chunking-form/samples/manual-chunks/_expected/amd/main.js000066400000000000000000000004251415504077600270530ustar00rootroot00000000000000define(['./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-2.61.1/test/chunking-form/samples/manual-chunks/_expected/cjs/000077500000000000000000000000001415504077600256065ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks/_expected/cjs/generated-deps2and3.js000066400000000000000000000004061415504077600316630ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/manual-chunks/_expected/cjs/generated-lib1.js000066400000000000000000000001161415504077600307250ustar00rootroot00000000000000'use strict'; function fn () { console.log('lib1 fn'); } exports.fn = fn; rollup-2.61.1/test/chunking-form/samples/manual-chunks/_expected/cjs/main.js000066400000000000000000000004051415504077600270670ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/manual-chunks/_expected/es/000077500000000000000000000000001415504077600254365ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks/_expected/es/generated-deps2and3.js000066400000000000000000000003631415504077600315150ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/manual-chunks/_expected/es/generated-lib1.js000066400000000000000000000001021415504077600305500ustar00rootroot00000000000000function fn () { console.log('lib1 fn'); } export { fn as f }; rollup-2.61.1/test/chunking-form/samples/manual-chunks/_expected/es/main.js000066400000000000000000000003631415504077600267220ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/manual-chunks/_expected/system/000077500000000000000000000000001415504077600263535ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/manual-chunks/_expected/system/generated-deps2and3.js000066400000000000000000000007631415504077600324360ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/manual-chunks/_expected/system/generated-lib1.js000066400000000000000000000003141415504077600314720ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('f', fn); function fn () { console.log('lib1 fn'); } }) }; })); rollup-2.61.1/test/chunking-form/samples/manual-chunks/_expected/system/main.js000066400000000000000000000007531415504077600276420ustar00rootroot00000000000000System.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; }, function () {}], execute: (function () { function fn () { console.log('dep1 fn'); } class Main { constructor () { fn(); fn$1(); fn$2(); } } exports('default', Main); }) }; })); rollup-2.61.1/test/chunking-form/samples/manual-chunks/dep1.js000066400000000000000000000000631415504077600242550ustar00rootroot00000000000000export function fn () { console.log('dep1 fn'); }rollup-2.61.1/test/chunking-form/samples/manual-chunks/dep2.js000066400000000000000000000001501415504077600242530ustar00rootroot00000000000000import { fn as libfn } from './lib2.js'; export function fn () { libfn(); console.log('dep2 fn'); }rollup-2.61.1/test/chunking-form/samples/manual-chunks/dep3.js000066400000000000000000000002201415504077600242520ustar00rootroot00000000000000import { fn as libfn, treeshaked } from './lib1.js'; export function fn () { libfn(); console.log('dep3 fn'); } export default treeshaked;rollup-2.61.1/test/chunking-form/samples/manual-chunks/lib1.js000066400000000000000000000001751415504077600242570ustar00rootroot00000000000000export function fn () { console.log('lib1 fn'); } export function treeshaked () { console.log('this is tree shaken!'); }rollup-2.61.1/test/chunking-form/samples/manual-chunks/lib2.js000066400000000000000000000000631415504077600242540ustar00rootroot00000000000000export function fn () { console.log('lib2 fn'); }rollup-2.61.1/test/chunking-form/samples/manual-chunks/main.js000066400000000000000000000003721415504077600243530ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/minify-internal-exports/000077500000000000000000000000001415504077600251305ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/minify-internal-exports/_config.js000066400000000000000000000002751415504077600270760ustar00rootroot00000000000000module.exports = { description: 'allows to force the minification of internal exports', options: { input: ['main1.js', 'main2.js'], output: { minifyInternalExports: true } } }; rollup-2.61.1/test/chunking-form/samples/minify-internal-exports/_expected/000077500000000000000000000000001415504077600270705ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/minify-internal-exports/_expected/amd/000077500000000000000000000000001415504077600276315ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/minify-internal-exports/_expected/amd/generated-shared2.js000066400000000000000000000003651415504077600334570ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/minify-internal-exports/_expected/amd/main1.js000066400000000000000000000001721415504077600311740ustar00rootroot00000000000000define(['./generated-shared2'], (function (shared2) { 'use strict'; console.log(shared2.s, shared2.a, shared2.f); })); rollup-2.61.1/test/chunking-form/samples/minify-internal-exports/_expected/amd/main2.js000066400000000000000000000001721415504077600311750ustar00rootroot00000000000000define(['./generated-shared2'], (function (shared2) { 'use strict'; console.log(shared2.s, shared2.a, shared2.b); })); rollup-2.61.1/test/chunking-form/samples/minify-internal-exports/_expected/cjs/000077500000000000000000000000001415504077600276475ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/minify-internal-exports/_expected/cjs/generated-shared2.js000066400000000000000000000002751415504077600334750ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/minify-internal-exports/_expected/cjs/main1.js000066400000000000000000000001571415504077600312150ustar00rootroot00000000000000'use strict'; var shared2 = require('./generated-shared2.js'); console.log(shared2.s, shared2.a, shared2.f); rollup-2.61.1/test/chunking-form/samples/minify-internal-exports/_expected/cjs/main2.js000066400000000000000000000001571415504077600312160ustar00rootroot00000000000000'use strict'; var shared2 = require('./generated-shared2.js'); console.log(shared2.s, shared2.a, shared2.b); rollup-2.61.1/test/chunking-form/samples/minify-internal-exports/_expected/es/000077500000000000000000000000001415504077600274775ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/minify-internal-exports/_expected/es/generated-shared2.js000066400000000000000000000002351415504077600333210ustar00rootroot00000000000000const 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-2.61.1/test/chunking-form/samples/minify-internal-exports/_expected/es/main1.js000066400000000000000000000001641415504077600310430ustar00rootroot00000000000000import { s as shared1, a as shared2, f as foo } from './generated-shared2.js'; console.log(shared1, shared2, foo); rollup-2.61.1/test/chunking-form/samples/minify-internal-exports/_expected/es/main2.js000066400000000000000000000001641415504077600310440ustar00rootroot00000000000000import { s as shared1, a as shared2, b as foo } from './generated-shared2.js'; console.log(shared1, shared2, foo); rollup-2.61.1/test/chunking-form/samples/minify-internal-exports/_expected/system/000077500000000000000000000000001415504077600304145ustar00rootroot00000000000000generated-shared2.js000066400000000000000000000004201415504077600341530ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/minify-internal-exports/_expected/system/main1.js000066400000000000000000000004501415504077600317560ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/minify-internal-exports/_expected/system/main2.js000066400000000000000000000004501415504077600317570ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/minify-internal-exports/main1.js000066400000000000000000000001601415504077600264700ustar00rootroot00000000000000import { shared1, foo } from './shared1'; import shared2 from './shared2'; console.log(shared1, shared2, foo); rollup-2.61.1/test/chunking-form/samples/minify-internal-exports/main2.js000066400000000000000000000001641415504077600264750ustar00rootroot00000000000000import { shared1 } from './shared1'; import shared2, { foo } from './shared2'; console.log(shared1, shared2, foo); rollup-2.61.1/test/chunking-form/samples/minify-internal-exports/shared1.js000066400000000000000000000000751415504077600270170ustar00rootroot00000000000000export const shared1 = 'shared1'; export const foo = 'foo1'; rollup-2.61.1/test/chunking-form/samples/minify-internal-exports/shared2.js000066400000000000000000000000651415504077600270170ustar00rootroot00000000000000export default 'shared2'; export const foo = 'foo2'; rollup-2.61.1/test/chunking-form/samples/missing-export-compact/000077500000000000000000000000001415504077600247355ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/missing-export-compact/_config.js000066400000000000000000000003211415504077600266730ustar00rootroot00000000000000module.exports = { description: 'missing export compact', expectedWarnings: ['SHIMMED_EXPORT'], options: { input: ['main.js', 'dep.js'], shimMissingExports: true, output: { compact: true } } }; rollup-2.61.1/test/chunking-form/samples/missing-export-compact/_expected/000077500000000000000000000000001415504077600266755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/missing-export-compact/_expected/amd/000077500000000000000000000000001415504077600274365ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/missing-export-compact/_expected/amd/dep.js000066400000000000000000000004171415504077600305460ustar00rootroot00000000000000define(['exports'],(function(exports){'use strict';var _missingExportShim=void 0;function x (arg) { sideEffect(arg); }exports.missingExport=_missingExportShim;exports.missingFn=_missingExportShim;exports.x=x;Object.defineProperty(exports,'__esModule',{value:true});}));rollup-2.61.1/test/chunking-form/samples/missing-export-compact/_expected/amd/main.js000066400000000000000000000001271415504077600307200ustar00rootroot00000000000000define(['./dep'],(function(dep){'use strict';dep.missingFn(); dep.x(dep.missingFn);}));rollup-2.61.1/test/chunking-form/samples/missing-export-compact/_expected/cjs/000077500000000000000000000000001415504077600274545ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/missing-export-compact/_expected/cjs/dep.js000066400000000000000000000003451415504077600305640ustar00rootroot00000000000000'use strict';Object.defineProperty(exports,'__esModule',{value:true});var _missingExportShim=void 0;function x (arg) { sideEffect(arg); }exports.missingExport=_missingExportShim;exports.missingFn=_missingExportShim;exports.x=x;rollup-2.61.1/test/chunking-form/samples/missing-export-compact/_expected/cjs/main.js000066400000000000000000000001171415504077600307350ustar00rootroot00000000000000'use strict';var dep=require('./dep.js');dep.missingFn(); dep.x(dep.missingFn);rollup-2.61.1/test/chunking-form/samples/missing-export-compact/_expected/es/000077500000000000000000000000001415504077600273045ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/missing-export-compact/_expected/es/dep.js000066400000000000000000000002231415504077600304070ustar00rootroot00000000000000var _missingExportShim=void 0;function x (arg) { sideEffect(arg); }export{_missingExportShim as missingExport,_missingExportShim as missingFn,x};rollup-2.61.1/test/chunking-form/samples/missing-export-compact/_expected/es/main.js000066400000000000000000000001451415504077600305660ustar00rootroot00000000000000import {missingFn as _missingExportShim,x}from'./dep.js';_missingExportShim(); x(_missingExportShim);rollup-2.61.1/test/chunking-form/samples/missing-export-compact/_expected/system/000077500000000000000000000000001415504077600302215ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/missing-export-compact/_expected/system/dep.js000066400000000000000000000003621415504077600313300ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/missing-export-compact/_expected/system/main.js000066400000000000000000000003511415504077600315020ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/missing-export-compact/dep.js000066400000000000000000000000571415504077600260450ustar00rootroot00000000000000export function x (arg) { sideEffect(arg); } rollup-2.61.1/test/chunking-form/samples/missing-export-compact/main.js000066400000000000000000000001301415504077600262110ustar00rootroot00000000000000import { missingExport, missingFn, x } from './dep.js'; missingFn(); x(missingExport); rollup-2.61.1/test/chunking-form/samples/missing-export-reused-deconflicting/000077500000000000000000000000001415504077600274045ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/missing-export-reused-deconflicting/_config.js000066400000000000000000000003571415504077600313530ustar00rootroot00000000000000module.exports = { description: 'handles using dependencies with shimmed missing exports as ', expectedWarnings: ['SHIMMED_EXPORT'], options: { input: ['main.js'], shimMissingExports: true, output: { preserveModules: true } } }; rollup-2.61.1/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/000077500000000000000000000000001415504077600313445ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/amd/000077500000000000000000000000001415504077600321055ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/amd/dep1.js000066400000000000000000000006441415504077600333000ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/amd/dep2.js000066400000000000000000000006251415504077600333000ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/amd/main.js000066400000000000000000000002231415504077600333640ustar00rootroot00000000000000define(['./dep1', './dep2'], (function (dep1, dep2) { 'use strict'; console.log(dep1.missing1, dep2.missing2, dep2.previousShimmedExport); })); rollup-2.61.1/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/cjs/000077500000000000000000000000001415504077600321235ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/cjs/dep1.js000066400000000000000000000005521415504077600333140ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/cjs/dep2.js000066400000000000000000000005361415504077600333170ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/cjs/main.js000066400000000000000000000002311415504077600334010ustar00rootroot00000000000000'use strict'; var dep1 = require('./dep1.js'); var dep2 = require('./dep2.js'); console.log(dep1.missing1, dep2.missing2, dep2.previousShimmedExport); rollup-2.61.1/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/es/000077500000000000000000000000001415504077600317535ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/es/dep1.js000066400000000000000000000004371415504077600331460ustar00rootroot00000000000000var _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-2.61.1/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/es/dep2.js000066400000000000000000000004141415504077600331420ustar00rootroot00000000000000var _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-2.61.1/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/es/main.js000066400000000000000000000003671415504077600332430ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/missing-export-reused-deconflicting/_expected/system/000077500000000000000000000000001415504077600326705ustar00rootroot00000000000000dep1.js000066400000000000000000000006451415504077600340050ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000005711415504077600340040ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000007361415504077600341010ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/missing-export-reused-deconflicting/dep1.js000066400000000000000000000003211415504077600305670ustar00rootroot00000000000000console.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-2.61.1/test/chunking-form/samples/missing-export-reused-deconflicting/dep2.js000066400000000000000000000003011415504077600305660ustar00rootroot00000000000000console.log('This is the output when a missing export is reexported'); var _missingExportShim = void 0; console.log(_missingExportShim); export {_missingExportShim as previousShimmedExport} rollup-2.61.1/test/chunking-form/samples/missing-export-reused-deconflicting/main.js000066400000000000000000000002341415504077600306650ustar00rootroot00000000000000import { missing1 } from './dep1.js'; import { missing2, previousShimmedExport } from './dep2.js'; console.log(missing1, missing2, previousShimmedExport); rollup-2.61.1/test/chunking-form/samples/missing-export/000077500000000000000000000000001415504077600233115ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/missing-export/_config.js000066400000000000000000000002701415504077600252520ustar00rootroot00000000000000module.exports = { description: 'missing export', expectedWarnings: ['SHIMMED_EXPORT', 'MIXED_EXPORTS'], options: { input: ['main.js', 'dep.js'], shimMissingExports: true } }; rollup-2.61.1/test/chunking-form/samples/missing-export/_expected/000077500000000000000000000000001415504077600252515ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/missing-export/_expected/amd/000077500000000000000000000000001415504077600260125ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/missing-export/_expected/amd/dep.js000066400000000000000000000005501415504077600271200ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/missing-export/_expected/amd/main.js000066400000000000000000000001421415504077600272710ustar00rootroot00000000000000define(['./dep'], (function (dep) { 'use strict'; dep.missingFn(); dep.x(dep.missingFn); })); rollup-2.61.1/test/chunking-form/samples/missing-export/_expected/cjs/000077500000000000000000000000001415504077600260305ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/missing-export/_expected/cjs/dep.js000066400000000000000000000004461415504077600271420ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/missing-export/_expected/cjs/main.js000066400000000000000000000001261415504077600273110ustar00rootroot00000000000000'use strict'; var dep = require('./dep.js'); dep.missingFn(); dep.x(dep.missingFn); rollup-2.61.1/test/chunking-form/samples/missing-export/_expected/es/000077500000000000000000000000001415504077600256605ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/missing-export/_expected/es/dep.js000066400000000000000000000002761415504077600267730ustar00rootroot00000000000000var _missingExportShim = void 0; function x (arg) { sideEffect(arg); } export { _missingExportShim as default, _missingExportShim as missingExport, _missingExportShim as missingFn, x }; rollup-2.61.1/test/chunking-form/samples/missing-export/_expected/es/main.js000066400000000000000000000001551415504077600271430ustar00rootroot00000000000000import { missingFn as _missingExportShim, x } from './dep.js'; _missingExportShim(); x(_missingExportShim); rollup-2.61.1/test/chunking-form/samples/missing-export/_expected/system/000077500000000000000000000000001415504077600265755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/missing-export/_expected/system/dep.js000066400000000000000000000005771415504077600277140ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/missing-export/_expected/system/main.js000066400000000000000000000004401415504077600300550ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/missing-export/dep.js000066400000000000000000000000571415504077600244210ustar00rootroot00000000000000export function x (arg) { sideEffect(arg); } rollup-2.61.1/test/chunking-form/samples/missing-export/main.js000066400000000000000000000001701415504077600245710ustar00rootroot00000000000000import missingDefault, { missingExport, missingFn, x } from './dep.js'; missingFn(); x(missingExport, missingDefault); rollup-2.61.1/test/chunking-form/samples/multi-chunking/000077500000000000000000000000001415504077600232575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/multi-chunking/_config.js000066400000000000000000000001641415504077600252220ustar00rootroot00000000000000module.exports = { description: 'simple chunking', options: { input: ['main1.js', 'main2.js', 'main3.js'] } }; rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/000077500000000000000000000000001415504077600252175ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/amd/000077500000000000000000000000001415504077600257605ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/amd/generated-dep1.js000066400000000000000000000001421415504077600311000ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var num = 1; exports.num = num; })); rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/amd/generated-dep2.js000066400000000000000000000001421415504077600311010ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var num = 2; exports.num = num; })); rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/amd/generated-dep3.js000066400000000000000000000001421415504077600311020ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var num = 3; exports.num = num; })); rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/amd/main1.js000066400000000000000000000002021415504077600273150ustar00rootroot00000000000000define(['./generated-dep1', './generated-dep2'], (function (dep1, dep2) { 'use strict'; console.log(dep1.num + dep2.num); })); rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/amd/main2.js000066400000000000000000000002021415504077600273160ustar00rootroot00000000000000define(['./generated-dep2', './generated-dep3'], (function (dep2, dep3) { 'use strict'; console.log(dep2.num + dep3.num); })); rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/amd/main3.js000066400000000000000000000002021415504077600273170ustar00rootroot00000000000000define(['./generated-dep1', './generated-dep3'], (function (dep1, dep3) { 'use strict'; console.log(dep1.num + dep3.num); })); rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/cjs/000077500000000000000000000000001415504077600257765ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/cjs/generated-dep1.js000066400000000000000000000000601415504077600311150ustar00rootroot00000000000000'use strict'; var num = 1; exports.num = num; rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/cjs/generated-dep2.js000066400000000000000000000000601415504077600311160ustar00rootroot00000000000000'use strict'; var num = 2; exports.num = num; rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/cjs/generated-dep3.js000066400000000000000000000000601415504077600311170ustar00rootroot00000000000000'use strict'; var num = 3; exports.num = num; rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/cjs/main1.js000066400000000000000000000002101415504077600273320ustar00rootroot00000000000000'use strict'; var dep1 = require('./generated-dep1.js'); var dep2 = require('./generated-dep2.js'); console.log(dep1.num + dep2.num); rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/cjs/main2.js000066400000000000000000000002101415504077600273330ustar00rootroot00000000000000'use strict'; var dep2 = require('./generated-dep2.js'); var dep3 = require('./generated-dep3.js'); console.log(dep2.num + dep3.num); rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/cjs/main3.js000066400000000000000000000002101415504077600273340ustar00rootroot00000000000000'use strict'; var dep1 = require('./generated-dep1.js'); var dep3 = require('./generated-dep3.js'); console.log(dep1.num + dep3.num); rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/es/000077500000000000000000000000001415504077600256265ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/es/generated-dep1.js000066400000000000000000000000431415504077600307460ustar00rootroot00000000000000var num = 1; export { num as n }; rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/es/generated-dep2.js000066400000000000000000000000431415504077600307470ustar00rootroot00000000000000var num = 2; export { num as n }; rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/es/generated-dep3.js000066400000000000000000000000431415504077600307500ustar00rootroot00000000000000var num = 3; export { num as n }; rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/es/main1.js000066400000000000000000000001751415504077600271740ustar00rootroot00000000000000import { n as num } from './generated-dep1.js'; import { n as num$1 } from './generated-dep2.js'; console.log(num + num$1); rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/es/main2.js000066400000000000000000000001751415504077600271750ustar00rootroot00000000000000import { n as num } from './generated-dep2.js'; import { n as num$1 } from './generated-dep3.js'; console.log(num + num$1); rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/es/main3.js000066400000000000000000000001751415504077600271760ustar00rootroot00000000000000import { n as num } from './generated-dep1.js'; import { n as num$1 } from './generated-dep3.js'; console.log(num + num$1); rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/system/000077500000000000000000000000001415504077600265435ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/system/generated-dep1.js000066400000000000000000000002131415504077600316620ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var num = exports('n', 1); }) }; })); rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/system/generated-dep2.js000066400000000000000000000002131415504077600316630ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var num = exports('n', 2); }) }; })); rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/system/generated-dep3.js000066400000000000000000000002131415504077600316640ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var num = exports('n', 3); }) }; })); rollup-2.61.1/test/chunking-form/samples/multi-chunking/_expected/system/main1.js000066400000000000000000000004471415504077600301130ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/multi-chunking/_expected/system/main2.js000066400000000000000000000004471415504077600301140ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/multi-chunking/_expected/system/main3.js000066400000000000000000000004471415504077600301150ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/multi-chunking/dep1.js000066400000000000000000000000231415504077600244410ustar00rootroot00000000000000export var num = 1;rollup-2.61.1/test/chunking-form/samples/multi-chunking/dep2.js000066400000000000000000000000231415504077600244420ustar00rootroot00000000000000export var num = 2;rollup-2.61.1/test/chunking-form/samples/multi-chunking/dep3.js000066400000000000000000000000231415504077600244430ustar00rootroot00000000000000export var num = 3;rollup-2.61.1/test/chunking-form/samples/multi-chunking/main1.js000066400000000000000000000001461415504077600246230ustar00rootroot00000000000000import { num as num1 } from './dep1'; import { num as num2 } from './dep2'; console.log(num1 + num2);rollup-2.61.1/test/chunking-form/samples/multi-chunking/main2.js000066400000000000000000000001461415504077600246240ustar00rootroot00000000000000import { num as num1 } from './dep2'; import { num as num2 } from './dep3'; console.log(num1 + num2);rollup-2.61.1/test/chunking-form/samples/multi-chunking/main3.js000066400000000000000000000001461415504077600246250ustar00rootroot00000000000000import { num as num1 } from './dep1'; import { num as num2 } from './dep3'; console.log(num1 + num2);rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/000077500000000000000000000000001415504077600246255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/_config.js000066400000000000000000000003161415504077600265670ustar00rootroot00000000000000module.exports = { description: 'handles multiple entry points with a shared dependency', options: { input: ['main', 'other'], output: { chunkFileNames: 'chunks/[name].js' } }, runAmd: true }; rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/_expected/000077500000000000000000000000001415504077600265655ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/_expected/amd/000077500000000000000000000000001415504077600273265ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/_expected/amd/chunks/000077500000000000000000000000001415504077600306215ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/_expected/amd/chunks/shared.js000066400000000000000000000002031415504077600324200ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const sharedValue = 'shared'; exports.sharedValue = sharedValue; })); rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/_expected/amd/main.js000066400000000000000000000001631415504077600306100ustar00rootroot00000000000000define(['./chunks/shared'], (function (shared) { 'use strict'; assert.equal(shared.sharedValue, 'shared'); })); rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/_expected/amd/other.js000066400000000000000000000003101415504077600307770ustar00rootroot00000000000000define(['exports', './chunks/shared'], (function (exports, shared) { 'use strict'; exports.sharedValue = shared.sharedValue; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/_expected/cjs/000077500000000000000000000000001415504077600273445ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/_expected/cjs/chunks/000077500000000000000000000000001415504077600306375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/_expected/cjs/chunks/shared.js000066400000000000000000000001211415504077600324350ustar00rootroot00000000000000'use strict'; const sharedValue = 'shared'; exports.sharedValue = sharedValue; rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/_expected/cjs/main.js000066400000000000000000000001501415504077600306220ustar00rootroot00000000000000'use strict'; var shared = require('./chunks/shared.js'); assert.equal(shared.sharedValue, 'shared'); rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/_expected/cjs/other.js000066400000000000000000000002501415504077600310200ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var shared = require('./chunks/shared.js'); exports.sharedValue = shared.sharedValue; rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/_expected/es/000077500000000000000000000000001415504077600271745ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/_expected/es/chunks/000077500000000000000000000000001415504077600304675ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/_expected/es/chunks/shared.js000066400000000000000000000000741415504077600322740ustar00rootroot00000000000000const sharedValue = 'shared'; export { sharedValue as s }; rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/_expected/es/main.js000066400000000000000000000001351415504077600304550ustar00rootroot00000000000000import { s as sharedValue } from './chunks/shared.js'; assert.equal(sharedValue, 'shared'); rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/_expected/es/other.js000066400000000000000000000000671415504077600306560ustar00rootroot00000000000000export { s as sharedValue } from './chunks/shared.js'; rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/_expected/system/000077500000000000000000000000001415504077600301115ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/_expected/system/chunks/000077500000000000000000000000001415504077600314045ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/_expected/system/chunks/shared.js000066400000000000000000000002341415504077600332070ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const sharedValue = exports('s', 'shared'); }) }; })); rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/_expected/system/main.js000066400000000000000000000003651415504077600313770ustar00rootroot00000000000000System.register(['./chunks/shared.js'], (function () { 'use strict'; var sharedValue; return { setters: [function (module) { sharedValue = module.s; }], execute: (function () { assert.equal(sharedValue, 'shared'); }) }; })); rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/_expected/system/other.js000066400000000000000000000003151415504077600315670ustar00rootroot00000000000000System.register(['./chunks/shared.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('sharedValue', module.s); }], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/main.js000066400000000000000000000001161415504077600261050ustar00rootroot00000000000000import { sharedValue } from './shared'; assert.equal(sharedValue, 'shared'); rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/other.js000066400000000000000000000000501415504077600262770ustar00rootroot00000000000000export { sharedValue } from './shared'; rollup-2.61.1/test/chunking-form/samples/multiple-entry-points/shared.js000066400000000000000000000000451415504077600264300ustar00rootroot00000000000000export const sharedValue = 'shared'; rollup-2.61.1/test/chunking-form/samples/namespace-imports-from-chunks/000077500000000000000000000000001415504077600262025ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-imports-from-chunks/_config.js000066400000000000000000000001751415504077600301470ustar00rootroot00000000000000module.exports = { description: 'handle namespace imports from chunks', options: { input: ['main1.js', 'main2.js'] } }; rollup-2.61.1/test/chunking-form/samples/namespace-imports-from-chunks/_expected/000077500000000000000000000000001415504077600301425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-imports-from-chunks/_expected/amd/000077500000000000000000000000001415504077600307035ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-imports-from-chunks/_expected/amd/main1.js000066400000000000000000000002361415504077600322470ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var p = 42; exports.p = p; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/namespace-imports-from-chunks/_expected/amd/main2.js000066400000000000000000000001261415504077600322460ustar00rootroot00000000000000define(['./main1'], (function (main1) { 'use strict'; console.log( main1.p ); })); rollup-2.61.1/test/chunking-form/samples/namespace-imports-from-chunks/_expected/cjs/000077500000000000000000000000001415504077600307215ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-imports-from-chunks/_expected/cjs/main1.js000066400000000000000000000001531415504077600322630ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var p = 42; exports.p = p; rollup-2.61.1/test/chunking-form/samples/namespace-imports-from-chunks/_expected/cjs/main2.js000066400000000000000000000001131415504077600322600ustar00rootroot00000000000000'use strict'; var main1 = require('./main1.js'); console.log( main1.p ); rollup-2.61.1/test/chunking-form/samples/namespace-imports-from-chunks/_expected/es/000077500000000000000000000000001415504077600305515ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-imports-from-chunks/_expected/es/main1.js000066400000000000000000000000331415504077600321100ustar00rootroot00000000000000var p = 42; export { p }; rollup-2.61.1/test/chunking-form/samples/namespace-imports-from-chunks/_expected/es/main2.js000066400000000000000000000000631415504077600321140ustar00rootroot00000000000000import { p } from './main1.js'; console.log( p ); rollup-2.61.1/test/chunking-form/samples/namespace-imports-from-chunks/_expected/system/000077500000000000000000000000001415504077600314665ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-imports-from-chunks/_expected/system/main1.js000066400000000000000000000002121415504077600330240ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var p = exports('p', 42); }) }; })); rollup-2.61.1/test/chunking-form/samples/namespace-imports-from-chunks/_expected/system/main2.js000066400000000000000000000003061415504077600330310ustar00rootroot00000000000000System.register(['./main1.js'], (function () { 'use strict'; var p; return { setters: [function (module) { p = module.p; }], execute: (function () { console.log( p ); }) }; })); rollup-2.61.1/test/chunking-form/samples/namespace-imports-from-chunks/main1.js000066400000000000000000000000231415504077600275400ustar00rootroot00000000000000export var p = 42; rollup-2.61.1/test/chunking-form/samples/namespace-imports-from-chunks/main2.js000066400000000000000000000000761415504077600275510ustar00rootroot00000000000000import * as main1 from './main1.js'; console.log( main1.p ); rollup-2.61.1/test/chunking-form/samples/namespace-object-import/000077500000000000000000000000001415504077600250315ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-object-import/_config.js000066400000000000000000000001601415504077600267700ustar00rootroot00000000000000module.exports = { description: 'namespace object import', options: { input: ['main1.js', 'main2.js'] } }; rollup-2.61.1/test/chunking-form/samples/namespace-object-import/_expected/000077500000000000000000000000001415504077600267715ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-object-import/_expected/amd/000077500000000000000000000000001415504077600275325ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-object-import/_expected/amd/generated-main2.js000066400000000000000000000003461415504077600330350ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/namespace-object-import/_expected/amd/main1.js000066400000000000000000000001721415504077600310750ustar00rootroot00000000000000define(['./generated-main2'], (function (main2) { 'use strict'; console.log(main2.a); console.log(main2.main2); })); rollup-2.61.1/test/chunking-form/samples/namespace-object-import/_expected/amd/main2.js000066400000000000000000000003121415504077600310720ustar00rootroot00000000000000define(['exports', './generated-main2'], (function (exports, main2) { 'use strict'; exports.a = main2.a; exports.b = main2.b; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/namespace-object-import/_expected/cjs/000077500000000000000000000000001415504077600275505ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-object-import/_expected/cjs/generated-main2.js000066400000000000000000000002541415504077600330510ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/namespace-object-import/_expected/cjs/main1.js000066400000000000000000000001561415504077600311150ustar00rootroot00000000000000'use strict'; var main2 = require('./generated-main2.js'); console.log(main2.a); console.log(main2.main2); rollup-2.61.1/test/chunking-form/samples/namespace-object-import/_expected/cjs/main2.js000066400000000000000000000002511415504077600311120ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var main2 = require('./generated-main2.js'); exports.a = main2.a; exports.b = main2.b; rollup-2.61.1/test/chunking-form/samples/namespace-object-import/_expected/es/000077500000000000000000000000001415504077600274005ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-object-import/_expected/es/generated-main2.js000066400000000000000000000002051415504077600326750ustar00rootroot00000000000000var a = 'a'; var b = 'a'; var main2 = /*#__PURE__*/Object.freeze({ __proto__: null, a: a, b: b }); export { a, b, main2 as m }; rollup-2.61.1/test/chunking-form/samples/namespace-object-import/_expected/es/main1.js000066400000000000000000000001341415504077600307410ustar00rootroot00000000000000import { a, m as main2 } from './generated-main2.js'; console.log(a); console.log(main2); rollup-2.61.1/test/chunking-form/samples/namespace-object-import/_expected/es/main2.js000066400000000000000000000000551415504077600307440ustar00rootroot00000000000000export { a, b } from './generated-main2.js'; rollup-2.61.1/test/chunking-form/samples/namespace-object-import/_expected/system/000077500000000000000000000000001415504077600303155ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-object-import/_expected/system/generated-main2.js000066400000000000000000000004351415504077600336170ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/namespace-object-import/_expected/system/main1.js000066400000000000000000000004021415504077600316540ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/namespace-object-import/_expected/system/main2.js000066400000000000000000000003241415504077600316600ustar00rootroot00000000000000System.register(['./generated-main2.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports({ a: module.a, b: module.b }); }], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/namespace-object-import/dep.js000066400000000000000000000000731415504077600261370ustar00rootroot00000000000000import * as main2 from './main2.js'; console.log(main2.a);rollup-2.61.1/test/chunking-form/samples/namespace-object-import/main1.js000066400000000000000000000001141415504077600263700ustar00rootroot00000000000000import * as main2 from './main2.js'; import './dep.js'; console.log(main2);rollup-2.61.1/test/chunking-form/samples/namespace-object-import/main2.js000066400000000000000000000000471415504077600263760ustar00rootroot00000000000000export var a = 'a'; export var b = 'a';rollup-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/000077500000000000000000000000001415504077600266405ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/_config.js000066400000000000000000000003511415504077600306010ustar00rootroot00000000000000module.exports = { description: 'renders namespaces with reexports that conflict with existing imports', options: { input: ['main1.js', 'main2.js', 'main3.js'], external: ['external'], output: { exports: 'named' } } }; rollup-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/000077500000000000000000000000001415504077600306005ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/amd/000077500000000000000000000000001415504077600313415ustar00rootroot00000000000000generated-dep.js000066400000000000000000000001711415504077600343230ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const reexported = 1; exports.reexported = reexported; })); generated-index.js000066400000000000000000000004031415504077600346600ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/amd/main1.js000066400000000000000000000002161415504077600327030ustar00rootroot00000000000000define(['./generated-index', './generated-dep', 'external'], (function (index, dep, external) { 'use strict'; console.log(index.lib); })); rollup-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/amd/main2.js000066400000000000000000000002231415504077600327020ustar00rootroot00000000000000define(['./generated-index', './generated-dep', 'external'], (function (index, dep, external) { 'use strict'; console.log(dep.reexported); })); rollup-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/amd/main3.js000066400000000000000000000001411415504077600327020ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log(dep.reexported); })); rollup-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/cjs/000077500000000000000000000000001415504077600313575ustar00rootroot00000000000000generated-dep.js000066400000000000000000000001071415504077600343400ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/cjs'use strict'; const reexported = 1; exports.reexported = reexported; generated-index.js000066400000000000000000000003551415504077600347040ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/cjs/main1.js000066400000000000000000000002111415504077600327140ustar00rootroot00000000000000'use strict'; var index = require('./generated-index.js'); require('./generated-dep.js'); require('external'); console.log(index.lib); rollup-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/cjs/main2.js000066400000000000000000000002141415504077600327200ustar00rootroot00000000000000'use strict'; require('./generated-index.js'); var dep = require('./generated-dep.js'); require('external'); console.log(dep.reexported); rollup-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/cjs/main3.js000066400000000000000000000001261415504077600327230ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log(dep.reexported); rollup-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/es/000077500000000000000000000000001415504077600312075ustar00rootroot00000000000000generated-dep.js000066400000000000000000000000631415504077600341710ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/esconst reexported = 1; export { reexported as r }; generated-index.js000066400000000000000000000003471415504077600345350ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/es/main1.js000066400000000000000000000001641415504077600325530ustar00rootroot00000000000000import { l as lib } from './generated-index.js'; import './generated-dep.js'; import 'external'; console.log(lib); rollup-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/es/main2.js000066400000000000000000000002021415504077600325450ustar00rootroot00000000000000import './generated-index.js'; import { r as reexported } from './generated-dep.js'; import 'external'; console.log(reexported); rollup-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/es/main3.js000066400000000000000000000001201415504077600325450ustar00rootroot00000000000000import { r as reexported } from './generated-dep.js'; console.log(reexported); rollup-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/system/000077500000000000000000000000001415504077600321245ustar00rootroot00000000000000generated-dep.js000066400000000000000000000002241415504077600351050ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000007001415504077600354430ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/system/main1.js000066400000000000000000000004261415504077600334710ustar00rootroot00000000000000System.register(['./generated-index.js', './generated-dep.js', 'external'], (function () { 'use strict'; var lib; return { setters: [function (module) { lib = module.l; }, function () {}, function () {}], execute: (function () { console.log(lib); }) }; })); rollup-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/system/main2.js000066400000000000000000000004531415504077600334720ustar00rootroot00000000000000System.register(['./generated-index.js', './generated-dep.js', 'external'], (function () { 'use strict'; var reexported; return { setters: [function () {}, function (module) { reexported = module.r; }, function () {}], execute: (function () { console.log(reexported); }) }; })); rollup-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/_expected/system/main3.js000066400000000000000000000003471415504077600334750ustar00rootroot00000000000000System.register(['./generated-dep.js'], (function () { 'use strict'; var reexported; return { setters: [function (module) { reexported = module.r; }], execute: (function () { console.log(reexported); }) }; })); rollup-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/dep.js000066400000000000000000000000351415504077600277440ustar00rootroot00000000000000export const reexported = 1; rollup-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/index.js000066400000000000000000000001441415504077600303040ustar00rootroot00000000000000export { reexported } from './dep'; import { reexported } from 'external'; console.log(reexported); rollup-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/main1.js000066400000000000000000000000621415504077600302010ustar00rootroot00000000000000import * as lib from './index'; console.log(lib); rollup-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/main2.js000066400000000000000000000000751415504077600302060ustar00rootroot00000000000000import * as lib from './index'; console.log(lib.reexported); rollup-2.61.1/test/chunking-form/samples/namespace-reexport-name-conflict/main3.js000066400000000000000000000000751415504077600302070ustar00rootroot00000000000000import { reexported } from './dep'; console.log(reexported); rollup-2.61.1/test/chunking-form/samples/namespace-reexports/000077500000000000000000000000001415504077600243065ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-reexports/_config.js000066400000000000000000000002551415504077600262520ustar00rootroot00000000000000module.exports = { description: 'namespace rendering with reexports', options: { input: ['main.js', 'hsl2hsv.js', 'index.js'], output: { exports: 'named' } } }; rollup-2.61.1/test/chunking-form/samples/namespace-reexports/_expected/000077500000000000000000000000001415504077600262465ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-reexports/_expected/amd/000077500000000000000000000000001415504077600270075ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-reexports/_expected/amd/generated-index.js000066400000000000000000000003741415504077600324140ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/namespace-reexports/_expected/amd/hsl2hsv.js000066400000000000000000000005131415504077600307350ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/namespace-reexports/_expected/amd/index.js000066400000000000000000000003331415504077600304530ustar00rootroot00000000000000define(['exports', './hsl2hsv', './generated-index'], (function (exports, hsl2hsv, index) { 'use strict'; exports.hsl2hsv = hsl2hsv["default"]; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/namespace-reexports/_expected/amd/main.js000066400000000000000000000004301415504077600302660ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/namespace-reexports/_expected/cjs/000077500000000000000000000000001415504077600270255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-reexports/_expected/cjs/generated-index.js000066400000000000000000000003271415504077600324300ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/namespace-reexports/_expected/cjs/hsl2hsv.js000066400000000000000000000004071415504077600307550ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/namespace-reexports/_expected/cjs/index.js000066400000000000000000000003001415504077600304630ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var hsl2hsv = require('./hsl2hsv.js'); require('./generated-index.js'); exports.hsl2hsv = hsl2hsv["default"]; rollup-2.61.1/test/chunking-form/samples/namespace-reexports/_expected/cjs/main.js000066400000000000000000000004071415504077600303100ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/namespace-reexports/_expected/es/000077500000000000000000000000001415504077600266555ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-reexports/_expected/es/generated-index.js000066400000000000000000000002741415504077600322610ustar00rootroot00000000000000import 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-2.61.1/test/chunking-form/samples/namespace-reexports/_expected/es/hsl2hsv.js000066400000000000000000000002551415504077600306060ustar00rootroot00000000000000var 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-2.61.1/test/chunking-form/samples/namespace-reexports/_expected/es/index.js000066400000000000000000000001221415504077600303150ustar00rootroot00000000000000export { default as hsl2hsv } from './hsl2hsv.js'; import './generated-index.js'; rollup-2.61.1/test/chunking-form/samples/namespace-reexports/_expected/es/main.js000066400000000000000000000002521415504077600301360ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/namespace-reexports/_expected/system/000077500000000000000000000000001415504077600275725ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-reexports/_expected/system/generated-index.js000066400000000000000000000005721415504077600331770ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/namespace-reexports/_expected/system/hsl2hsv.js000066400000000000000000000005121415504077600315170ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/namespace-reexports/_expected/system/index.js000066400000000000000000000003641415504077600312420ustar00rootroot00000000000000System.register(['./hsl2hsv.js', './generated-index.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('hsl2hsv', module["default"]); }, function () {}], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/namespace-reexports/_expected/system/main.js000066400000000000000000000005261415504077600310570ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/namespace-reexports/hsl2hsv.js000066400000000000000000000002351415504077600262350ustar00rootroot00000000000000export 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-2.61.1/test/chunking-form/samples/namespace-reexports/index.js000066400000000000000000000001361415504077600257530ustar00rootroot00000000000000export { default as hsl2hsv } from './hsl2hsv'; var hsl2hsv = 'asdf'; console.log(hsl2hsv); rollup-2.61.1/test/chunking-form/samples/namespace-reexports/main.js000066400000000000000000000001741415504077600255720ustar00rootroot00000000000000import * as lib from './index'; import { p } from './hsl2hsv'; console.log(p); export default new Map(Object.entries(lib)); rollup-2.61.1/test/chunking-form/samples/namespace-retracing/000077500000000000000000000000001415504077600242315ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-retracing/_config.js000066400000000000000000000002171415504077600261730ustar00rootroot00000000000000module.exports = { description: 'internal reexported namespaces over chunk boundaries', options: { input: ['main-a.js', 'main-b.js'] } }; rollup-2.61.1/test/chunking-form/samples/namespace-retracing/_expected/000077500000000000000000000000001415504077600261715ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-retracing/_expected/amd/000077500000000000000000000000001415504077600267325ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-retracing/_expected/amd/generated-other.js000066400000000000000000000004521415504077600323460ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/namespace-retracing/_expected/amd/main-a.js000066400000000000000000000002001415504077600304220ustar00rootroot00000000000000define(['./generated-other'], (function (other) { 'use strict'; other.Other.doSomething(); other.Broken.doSomething(); })); rollup-2.61.1/test/chunking-form/samples/namespace-retracing/_expected/amd/main-b.js000066400000000000000000000001431415504077600304310ustar00rootroot00000000000000define(['./generated-other'], (function (other) { 'use strict'; other.Other.doSomething(); })); rollup-2.61.1/test/chunking-form/samples/namespace-retracing/_expected/cjs/000077500000000000000000000000001415504077600267505ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-retracing/_expected/cjs/generated-other.js000066400000000000000000000003611415504077600323630ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/namespace-retracing/_expected/cjs/main-a.js000066400000000000000000000001641415504077600304510ustar00rootroot00000000000000'use strict'; var other = require('./generated-other.js'); other.Other.doSomething(); other.Broken.doSomething(); rollup-2.61.1/test/chunking-form/samples/namespace-retracing/_expected/cjs/main-b.js000066400000000000000000000001301415504077600304430ustar00rootroot00000000000000'use strict'; var other = require('./generated-other.js'); other.Other.doSomething(); rollup-2.61.1/test/chunking-form/samples/namespace-retracing/_expected/es/000077500000000000000000000000001415504077600266005ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-retracing/_expected/es/generated-other.js000066400000000000000000000003261415504077600322140ustar00rootroot00000000000000class 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-2.61.1/test/chunking-form/samples/namespace-retracing/_expected/es/main-a.js000066400000000000000000000001541415504077600303000ustar00rootroot00000000000000import { O as Other, B as Broken } from './generated-other.js'; Other.doSomething(); Broken.doSomething(); rollup-2.61.1/test/chunking-form/samples/namespace-retracing/_expected/es/main-b.js000066400000000000000000000001111415504077600302720ustar00rootroot00000000000000import { O as Other } from './generated-other.js'; Other.doSomething(); rollup-2.61.1/test/chunking-form/samples/namespace-retracing/_expected/system/000077500000000000000000000000001415504077600275155ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-retracing/_expected/system/generated-other.js000066400000000000000000000005361415504077600331340ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/namespace-retracing/_expected/system/main-a.js000066400000000000000000000004221415504077600312130ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/namespace-retracing/_expected/system/main-b.js000066400000000000000000000003331415504077600312150ustar00rootroot00000000000000System.register(['./generated-other.js'], (function () { 'use strict'; var Other; return { setters: [function (module) { Other = module.O; }], execute: (function () { Other.doSomething(); }) }; })); rollup-2.61.1/test/chunking-form/samples/namespace-retracing/broken.js000066400000000000000000000001231415504077600260430ustar00rootroot00000000000000export class Broken { } Broken.doSomething = function() { console.log('broken'); }rollup-2.61.1/test/chunking-form/samples/namespace-retracing/foo.js000066400000000000000000000000311415504077600253440ustar00rootroot00000000000000export * from './broken';rollup-2.61.1/test/chunking-form/samples/namespace-retracing/main-a.js000066400000000000000000000001651415504077600257330ustar00rootroot00000000000000import * as other from './other'; import * as foo from './foo'; other.Other.doSomething(); foo.Broken.doSomething();rollup-2.61.1/test/chunking-form/samples/namespace-retracing/main-b.js000066400000000000000000000000751415504077600257340ustar00rootroot00000000000000import * as other from './other'; other.Other.doSomething();rollup-2.61.1/test/chunking-form/samples/namespace-retracing/other.js000066400000000000000000000002131415504077600257040ustar00rootroot00000000000000import { Broken } from './broken'; Broken.doSomething(); export class Other { } Other.doSomething = function() { console.log('other'); }rollup-2.61.1/test/chunking-form/samples/namespace-tostring/000077500000000000000000000000001415504077600241245ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/000077500000000000000000000000001415504077600314245ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_config.js000066400000000000000000000003351415504077600333670ustar00rootroot00000000000000module.exports = { description: 'adds Symbol.toStringTag property to dynamic imports of entry chunks with default export mode', options: { input: ['main', 'foo'], output: { namespaceToStringTag: true } } }; rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expected/000077500000000000000000000000001415504077600333645ustar00rootroot00000000000000amd/000077500000000000000000000000001415504077600340465ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expectedfoo.js000066400000000000000000000001101415504077600351570ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expected/amddefine((function () { 'use strict'; var foo = 42; return foo; })); main.js000066400000000000000000000005551415504077600353350ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expected/amddefine(['require'], (function (require) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, [Symbol.toStringTag]: 'Module', 'default': e }); } new Promise(function (resolve, reject) { require(['./foo'], function (m) { resolve(/*#__PURE__*/_interopNamespaceDefaultOnly(m)); }, reject); }).then(console.log); })); cjs/000077500000000000000000000000001415504077600340645ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expectedfoo.js000066400000000000000000000000641415504077600352050ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expected/cjs'use strict'; var foo = 42; module.exports = foo; main.js000066400000000000000000000004311415504077600353440ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expected/cjs'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, [Symbol.toStringTag]: 'Module', 'default': e }); } Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('./foo.js')); }).then(console.log); es/000077500000000000000000000000001415504077600337145ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expectedfoo.js000066400000000000000000000000521415504077600350320ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expected/esvar foo = 42; export { foo as default }; main.js000066400000000000000000000000461415504077600351760ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expected/esimport('./foo.js').then(console.log); system/000077500000000000000000000000001415504077600346315ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/_expectedfoo.js000066400000000000000000000002221415504077600357460ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002451415504077600361140ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/foo.js000066400000000000000000000000231415504077600325400ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import-default-mode/main.js000066400000000000000000000000431415504077600327030ustar00rootroot00000000000000import('./foo').then(console.log); rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import/000077500000000000000000000000001415504077600270605ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import/_config.js000066400000000000000000000002301415504077600310150ustar00rootroot00000000000000module.exports = { description: 'adds Symbol.toStringTag property to dynamic imports', options: { output: { namespaceToStringTag: true } } }; rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/000077500000000000000000000000001415504077600310205ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/amd/000077500000000000000000000000001415504077600315615ustar00rootroot00000000000000generated-foo.js000066400000000000000000000002171415504077600345570ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const bar = 42; exports.bar = bar; exports[Symbol.toStringTag] = 'Module'; })); rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/amd/main.js000066400000000000000000000002561415504077600330460ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-foo'], resolve, reject); }).then(console.log); })); rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/cjs/000077500000000000000000000000001415504077600315775ustar00rootroot00000000000000generated-foo.js000066400000000000000000000001341415504077600345730ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/cjs'use strict'; exports[Symbol.toStringTag] = 'Module'; const bar = 42; exports.bar = bar; rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/cjs/main.js000066400000000000000000000001601415504077600330560ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-foo.js'); }).then(console.log); rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/es/000077500000000000000000000000001415504077600314275ustar00rootroot00000000000000generated-foo.js000066400000000000000000000000411415504077600344200ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/esconst bar = 42; export { bar }; rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/es/main.js000066400000000000000000000000601415504077600327050ustar00rootroot00000000000000import('./generated-foo.js').then(console.log); rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/system/000077500000000000000000000000001415504077600323445ustar00rootroot00000000000000generated-foo.js000066400000000000000000000002201415504077600353340ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const bar = exports('bar', 42); }) }; })); rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import/_expected/system/main.js000066400000000000000000000002571415504077600336320ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-foo.js').then(console.log); }) }; })); rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import/foo.js000066400000000000000000000000271415504077600302000ustar00rootroot00000000000000export const bar = 42; rollup-2.61.1/test/chunking-form/samples/namespace-tostring/dynamic-import/main.js000066400000000000000000000000431415504077600303370ustar00rootroot00000000000000import('./foo').then(console.log); rollup-2.61.1/test/chunking-form/samples/namespace-tracing/000077500000000000000000000000001415504077600237025ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_config.js000066400000000000000000000001611415504077600256420ustar00rootroot00000000000000module.exports = { description: 'Something', options: { input: ['main-a.js', 'main-b.js', 'main-c.js'] } }; rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/000077500000000000000000000000001415504077600256425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/amd/000077500000000000000000000000001415504077600264035ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/amd/generated-bar.js000066400000000000000000000002041415504077600314350ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function bar() { console.log('bar'); } exports.bar = bar; })); rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/amd/generated-broken.js000066400000000000000000000002201415504077600321470ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function broken() { console.log('broken'); } exports.broken = broken; })); rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/amd/generated-foo.js000066400000000000000000000002041415504077600314540ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function foo() { console.log('foo'); } exports.foo = foo; })); rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/amd/main-a.js000066400000000000000000000001771415504077600301100ustar00rootroot00000000000000define(['./generated-foo', './generated-broken'], (function (foo, broken) { 'use strict'; foo.foo(); broken.broken(); })); rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/amd/main-b.js000066400000000000000000000002651415504077600301070ustar00rootroot00000000000000define(['./generated-foo', './generated-bar', './generated-broken'], (function (foo, bar, broken) { 'use strict'; foo.foo(); broken.broken(); bar.bar(); broken.broken(); })); rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/amd/main-c.js000066400000000000000000000001771415504077600301120ustar00rootroot00000000000000define(['./generated-bar', './generated-broken'], (function (bar, broken) { 'use strict'; bar.bar(); broken.broken(); })); rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/cjs/000077500000000000000000000000001415504077600264215ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/cjs/generated-bar.js000066400000000000000000000001141415504077600314530ustar00rootroot00000000000000'use strict'; function bar() { console.log('bar'); } exports.bar = bar; rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/cjs/generated-broken.js000066400000000000000000000001301415504077600321650ustar00rootroot00000000000000'use strict'; function broken() { console.log('broken'); } exports.broken = broken; rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/cjs/generated-foo.js000066400000000000000000000001141415504077600314720ustar00rootroot00000000000000'use strict'; function foo() { console.log('foo'); } exports.foo = foo; rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/cjs/main-a.js000066400000000000000000000002041415504077600301150ustar00rootroot00000000000000'use strict'; var foo = require('./generated-foo.js'); var broken = require('./generated-broken.js'); foo.foo(); broken.broken(); rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/cjs/main-b.js000066400000000000000000000003111415504077600301150ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/cjs/main-c.js000066400000000000000000000002041415504077600301170ustar00rootroot00000000000000'use strict'; var bar = require('./generated-bar.js'); var broken = require('./generated-broken.js'); bar.bar(); broken.broken(); rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/es/000077500000000000000000000000001415504077600262515ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/es/generated-bar.js000066400000000000000000000000771415504077600313130ustar00rootroot00000000000000function bar() { console.log('bar'); } export { bar as b }; rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/es/generated-broken.js000066400000000000000000000001101415504077600320130ustar00rootroot00000000000000function broken() { console.log('broken'); } export { broken as b }; rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/es/generated-foo.js000066400000000000000000000000771415504077600313320ustar00rootroot00000000000000function foo() { console.log('foo'); } export { foo as f }; rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/es/main-a.js000066400000000000000000000001661415504077600277540ustar00rootroot00000000000000import { f as foo } from './generated-foo.js'; import { b as broken } from './generated-broken.js'; foo(); broken(); rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/es/main-b.js000066400000000000000000000002661415504077600277560ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/es/main-c.js000066400000000000000000000001661415504077600277560ustar00rootroot00000000000000import { b as bar } from './generated-bar.js'; import { b as broken } from './generated-broken.js'; bar(); broken(); rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/system/000077500000000000000000000000001415504077600271665ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/system/generated-bar.js000066400000000000000000000003111415504077600322170ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('b', bar); function bar() { console.log('bar'); } }) }; })); rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/system/generated-broken.js000066400000000000000000000003221415504077600327350ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('b', broken); function broken() { console.log('broken'); } }) }; })); rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/system/generated-foo.js000066400000000000000000000003111415504077600322360ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('f', foo); function foo() { console.log('foo'); } }) }; })); rollup-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/system/main-a.js000066400000000000000000000004441415504077600306700ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/system/main-b.js000066400000000000000000000006021415504077600306650ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/namespace-tracing/_expected/system/main-c.js000066400000000000000000000004441415504077600306720ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/namespace-tracing/bar.js000066400000000000000000000001121415504077600247760ustar00rootroot00000000000000export * from './broken'; export function bar() { console.log('bar'); }rollup-2.61.1/test/chunking-form/samples/namespace-tracing/broken.js000066400000000000000000000000661415504077600255220ustar00rootroot00000000000000export function broken() { console.log('broken'); } rollup-2.61.1/test/chunking-form/samples/namespace-tracing/foo.js000066400000000000000000000001121415504077600250150ustar00rootroot00000000000000export * from './broken'; export function foo() { console.log('foo'); }rollup-2.61.1/test/chunking-form/samples/namespace-tracing/main-a.js000066400000000000000000000000671415504077600254050ustar00rootroot00000000000000import * as foo from './foo'; foo.foo(); foo.broken();rollup-2.61.1/test/chunking-form/samples/namespace-tracing/main-b.js000066400000000000000000000001571415504077600254060ustar00rootroot00000000000000import * as foo from './foo'; import * as bar from './bar'; foo.foo(); foo.broken(); bar.bar(); bar.broken(); rollup-2.61.1/test/chunking-form/samples/namespace-tracing/main-c.js000066400000000000000000000000701415504077600254010ustar00rootroot00000000000000import * as bar from './bar'; bar.bar(); bar.broken(); rollup-2.61.1/test/chunking-form/samples/nested-chunks/000077500000000000000000000000001415504077600230745ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/nested-chunks/_config.js000066400000000000000000000002261415504077600250360ustar00rootroot00000000000000module.exports = { description: 'nested chunks', options: { input: { main1: 'main1', 'nested/main2': 'main2' }, external: './external.js' } }; rollup-2.61.1/test/chunking-form/samples/nested-chunks/_expected/000077500000000000000000000000001415504077600250345ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/nested-chunks/_expected/amd/000077500000000000000000000000001415504077600255755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/nested-chunks/_expected/amd/generated-dep.js000066400000000000000000000001531415504077600306360ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const value = 42; exports.value = value; })); rollup-2.61.1/test/chunking-form/samples/nested-chunks/_expected/amd/generated-dynamic.js000066400000000000000000000001531415504077600315120ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const value = 43; exports.value = value; })); rollup-2.61.1/test/chunking-form/samples/nested-chunks/_expected/amd/main1.js000066400000000000000000000015221415504077600271400ustar00rootroot00000000000000define(['require', './generated-dep'], (function (require, dep) { 'use strict'; 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); } 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__*/_interopNamespace(m)); }, reject); }).then(result => console.log(result)); })); rollup-2.61.1/test/chunking-form/samples/nested-chunks/_expected/amd/nested/000077500000000000000000000000001415504077600270575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/nested-chunks/_expected/amd/nested/main2.js000066400000000000000000000015251415504077600304260ustar00rootroot00000000000000define(['require', '../generated-dep'], (function (require, dep) { 'use strict'; 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); } 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__*/_interopNamespace(m)); }, reject); }).then(result => console.log(result)); })); rollup-2.61.1/test/chunking-form/samples/nested-chunks/_expected/cjs/000077500000000000000000000000001415504077600256135ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/nested-chunks/_expected/cjs/generated-dep.js000066400000000000000000000000711415504077600306530ustar00rootroot00000000000000'use strict'; const value = 42; exports.value = value; rollup-2.61.1/test/chunking-form/samples/nested-chunks/_expected/cjs/generated-dynamic.js000066400000000000000000000000711415504077600315270ustar00rootroot00000000000000'use strict'; const value = 43; exports.value = value; rollup-2.61.1/test/chunking-form/samples/nested-chunks/_expected/cjs/main1.js000066400000000000000000000013611415504077600271570ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); 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); } console.log('main1', dep.value); Promise.resolve().then(function () { return require('./generated-dynamic.js'); }).then(result => console.log(result)); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('./external.js')); }).then(result => console.log(result)); rollup-2.61.1/test/chunking-form/samples/nested-chunks/_expected/cjs/nested/000077500000000000000000000000001415504077600270755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/nested-chunks/_expected/cjs/nested/main2.js000066400000000000000000000013641415504077600304450ustar00rootroot00000000000000'use strict'; var dep = require('../generated-dep.js'); 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); } console.log('main2', dep.value); Promise.resolve().then(function () { return require('../generated-dynamic.js'); }).then(result => console.log(result)); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('../external.js')); }).then(result => console.log(result)); rollup-2.61.1/test/chunking-form/samples/nested-chunks/_expected/es/000077500000000000000000000000001415504077600254435ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/nested-chunks/_expected/es/generated-dep.js000066400000000000000000000000521415504077600305020ustar00rootroot00000000000000const value = 42; export { value as v }; rollup-2.61.1/test/chunking-form/samples/nested-chunks/_expected/es/generated-dynamic.js000066400000000000000000000000451415504077600313600ustar00rootroot00000000000000const value = 43; export { value }; rollup-2.61.1/test/chunking-form/samples/nested-chunks/_expected/es/main1.js000066400000000000000000000003231415504077600270040ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/nested-chunks/_expected/es/nested/000077500000000000000000000000001415504077600267255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/nested-chunks/_expected/es/nested/main2.js000066400000000000000000000003261415504077600302720ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/nested-chunks/_expected/system/000077500000000000000000000000001415504077600263605ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/nested-chunks/_expected/system/generated-dep.js000066400000000000000000000002201415504077600314140ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('v', 42); }) }; })); rollup-2.61.1/test/chunking-form/samples/nested-chunks/_expected/system/generated-dynamic.js000066400000000000000000000002241415504077600322740ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('value', 43); }) }; })); rollup-2.61.1/test/chunking-form/samples/nested-chunks/_expected/system/main1.js000066400000000000000000000006101415504077600277200ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/nested-chunks/_expected/system/nested/000077500000000000000000000000001415504077600276425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/nested-chunks/_expected/system/nested/main2.js000066400000000000000000000006131415504077600312060ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/nested-chunks/dep.js000066400000000000000000000000311415504077600241740ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/chunking-form/samples/nested-chunks/dynamic.js000066400000000000000000000000311415504077600250500ustar00rootroot00000000000000export const value = 43; rollup-2.61.1/test/chunking-form/samples/nested-chunks/main1.js000066400000000000000000000002721415504077600244400ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/nested-chunks/main2.js000066400000000000000000000002721415504077600244410ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/nested-dynamic-imports/000077500000000000000000000000001415504077600247205ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_config.js000066400000000000000000000001711415504077600266610ustar00rootroot00000000000000module.exports = { description: 'handles dynamic imports containing dynamic imports', options: { input: 'main' } }; rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/000077500000000000000000000000001415504077600266605ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/amd/000077500000000000000000000000001415504077600274215ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/amd/generated-dynamic1.js000066400000000000000000000002731415504077600334220ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic2'], resolve, reject); }); console.log('dynamic1'); })); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/amd/generated-dynamic2.js000066400000000000000000000002731415504077600334230ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic3'], resolve, reject); }); console.log('dynamic2'); })); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/amd/generated-dynamic3.js000066400000000000000000000002731415504077600334240ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic4'], resolve, reject); }); console.log('dynamic3'); })); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/amd/generated-dynamic4.js000066400000000000000000000002731415504077600334250ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic5'], resolve, reject); }); console.log('dynamic4'); })); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/amd/generated-dynamic5.js000066400000000000000000000001051415504077600334200ustar00rootroot00000000000000define((function () { 'use strict'; console.log('dynamic5'); })); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/amd/main.js000066400000000000000000000002671415504077600307100ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./generated-dynamic1'], resolve, reject); }); console.log('main'); })); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/cjs/000077500000000000000000000000001415504077600274375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/cjs/generated-dynamic1.js000066400000000000000000000001741415504077600334400ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic2.js'); }); console.log('dynamic1'); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/cjs/generated-dynamic2.js000066400000000000000000000001741415504077600334410ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic3.js'); }); console.log('dynamic2'); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/cjs/generated-dynamic3.js000066400000000000000000000001741415504077600334420ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic4.js'); }); console.log('dynamic3'); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/cjs/generated-dynamic4.js000066400000000000000000000001741415504077600334430ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic5.js'); }); console.log('dynamic4'); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/cjs/generated-dynamic5.js000066400000000000000000000000501415504077600334350ustar00rootroot00000000000000'use strict'; console.log('dynamic5'); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/cjs/main.js000066400000000000000000000001701415504077600307170ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./generated-dynamic1.js'); }); console.log('main'); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/es/000077500000000000000000000000001415504077600272675ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/es/generated-dynamic1.js000066400000000000000000000000741415504077600332670ustar00rootroot00000000000000import('./generated-dynamic2.js'); console.log('dynamic1'); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/es/generated-dynamic2.js000066400000000000000000000000741415504077600332700ustar00rootroot00000000000000import('./generated-dynamic3.js'); console.log('dynamic2'); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/es/generated-dynamic3.js000066400000000000000000000000741415504077600332710ustar00rootroot00000000000000import('./generated-dynamic4.js'); console.log('dynamic3'); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/es/generated-dynamic4.js000066400000000000000000000000741415504077600332720ustar00rootroot00000000000000import('./generated-dynamic5.js'); console.log('dynamic4'); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/es/generated-dynamic5.js000066400000000000000000000000311415504077600332640ustar00rootroot00000000000000console.log('dynamic5'); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/es/main.js000066400000000000000000000000701415504077600305460ustar00rootroot00000000000000import('./generated-dynamic1.js'); console.log('main'); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/system/000077500000000000000000000000001415504077600302045ustar00rootroot00000000000000generated-dynamic1.js000066400000000000000000000002761415504077600341310ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002761415504077600341320ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002761415504077600341330ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002761415504077600341340ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002021415504077600341220ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('dynamic5'); }) }; })); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/_expected/system/main.js000066400000000000000000000002721415504077600314670ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./generated-dynamic1.js'); console.log('main'); }) }; })); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/dynamic1.js000066400000000000000000000000621415504077600267610ustar00rootroot00000000000000import('./dynamic2.js'); console.log('dynamic1'); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/dynamic2.js000066400000000000000000000000621415504077600267620ustar00rootroot00000000000000import('./dynamic3.js'); console.log('dynamic2'); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/dynamic3.js000066400000000000000000000000621415504077600267630ustar00rootroot00000000000000import('./dynamic4.js'); console.log('dynamic3'); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/dynamic4.js000066400000000000000000000000621415504077600267640ustar00rootroot00000000000000import('./dynamic5.js'); console.log('dynamic4'); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/dynamic5.js000066400000000000000000000000311415504077600267610ustar00rootroot00000000000000console.log('dynamic5'); rollup-2.61.1/test/chunking-form/samples/nested-dynamic-imports/main.js000066400000000000000000000000561415504077600262030ustar00rootroot00000000000000import('./dynamic1.js'); console.log('main'); rollup-2.61.1/test/chunking-form/samples/no-minify-internal-exports/000077500000000000000000000000001415504077600255425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/no-minify-internal-exports/_config.js000066400000000000000000000003001415504077600274750ustar00rootroot00000000000000module.exports = { description: 'allows to disable the minification of internal exports', options: { input: ['main1.js', 'main2.js'], output: { minifyInternalExports: false } } }; rollup-2.61.1/test/chunking-form/samples/no-minify-internal-exports/_expected/000077500000000000000000000000001415504077600275025ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/no-minify-internal-exports/_expected/amd/000077500000000000000000000000001415504077600302435ustar00rootroot00000000000000generated-shared2.js000066400000000000000000000004071415504077600340070ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/no-minify-internal-exports/_expected/amd/main1.js000066400000000000000000000002101415504077600315770ustar00rootroot00000000000000define(['./generated-shared2'], (function (shared2) { 'use strict'; console.log(shared2.shared1, shared2.shared2, shared2.foo); })); rollup-2.61.1/test/chunking-form/samples/no-minify-internal-exports/_expected/amd/main2.js000066400000000000000000000002121415504077600316020ustar00rootroot00000000000000define(['./generated-shared2'], (function (shared2) { 'use strict'; console.log(shared2.shared1, shared2.shared2, shared2.foo$1); })); rollup-2.61.1/test/chunking-form/samples/no-minify-internal-exports/_expected/cjs/000077500000000000000000000000001415504077600302615ustar00rootroot00000000000000generated-shared2.js000066400000000000000000000003171415504077600340250ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/no-minify-internal-exports/_expected/cjs/main1.js000066400000000000000000000001751415504077600316270ustar00rootroot00000000000000'use strict'; var shared2 = require('./generated-shared2.js'); console.log(shared2.shared1, shared2.shared2, shared2.foo); rollup-2.61.1/test/chunking-form/samples/no-minify-internal-exports/_expected/cjs/main2.js000066400000000000000000000001771415504077600316320ustar00rootroot00000000000000'use strict'; var shared2 = require('./generated-shared2.js'); console.log(shared2.shared1, shared2.shared2, shared2.foo$1); rollup-2.61.1/test/chunking-form/samples/no-minify-internal-exports/_expected/es/000077500000000000000000000000001415504077600301115ustar00rootroot00000000000000generated-shared2.js000066400000000000000000000002311415504077600336500ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/no-minify-internal-exports/_expected/es/main1.js000066400000000000000000000001451415504077600314540ustar00rootroot00000000000000import { shared1, shared2, foo } from './generated-shared2.js'; console.log(shared1, shared2, foo); rollup-2.61.1/test/chunking-form/samples/no-minify-internal-exports/_expected/es/main2.js000066400000000000000000000001561415504077600314570ustar00rootroot00000000000000import { shared1, shared2, foo$1 as foo } from './generated-shared2.js'; console.log(shared1, shared2, foo); rollup-2.61.1/test/chunking-form/samples/no-minify-internal-exports/_expected/system/000077500000000000000000000000001415504077600310265ustar00rootroot00000000000000generated-shared2.js000066400000000000000000000004421415504077600345710ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/no-minify-internal-exports/_expected/system/main1.js000066400000000000000000000004661415504077600323770ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/no-minify-internal-exports/_expected/system/main2.js000066400000000000000000000004701415504077600323730ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/no-minify-internal-exports/main1.js000066400000000000000000000001601415504077600271020ustar00rootroot00000000000000import { shared1, foo } from './shared1'; import shared2 from './shared2'; console.log(shared1, shared2, foo); rollup-2.61.1/test/chunking-form/samples/no-minify-internal-exports/main2.js000066400000000000000000000001641415504077600271070ustar00rootroot00000000000000import { shared1 } from './shared1'; import shared2, { foo } from './shared2'; console.log(shared1, shared2, foo); rollup-2.61.1/test/chunking-form/samples/no-minify-internal-exports/shared1.js000066400000000000000000000000751415504077600274310ustar00rootroot00000000000000export const shared1 = 'shared1'; export const foo = 'foo1'; rollup-2.61.1/test/chunking-form/samples/no-minify-internal-exports/shared2.js000066400000000000000000000000651415504077600274310ustar00rootroot00000000000000export default 'shared2'; export const foo = 'foo2'; rollup-2.61.1/test/chunking-form/samples/no-treeshake-imports/000077500000000000000000000000001415504077600244015ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/no-treeshake-imports/_config.js000066400000000000000000000004401415504077600263410ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/no-treeshake-imports/_expected/000077500000000000000000000000001415504077600263415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/no-treeshake-imports/_expected/amd/000077500000000000000000000000001415504077600271025ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/no-treeshake-imports/_expected/amd/generated-empty.js000066400000000000000000000000541415504077600325310ustar00rootroot00000000000000define((function () { 'use strict'; })); rollup-2.61.1/test/chunking-form/samples/no-treeshake-imports/_expected/amd/main1.js000066400000000000000000000001611415504077600304430ustar00rootroot00000000000000define(['./generated-empty'], (function (empty) { 'use strict'; console.log('main1'); const unused = 1; })); rollup-2.61.1/test/chunking-form/samples/no-treeshake-imports/_expected/amd/main2.js000066400000000000000000000001611415504077600304440ustar00rootroot00000000000000define(['./generated-empty'], (function (empty) { 'use strict'; console.log('main2'); const unused = 2; })); rollup-2.61.1/test/chunking-form/samples/no-treeshake-imports/_expected/cjs/000077500000000000000000000000001415504077600271205ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/no-treeshake-imports/_expected/cjs/generated-empty.js000066400000000000000000000000171415504077600325460ustar00rootroot00000000000000'use strict'; rollup-2.61.1/test/chunking-form/samples/no-treeshake-imports/_expected/cjs/main1.js000066400000000000000000000001311415504077600304560ustar00rootroot00000000000000'use strict'; require('./generated-empty.js'); console.log('main1'); const unused = 1; rollup-2.61.1/test/chunking-form/samples/no-treeshake-imports/_expected/cjs/main2.js000066400000000000000000000001311415504077600304570ustar00rootroot00000000000000'use strict'; require('./generated-empty.js'); console.log('main2'); const unused = 2; rollup-2.61.1/test/chunking-form/samples/no-treeshake-imports/_expected/es/000077500000000000000000000000001415504077600267505ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/no-treeshake-imports/_expected/es/generated-empty.js000066400000000000000000000000011415504077600323670ustar00rootroot00000000000000 rollup-2.61.1/test/chunking-form/samples/no-treeshake-imports/_expected/es/main1.js000066400000000000000000000001101415504077600303030ustar00rootroot00000000000000import './generated-empty.js'; console.log('main1'); const unused = 1; rollup-2.61.1/test/chunking-form/samples/no-treeshake-imports/_expected/es/main2.js000066400000000000000000000001101415504077600303040ustar00rootroot00000000000000import './generated-empty.js'; console.log('main2'); const unused = 2; rollup-2.61.1/test/chunking-form/samples/no-treeshake-imports/_expected/system/000077500000000000000000000000001415504077600276655ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/no-treeshake-imports/_expected/system/generated-empty.js000066400000000000000000000001471415504077600333170ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/no-treeshake-imports/_expected/system/main1.js000066400000000000000000000003071415504077600312300ustar00rootroot00000000000000System.register(['./generated-empty.js'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { console.log('main1'); const unused = 1; }) }; })); rollup-2.61.1/test/chunking-form/samples/no-treeshake-imports/_expected/system/main2.js000066400000000000000000000003071415504077600312310ustar00rootroot00000000000000System.register(['./generated-empty.js'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { console.log('main2'); const unused = 2; }) }; })); rollup-2.61.1/test/chunking-form/samples/no-treeshake-imports/empty.js000066400000000000000000000000001415504077600260630ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/no-treeshake-imports/main1.js000066400000000000000000000000731415504077600257440ustar00rootroot00000000000000import './empty'; console.log('main1'); const unused = 1; rollup-2.61.1/test/chunking-form/samples/no-treeshake-imports/main2.js000066400000000000000000000000731415504077600257450ustar00rootroot00000000000000import './empty'; console.log('main2'); const unused = 2; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/000077500000000000000000000000001415504077600254755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/allow-extension/000077500000000000000000000000001415504077600306255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_config.js000066400000000000000000000002151415504077600325650ustar00rootroot00000000000000module.exports = { description: 'Never creates facades for allow-extension', options: { preserveEntrySignatures: 'allow-extension' } }; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_expected/000077500000000000000000000000001415504077600325655ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_expected/amd/000077500000000000000000000000001415504077600333265ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001441415504077600371640ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_expected/amddefine(['./main'], (function (main) { 'use strict'; globalThis.sharedDynamic = main.shared; })); main.js000066400000000000000000000006571415504077600345410ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_expected/cjs/000077500000000000000000000000001415504077600333445ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001311415504077600371760ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_expected/cjs'use strict'; var main = require('./main.js'); globalThis.sharedDynamic = main.shared; main.js000066400000000000000000000005261415504077600345520ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_expected/es/000077500000000000000000000000001415504077600331745ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001151415504077600370300ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_expected/esimport { s as shared } from './main.js'; globalThis.sharedDynamic = shared; main.js000066400000000000000000000002621415504077600343770ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-entry-signatures/allow-extension/_expected/system/000077500000000000000000000000001415504077600341115ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000003401415504077600377450ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000005051415504077600353140ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-entry-signatures/allow-extension/dynamic.js000066400000000000000000000001071415504077600326050ustar00rootroot00000000000000import { shared } from './lib.js'; globalThis.sharedDynamic = shared; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/allow-extension/lib.js000066400000000000000000000000401415504077600317230ustar00rootroot00000000000000export const shared = 'shared'; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/allow-extension/main.js000066400000000000000000000002261415504077600321070ustar00rootroot00000000000000import { shared } from './lib.js'; export const unused = 'unused'; export const dynamic = import('./dynamic.js'); globalThis.sharedStatic = shared; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/000077500000000000000000000000001415504077600322745ustar00rootroot00000000000000_config.js000066400000000000000000000002421415504077600341550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exportsmodule.exports = { description: 'Does not create a facade for exports-only if there are no exports', options: { preserveEntrySignatures: 'exports-only' } }; _expected/000077500000000000000000000000001415504077600341555ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exportsamd/000077500000000000000000000000001415504077600347165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/_expectedgenerated-dynamic.js000066400000000000000000000001441415504077600406330ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/_expected/amddefine(['./main'], (function (main) { 'use strict'; globalThis.sharedDynamic = main.shared; })); main.js000066400000000000000000000005171415504077600362030ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); cjs/000077500000000000000000000000001415504077600347345ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/_expectedgenerated-dynamic.js000066400000000000000000000001311415504077600406450ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003711415504077600362170ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const shared = 'shared'; Promise.resolve().then(function () { return require('./generated-dynamic.js'); }); globalThis.sharedStatic = shared; exports.shared = shared; es/000077500000000000000000000000001415504077600345645ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/_expectedgenerated-dynamic.js000066400000000000000000000001151415504077600404770ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/_expected/esimport { s as shared } from './main.js'; globalThis.sharedDynamic = shared; main.js000066400000000000000000000001701415504077600360440ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600355015ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/_expectedgenerated-dynamic.js000066400000000000000000000003401415504077600414140ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003621415504077600367640ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001071415504077600341750ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exportsimport { shared } from './lib.js'; globalThis.sharedDynamic = shared; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/lib.js000066400000000000000000000000401415504077600333720ustar00rootroot00000000000000export const shared = 'shared'; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only-no-exports/main.js000066400000000000000000000001371415504077600335570ustar00rootroot00000000000000import { shared } from './lib.js'; import('./dynamic.js'); globalThis.sharedStatic = shared; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only/000077500000000000000000000000001415504077600301605ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only/_config.js000066400000000000000000000002441415504077600321220ustar00rootroot00000000000000module.exports = { description: 'Creates a facade if necessary for exports-only if there are exports', options: { preserveEntrySignatures: 'exports-only' } }; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/000077500000000000000000000000001415504077600321205ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/amd/000077500000000000000000000000001415504077600326615ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001561415504077600365220ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/amddefine(['./generated-main'], (function (main) { 'use strict'; globalThis.sharedDynamic = main.shared; })); generated-main.js000066400000000000000000000005561415504077600360260ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003341415504077600340640ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/cjs/000077500000000000000000000000001415504077600326775ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001431415504077600365340ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000004261415504077600360400ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002731415504077600341040ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var main = require('./generated-main.js'); exports.dynamic = main.dynamic; exports.unused = main.unused; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/es/000077500000000000000000000000001415504077600325275ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001271415504077600363660ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/esimport { s as shared } from './generated-main.js'; globalThis.sharedDynamic = shared; generated-main.js000066400000000000000000000002741415504077600356710ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/es/main.js000066400000000000000000000001011415504077600340010ustar00rootroot00000000000000export { d as dynamic, u as unused } from './generated-main.js'; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only/_expected/system/000077500000000000000000000000001415504077600334445ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000003521415504077600373030ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000004721415504077600366060ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003361415504077600346510ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only/dynamic.js000066400000000000000000000001071415504077600321400ustar00rootroot00000000000000import { shared } from './lib.js'; globalThis.sharedDynamic = shared; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only/lib.js000066400000000000000000000000401415504077600312560ustar00rootroot00000000000000export const shared = 'shared'; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/exports-only/main.js000066400000000000000000000002261415504077600314420ustar00rootroot00000000000000import { shared } from './lib.js'; export const unused = 'unused'; export const dynamic = import('./dynamic.js'); globalThis.sharedStatic = shared; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/false/000077500000000000000000000000001415504077600265675ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/false/_config.js000066400000000000000000000002321415504077600305260ustar00rootroot00000000000000module.exports = { description: 'Does not include entry exports and does not preserve the signature', options: { preserveEntrySignatures: false } }; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/false/_expected/000077500000000000000000000000001415504077600305275ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/false/_expected/amd/000077500000000000000000000000001415504077600312705ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001441415504077600351260ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/false/_expected/amddefine(['./main'], (function (main) { 'use strict'; globalThis.sharedDynamic = main.shared; })); rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/false/_expected/amd/main.js000066400000000000000000000005171415504077600325550ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/false/_expected/cjs/000077500000000000000000000000001415504077600313065ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001311415504077600351400ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/false/_expected/cjs'use strict'; var main = require('./main.js'); globalThis.sharedDynamic = main.shared; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/false/_expected/cjs/main.js000066400000000000000000000003711415504077600325710ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const shared = 'shared'; Promise.resolve().then(function () { return require('./generated-dynamic.js'); }); globalThis.sharedStatic = shared; exports.shared = shared; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/false/_expected/es/000077500000000000000000000000001415504077600311365ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001151415504077600347720ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/false/_expected/esimport { s as shared } from './main.js'; globalThis.sharedDynamic = shared; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/false/_expected/es/main.js000066400000000000000000000001701415504077600324160ustar00rootroot00000000000000const shared = 'shared'; import('./generated-dynamic.js'); globalThis.sharedStatic = shared; export { shared as s }; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/false/_expected/system/000077500000000000000000000000001415504077600320535ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000003401415504077600357070ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-entry-signatures/false/_expected/system/main.js000066400000000000000000000003621415504077600333360ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const shared = exports('s', 'shared'); module.import('./generated-dynamic.js'); globalThis.sharedStatic = shared; }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/false/dynamic.js000066400000000000000000000001071415504077600305470ustar00rootroot00000000000000import { shared } from './lib.js'; globalThis.sharedDynamic = shared; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/false/lib.js000066400000000000000000000000401415504077600276650ustar00rootroot00000000000000export const shared = 'shared'; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/false/main.js000066400000000000000000000002261415504077600300510ustar00rootroot00000000000000import { shared } from './lib.js'; export const unused = 'unused'; export const dynamic = import('./dynamic.js'); globalThis.sharedStatic = shared; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/000077500000000000000000000000001415504077600313655ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_config.js000066400000000000000000000013461415504077600333330ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/000077500000000000000000000000001415504077600333255ustar00rootroot00000000000000amd/000077500000000000000000000000001415504077600340075ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expectedgenerated-allow-extension.js000066400000000000000000000005601415504077600414320ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); generated-dynamic.js000066400000000000000000000001441415504077600377240ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/amddefine(['./generated-main'], (function (strict) { 'use strict'; console.log(strict.shared); })); generated-dynamic2.js000066400000000000000000000001771415504077600400140ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001451415504077600400100ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/amddefine(['./generated-false'], (function (_false) { 'use strict'; console.log(_false.shared); })); generated-dynamic4.js000066400000000000000000000001711415504077600400100ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000005021415504077600373700ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); generated-main.js000066400000000000000000000004561415504077600372320ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000005601415504077600410330ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); generated-strict.js000066400000000000000000000002771415504077600376170ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/amddefine(['exports', './generated-main'], (function (exports, strict) { 'use strict'; exports.unused = strict.unused; Object.defineProperty(exports, '__esModule', { value: true }); })); cjs/000077500000000000000000000000001415504077600340255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expectedgenerated-allow-extension.js000066400000000000000000000004301415504077600414440ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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.js000066400000000000000000000001311415504077600377360ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001641415504077600400260ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001321415504077600400220ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001561415504077600400310ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003541415504077600374130ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const shared = 'shared'; console.log(shared); Promise.resolve().then(function () { return require('./generated-dynamic3.js'); }); exports.shared = shared; generated-main.js000066400000000000000000000003271415504077600372450ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000004301415504077600410450ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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.js000066400000000000000000000002371415504077600376310ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var strict = require('./generated-main.js'); exports.unused = strict.unused; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/es/000077500000000000000000000000001415504077600337345ustar00rootroot00000000000000generated-allow-extension.js000066400000000000000000000002061415504077600412750ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001111415504077600375640ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/esimport { s as shared } from './generated-main.js'; console.log(shared); generated-dynamic2.js000066400000000000000000000001241415504077600376520ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001121415504077600376500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/esimport { s as shared } from './generated-false.js'; console.log(shared); generated-dynamic4.js000066400000000000000000000001221415504077600376520ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001531415504077600372400ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002121415504077600370660ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002061415504077600406760ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000631415504077600374560ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expected/esexport { u as unused } from './generated-main.js'; system/000077500000000000000000000000001415504077600345725ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/_expectedgenerated-allow-extension.js000066400000000000000000000004161415504077600422150ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003341415504077600405100ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003471415504077600405760ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003351415504077600405740ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003451415504077600405760ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003451415504077600401600ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000004101415504077600400030ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000004161415504077600416160ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003111415504077600403670ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600344365ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugindynamic.js000066400000000000000000000000701415504077600364150ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/allow-extensionimport { shared } from './lib.js'; console.log(shared); lib.js000066400000000000000000000000401415504077600355340ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/allow-extensionexport const shared = 'shared'; main.js000066400000000000000000000001521415504077600357160ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/false/000077500000000000000000000000001415504077600324575ustar00rootroot00000000000000dynamic.js000066400000000000000000000000701415504077600343570ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/falseimport { shared } from './lib.js'; console.log(shared); rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/false/lib.js000066400000000000000000000000401415504077600335550ustar00rootroot00000000000000export const shared = 'shared'; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/false/main.js000066400000000000000000000001521415504077600337370ustar00rootroot00000000000000import { shared } from './lib.js'; console.log(shared); import('./dynamic.js'); export const unused = 42; not-specified/000077500000000000000000000000001415504077600340375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugindynamic.js000066400000000000000000000000701415504077600360160ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/not-specifiedimport { shared } from './lib.js'; console.log(shared); lib.js000066400000000000000000000000401415504077600351350ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/not-specifiedexport const shared = 'shared'; main.js000066400000000000000000000001521415504077600353170ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/strict/000077500000000000000000000000001415504077600326755ustar00rootroot00000000000000dynamic.js000066400000000000000000000000701415504077600345750ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/strictimport { shared } from './lib.js'; console.log(shared); rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/override-via-plugin/strict/lib.js000066400000000000000000000000401415504077600337730ustar00rootroot00000000000000export const shared = 'shared'; main.js000066400000000000000000000001521415504077600340760ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-entry-signatures/strict/000077500000000000000000000000001415504077600270055ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/strict/_config.js000066400000000000000000000002241415504077600307450ustar00rootroot00000000000000module.exports = { description: 'Creates a facade if necessary for strict entry signatures', options: { preserveEntrySignatures: 'strict' } }; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/000077500000000000000000000000001415504077600307455ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/amd/000077500000000000000000000000001415504077600315065ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001561415504077600353470ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/amddefine(['./generated-main'], (function (main) { 'use strict'; globalThis.sharedDynamic = main.shared; })); generated-main.js000066400000000000000000000005561415504077600346530ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/amd/main.js000066400000000000000000000003341415504077600327700ustar00rootroot00000000000000define(['exports', './generated-main'], (function (exports, main) { 'use strict'; exports.dynamic = main.dynamic; exports.unused = main.unused; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/cjs/000077500000000000000000000000001415504077600315245ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001431415504077600353610ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/cjs'use strict'; var main = require('./generated-main.js'); globalThis.sharedDynamic = main.shared; generated-main.js000066400000000000000000000004261415504077600346650ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/cjs/main.js000066400000000000000000000002731415504077600330100ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var main = require('./generated-main.js'); exports.dynamic = main.dynamic; exports.unused = main.unused; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/es/000077500000000000000000000000001415504077600313545ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000001271415504077600352130ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/esimport { s as shared } from './generated-main.js'; globalThis.sharedDynamic = shared; generated-main.js000066400000000000000000000002741415504077600345160ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/es/main.js000066400000000000000000000001011415504077600326260ustar00rootroot00000000000000export { d as dynamic, u as unused } from './generated-main.js'; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/system/000077500000000000000000000000001415504077600322715ustar00rootroot00000000000000generated-dynamic.js000066400000000000000000000003521415504077600361300ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000004721415504077600354330ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-entry-signatures/strict/_expected/system/main.js000066400000000000000000000003361415504077600335550ustar00rootroot00000000000000System.register(['./generated-main.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports({ dynamic: module.d, unused: module.u }); }], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/strict/dynamic.js000066400000000000000000000001071415504077600307650ustar00rootroot00000000000000import { shared } from './lib.js'; globalThis.sharedDynamic = shared; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/strict/lib.js000066400000000000000000000000401415504077600301030ustar00rootroot00000000000000export const shared = 'shared'; rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/strict/main.js000066400000000000000000000002261415504077600302670ustar00rootroot00000000000000import { shared } from './lib.js'; export const unused = 'unused'; export const dynamic = import('./dynamic.js'); globalThis.sharedStatic = shared; undefined-with-tainted-plugin-chunk/000077500000000000000000000000001415504077600343605ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures_config.js000066400000000000000000000004241415504077600363220ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/undefined-with-tainted-plugin-chunkmodule.exports = { description: 'Does not warn if preserveEntrySignatures is not set and an empty facade is created for a plugin chunk', options: { input: [], plugins: { buildStart() { this.emitFile({ type: 'chunk', id: 'main', name: 'entry' }); } } } }; _expected/000077500000000000000000000000001415504077600363205ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/undefined-with-tainted-plugin-chunkamd/000077500000000000000000000000001415504077600370615ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/undefined-with-tainted-plugin-chunk/_expectedgenerated-dynamic.js000066400000000000000000000001601415504077600427740ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/undefined-with-tainted-plugin-chunk/_expected/amddefine(['./generated-main'], (function (entry) { 'use strict'; globalThis.sharedDynamic = entry.shared; })); generated-entry.js000066400000000000000000000001071415504077600425120ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/undefined-with-tainted-plugin-chunk/_expected/amddefine(['./generated-main'], (function (entry) { 'use strict'; })); generated-main.js000066400000000000000000000004151415504077600422770ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/undefined-with-tainted-plugin-chunk/_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/000077500000000000000000000000001415504077600370775ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/undefined-with-tainted-plugin-chunk/_expectedgenerated-dynamic.js000066400000000000000000000001451415504077600430150ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/undefined-with-tainted-plugin-chunk/_expected/cjs'use strict'; var entry = require('./generated-main.js'); globalThis.sharedDynamic = entry.shared; generated-entry.js000066400000000000000000000000601415504077600425260ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/undefined-with-tainted-plugin-chunk/_expected/cjs'use strict'; require('./generated-main.js'); generated-main.js000066400000000000000000000002701415504077600423140ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/undefined-with-tainted-plugin-chunk/_expected/cjs'use strict'; const shared = 'shared'; Promise.resolve().then(function () { return require('./generated-dynamic.js'); }); globalThis.sharedStatic = shared; exports.shared = shared; es/000077500000000000000000000000001415504077600367275ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/undefined-with-tainted-plugin-chunk/_expectedgenerated-dynamic.js000066400000000000000000000001271415504077600426450ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/undefined-with-tainted-plugin-chunk/_expected/esimport { s as shared } from './generated-main.js'; globalThis.sharedDynamic = shared; generated-entry.js000066400000000000000000000000361415504077600423610ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/undefined-with-tainted-plugin-chunk/_expected/esimport './generated-main.js'; generated-main.js000066400000000000000000000001671415504077600421510ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/undefined-with-tainted-plugin-chunk/_expected/esconst shared = 'shared'; import('./generated-dynamic.js'); globalThis.sharedStatic = shared; export { shared as s }; system/000077500000000000000000000000001415504077600376445ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/undefined-with-tainted-plugin-chunk/_expectedgenerated-dynamic.js000066400000000000000000000003521415504077600435620ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/undefined-with-tainted-plugin-chunk/_expected/systemSystem.register(['./generated-main.js'], (function () { 'use strict'; var shared; return { setters: [function (module) { shared = module.s; }], execute: (function () { globalThis.sharedDynamic = shared; }) }; })); generated-entry.js000066400000000000000000000002311415504077600432730ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/undefined-with-tainted-plugin-chunk/_expected/systemSystem.register(['./generated-main.js'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { }) }; })); generated-main.js000066400000000000000000000003611415504077600430620ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/undefined-with-tainted-plugin-chunk/_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.js000066400000000000000000000001071415504077600363400ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/undefined-with-tainted-plugin-chunkimport { shared } from './lib.js'; globalThis.sharedDynamic = shared; lib.js000066400000000000000000000000401415504077600354560ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/undefined-with-tainted-plugin-chunkexport const shared = 'shared'; main.js000066400000000000000000000001351415504077600356410ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-entry-signatures/undefined-with-tainted-plugin-chunkimport { shared } from './lib.js'; import('./dynamic.js'); globalThis.sharedStatic = shared; rollup-2.61.1/test/chunking-form/samples/preserve-modules-auto-export-mode/000077500000000000000000000000001415504077600270315ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-auto-export-mode/_config.js000066400000000000000000000002571415504077600307770ustar00rootroot00000000000000module.exports = { description: 'Uses entry point semantics for all files when preserving modules', options: { input: 'main.js', output: { preserveModules: true } } }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/000077500000000000000000000000001415504077600307715ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/amd/000077500000000000000000000000001415504077600315325ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/amd/default.js000066400000000000000000000001171415504077600335130ustar00rootroot00000000000000define((function () { 'use strict'; var foo = 'default'; return foo; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/amd/main.js000066400000000000000000000011141415504077600330110ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/amd/named.js000066400000000000000000000002611415504077600331530ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const value = 'named'; exports.value = value; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/cjs/000077500000000000000000000000001415504077600315505ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/cjs/default.js000066400000000000000000000000731415504077600335320ustar00rootroot00000000000000'use strict'; var foo = 'default'; module.exports = foo; rollup-2.61.1/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/cjs/main.js000066400000000000000000000010251415504077600330300ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/cjs/named.js000066400000000000000000000001761415504077600331760ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const value = 'named'; exports.value = value; rollup-2.61.1/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/es/000077500000000000000000000000001415504077600314005ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/es/default.js000066400000000000000000000000611415504077600333570ustar00rootroot00000000000000var foo = 'default'; export { foo as default }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/es/main.js000066400000000000000000000004131415504077600326600ustar00rootroot00000000000000import foo from './default.js'; export { default } 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)); rollup-2.61.1/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/es/named.js000066400000000000000000000000521415504077600330170ustar00rootroot00000000000000const value = 'named'; export { value }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/system/000077500000000000000000000000001415504077600323155ustar00rootroot00000000000000default.js000066400000000000000000000002311415504077600342140ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/system/main.js000066400000000000000000000007651415504077600336070ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/preserve-modules-auto-export-mode/_expected/system/named.js000066400000000000000000000002311415504077600337330ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('value', 'named'); }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-auto-export-mode/default.js000066400000000000000000000000321415504077600310060ustar00rootroot00000000000000export default 'default'; rollup-2.61.1/test/chunking-form/samples/preserve-modules-auto-export-mode/main.js000066400000000000000000000004051415504077600303120ustar00rootroot00000000000000import 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-2.61.1/test/chunking-form/samples/preserve-modules-auto-export-mode/named.js000066400000000000000000000000361415504077600304520ustar00rootroot00000000000000export const value = 'named'; rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/000077500000000000000000000000001415504077600254455ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_config.js000066400000000000000000000004511415504077600274070ustar00rootroot00000000000000const commonjs = require('@rollup/plugin-commonjs'); module.exports = { description: 'Handles output from @rollup/plugin-commonjs', expectedWarnings: ['MIXED_EXPORTS'], options: { input: 'main.js', external: ['external'], plugins: [commonjs()], output: { preserveModules: true } } }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/000077500000000000000000000000001415504077600274055ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/000077500000000000000000000000001415504077600301465ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/_virtual/000077500000000000000000000000001415504077600317735ustar00rootroot00000000000000other.js_commonjs-exports.js000066400000000000000000000002561415504077600374200ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/_virtualdefine(['exports'], (function (exports) { 'use strict'; var other = {}; exports.__exports = other; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/commonjs.js000066400000000000000000000007451415504077600323370ustar00rootroot00000000000000define(['external', './other', './_virtual/other.js_commonjs-exports'], (function (require$$0, other$1, other) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); const external = require$$0__default["default"]; const { value } = other.__exports; console.log(external, value); var commonjs = 42; return commonjs; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/main.js000066400000000000000000000005241415504077600314310ustar00rootroot00000000000000define(['./commonjs', 'external'], (function (commonjs, require$$0) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); console.log(commonjs, require$$0__default["default"]); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/amd/other.js000066400000000000000000000002211415504077600316200ustar00rootroot00000000000000define(['./_virtual/other.js_commonjs-exports'], (function (other) { 'use strict'; other.__exports.value = 43; return other.__exports; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/000077500000000000000000000000001415504077600301645ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/_virtual/000077500000000000000000000000001415504077600320115ustar00rootroot00000000000000other.js_commonjs-exports.js000066400000000000000000000001731415504077600374340ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/_virtual'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var other = {}; exports.__exports = other; rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/commonjs.js000066400000000000000000000007571415504077600323600ustar00rootroot00000000000000'use strict'; var require$$0 = require('external'); require('./other.js'); var other = require('./_virtual/other.js_commonjs-exports.js'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); const external = require$$0__default["default"]; const { value } = other.__exports; console.log(external, value); var commonjs = 42; module.exports = commonjs; rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/main.js000066400000000000000000000005251415504077600314500ustar00rootroot00000000000000'use strict'; var commonjs = require('./commonjs.js'); var require$$0 = require('external'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); console.log(commonjs, require$$0__default["default"]); rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/cjs/other.js000066400000000000000000000002171415504077600316430ustar00rootroot00000000000000'use strict'; var other = require('./_virtual/other.js_commonjs-exports.js'); other.__exports.value = 43; module.exports = other.__exports; rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/000077500000000000000000000000001415504077600300145ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/_virtual/000077500000000000000000000000001415504077600316415ustar00rootroot00000000000000other.js_commonjs-exports.js000066400000000000000000000000601415504077600372570ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/_virtualvar other = {}; export { other as __exports }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/commonjs.js000066400000000000000000000004211415504077600321740ustar00rootroot00000000000000import require$$0 from 'external'; import './other.js'; import { __exports as other } from './_virtual/other.js_commonjs-exports.js'; const external = require$$0; const { value } = other; console.log(external, value); var commonjs = 42; export { commonjs as default }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/main.js000066400000000000000000000001551415504077600312770ustar00rootroot00000000000000import commonjs from './commonjs.js'; import require$$0 from 'external'; console.log(commonjs, require$$0); rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/es/other.js000066400000000000000000000002611415504077600314720ustar00rootroot00000000000000import { __exports as other } from './_virtual/other.js_commonjs-exports.js'; export { __exports as default } from './_virtual/other.js_commonjs-exports.js'; other.value = 43; rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/000077500000000000000000000000001415504077600307315ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/_virtual/000077500000000000000000000000001415504077600325565ustar00rootroot00000000000000other.js_commonjs-exports.js000066400000000000000000000002261415504077600402000ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/_virtualSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var other = exports('__exports', {}); }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/commonjs.js000066400000000000000000000007401415504077600331150ustar00rootroot00000000000000System.register(['external', './other.js', './_virtual/other.js_commonjs-exports.js'], (function (exports) { 'use strict'; var require$$0, other; return { setters: [function (module) { require$$0 = module["default"]; }, function () {}, function (module) { other = module.__exports; }], execute: (function () { const external = require$$0; const { value } = other; console.log(external, value); var commonjs = exports('default', 42); }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/main.js000066400000000000000000000005051415504077600322130ustar00rootroot00000000000000System.register(['./commonjs.js', 'external'], (function () { 'use strict'; var commonjs, require$$0; return { setters: [function (module) { commonjs = module["default"]; }, function (module) { require$$0 = module["default"]; }], execute: (function () { console.log(commonjs, require$$0); }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/_expected/system/other.js000066400000000000000000000004431415504077600324110ustar00rootroot00000000000000System.register(['./_virtual/other.js_commonjs-exports.js'], (function (exports) { 'use strict'; var other; return { setters: [function (module) { other = module.__exports; exports('default', module.__exports); }], execute: (function () { other.value = 43; }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/commonjs.js000066400000000000000000000002011415504077600276210ustar00rootroot00000000000000const external = require('external'); const { value } = require('./other'); console.log(external, value); module.exports = 42; rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/main.js000066400000000000000000000001411415504077600267230ustar00rootroot00000000000000import value from './commonjs'; import external from 'external'; console.log(value, external); rollup-2.61.1/test/chunking-form/samples/preserve-modules-commonjs/other.js000066400000000000000000000000241415504077600271200ustar00rootroot00000000000000exports.value = 43; rollup-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace/000077500000000000000000000000001415504077600301205ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace/_config.js000066400000000000000000000003071415504077600320620ustar00rootroot00000000000000module.exports = { description: 'import namespace from chunks with default export mode when preserving modules', options: { input: ['main', 'lib'], output: { preserveModules: true } } }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/000077500000000000000000000000001415504077600320605ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/amd/000077500000000000000000000000001415504077600326215ustar00rootroot00000000000000lib.js000066400000000000000000000001131415504077600336410ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/amddefine((function () { 'use strict'; var lib = 'foo'; return lib; })); main.js000066400000000000000000000010651415504077600340260ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/cjs/000077500000000000000000000000001415504077600326375ustar00rootroot00000000000000lib.js000066400000000000000000000000671415504077600336670ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/cjs'use strict'; var lib = 'foo'; module.exports = lib; main.js000066400000000000000000000007331415504077600340450ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/es/000077500000000000000000000000001415504077600324675ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/es/lib.js000066400000000000000000000000551415504077600335730ustar00rootroot00000000000000var lib = 'foo'; export { lib as default }; main.js000066400000000000000000000001521415504077600336700ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/esimport * as lib from './lib.js'; export { lib }; console.log(lib); import('./lib.js').then(console.log); rollup-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace/_expected/system/000077500000000000000000000000001415504077600334045ustar00rootroot00000000000000lib.js000066400000000000000000000002251415504077600344300ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000004401415504077600346050ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace/lib.js000066400000000000000000000000261415504077600312220ustar00rootroot00000000000000export default 'foo'; rollup-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace/main.js000066400000000000000000000001511415504077600313770ustar00rootroot00000000000000import * as lib from './lib.js'; console.log(lib); import('./lib.js').then(console.log); export { lib }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace2/000077500000000000000000000000001415504077600302025ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_config.js000066400000000000000000000003071415504077600321440ustar00rootroot00000000000000module.exports = { description: 'import namespace from chunks with default export mode when preserving modules', options: { input: ['main', 'lib'], output: { preserveModules: true } } }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_expected/000077500000000000000000000000001415504077600321425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_expected/amd/000077500000000000000000000000001415504077600327035ustar00rootroot00000000000000lib.js000066400000000000000000000001131415504077600337230ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_expected/amddefine((function () { 'use strict'; var lib = 'foo'; return lib; })); main.js000066400000000000000000000004071415504077600341070ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_expected/cjs/000077500000000000000000000000001415504077600327215ustar00rootroot00000000000000lib.js000066400000000000000000000000671415504077600337510ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_expected/cjs'use strict'; var lib = 'foo'; module.exports = lib; main.js000066400000000000000000000003721415504077600341260ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_expected/es/000077500000000000000000000000001415504077600325515ustar00rootroot00000000000000lib.js000066400000000000000000000000551415504077600335760ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_expected/esvar lib = 'foo'; export { lib as default }; main.js000066400000000000000000000000641415504077600337540ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_expected/esimport * as lib from './lib.js'; console.log(lib); rollup-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace2/_expected/system/000077500000000000000000000000001415504077600334665ustar00rootroot00000000000000lib.js000066400000000000000000000002251415504077600345120ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003061415504077600346700ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace2/lib.js000066400000000000000000000000261415504077600313040ustar00rootroot00000000000000export default 'foo'; rollup-2.61.1/test/chunking-form/samples/preserve-modules-default-mode-namespace2/main.js000066400000000000000000000000631415504077600314630ustar00rootroot00000000000000import * as lib from './lib.js'; console.log(lib); rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-imports/000077500000000000000000000000001415504077600267375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-imports/_config.js000066400000000000000000000002561415504077600307040ustar00rootroot00000000000000module.exports = { description: 'dynamic imports are handled correctly when preserving modules', options: { input: ['main.js'], output: { preserveModules: true } } }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/000077500000000000000000000000001415504077600306775ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/amd/000077500000000000000000000000001415504077600314405ustar00rootroot00000000000000dynamic-included.js000066400000000000000000000002641415504077600351320ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/amddefine(['exports'], (function (exports) { 'use strict'; const value = 'included'; exports.value = value; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/amd/main.js000066400000000000000000000003031415504077600327160ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; new Promise(function (resolve, reject) { require(['./dynamic-included'], resolve, reject); }).then(result => console.log(result)); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/cjs/000077500000000000000000000000001415504077600314565ustar00rootroot00000000000000dynamic-included.js000066400000000000000000000002011415504077600351370ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const value = 'included'; exports.value = value; rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/cjs/main.js000066400000000000000000000002051415504077600327350ustar00rootroot00000000000000'use strict'; Promise.resolve().then(function () { return require('./dynamic-included.js'); }).then(result => console.log(result)); rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/es/000077500000000000000000000000001415504077600313065ustar00rootroot00000000000000dynamic-included.js000066400000000000000000000000551415504077600347760ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/esconst value = 'included'; export { value }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/es/main.js000066400000000000000000000001051415504077600325640ustar00rootroot00000000000000import('./dynamic-included.js').then(result => console.log(result)); rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/system/000077500000000000000000000000001415504077600322235ustar00rootroot00000000000000dynamic-included.js000066400000000000000000000002341415504077600357120ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { const value = exports('value', 'included'); }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-imports/_expected/system/main.js000066400000000000000000000003041415504077600335020ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.import('./dynamic-included.js').then(result => console.log(result)); }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-imports/dynamic-included.js000066400000000000000000000000411415504077600325010ustar00rootroot00000000000000export const value = 'included'; rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-imports/dynamic-removed.js000066400000000000000000000000401415504077600323520ustar00rootroot00000000000000export const value = 'removed'; rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-imports/main.js000066400000000000000000000002551415504077600302230ustar00rootroot00000000000000import('./dynamic-included').then(result => console.log(result)); const include = false; if (include) { import('./dynamic-removed').then(result => console.log(result)); } rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/000077500000000000000000000000001415504077600271765ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/_config.js000066400000000000000000000002651415504077600311430ustar00rootroot00000000000000module.exports = { description: 'Preserve modules properly handles internal namespace imports (#2576)', options: { input: ['main.js'], output: { preserveModules: true } } }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/000077500000000000000000000000001415504077600311365ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/amd/000077500000000000000000000000001415504077600316775ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/amd/m1.js000066400000000000000000000002761415504077600325570ustar00rootroot00000000000000define(['exports', './m2', './m3'], (function (exports, m2, m3) { 'use strict'; exports.m2 = m2; exports.m3 = m3; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/amd/m2.js000066400000000000000000000001111415504077600325440ustar00rootroot00000000000000define((function () { 'use strict'; var m2 = {a:1}; return m2; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/amd/m3.js000066400000000000000000000001111415504077600325450ustar00rootroot00000000000000define((function () { 'use strict'; var m3 = {b:2}; return m3; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/amd/main.js000066400000000000000000000001111415504077600331520ustar00rootroot00000000000000define(['./m1'], (function (m1) { 'use strict'; console.log(m1); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/cjs/000077500000000000000000000000001415504077600317155ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/cjs/m1.js000066400000000000000000000002561415504077600325730ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var m2 = require('./m2.js'); var m3 = require('./m3.js'); exports.m2 = m2; exports.m3 = m3; rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/cjs/m2.js000066400000000000000000000000651415504077600325720ustar00rootroot00000000000000'use strict'; var m2 = {a:1}; module.exports = m2; rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/cjs/m3.js000066400000000000000000000000651415504077600325730ustar00rootroot00000000000000'use strict'; var m3 = {b:2}; module.exports = m3; rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/cjs/main.js000066400000000000000000000000761415504077600332020ustar00rootroot00000000000000'use strict'; var m1 = require('./m1.js'); console.log(m1); rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/es/000077500000000000000000000000001415504077600315455ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/es/m1.js000066400000000000000000000001221415504077600324130ustar00rootroot00000000000000export { default as m2 } from './m2.js'; export { default as m3 } from './m3.js'; rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/es/m2.js000066400000000000000000000000531415504077600324170ustar00rootroot00000000000000var m2 = {a:1}; export { m2 as default }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/es/m3.js000066400000000000000000000000531415504077600324200ustar00rootroot00000000000000var m3 = {b:2}; export { m3 as default }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/es/main.js000066400000000000000000000000611415504077600330240ustar00rootroot00000000000000import * as m1 from './m1.js'; console.log(m1); rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/system/000077500000000000000000000000001415504077600324625ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/system/m1.js000066400000000000000000000004131415504077600333330ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/system/m2.js000066400000000000000000000002241415504077600333340ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var m2 = exports('default', {a:1}); }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/system/m3.js000066400000000000000000000002241415504077600333350ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var m3 = exports('default', {b:2}); }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/_expected/system/main.js000066400000000000000000000003021415504077600337370ustar00rootroot00000000000000System.register(['./m1.js'], (function () { 'use strict'; var m1; return { setters: [function (module) { m1 = module; }], execute: (function () { console.log(m1); }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/m1.js000066400000000000000000000001361415504077600300510ustar00rootroot00000000000000import m2 from './m2.js'; import m3 from './m3.js'; // console.log('m1'); export { m2, m3 }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/m2.js000066400000000000000000000000431415504077600300470ustar00rootroot00000000000000var m2 = {a:1}; export default m2; rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/m3.js000066400000000000000000000000431415504077600300500ustar00rootroot00000000000000var m3 = {b:2}; export default m3; rollup-2.61.1/test/chunking-form/samples/preserve-modules-dynamic-namespace/main.js000066400000000000000000000000611415504077600304550ustar00rootroot00000000000000import * as ms from './m1.js'; console.log(ms); rollup-2.61.1/test/chunking-form/samples/preserve-modules-empty/000077500000000000000000000000001415504077600247565ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-empty/_config.js000066400000000000000000000002311415504077600267140ustar00rootroot00000000000000module.exports = { description: 'Preserve modules remove empty dependencies', options: { input: 'main.js', output: { preserveModules: true } } }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-empty/_expected/000077500000000000000000000000001415504077600267165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-empty/_expected/amd/000077500000000000000000000000001415504077600274575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-empty/_expected/amd/main.js000066400000000000000000000001231415504077600307350ustar00rootroot00000000000000define(['./two'], (function (two) { 'use strict'; window.APP = { a: two }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-empty/_expected/amd/two.js000066400000000000000000000001041415504077600306210ustar00rootroot00000000000000define((function () { 'use strict'; var a = {}; return a; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-empty/_expected/cjs/000077500000000000000000000000001415504077600274755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-empty/_expected/cjs/main.js000066400000000000000000000001101415504077600307470ustar00rootroot00000000000000'use strict'; var two = require('./two.js'); window.APP = { a: two }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-empty/_expected/cjs/two.js000066400000000000000000000000601415504077600306400ustar00rootroot00000000000000'use strict'; var a = {}; module.exports = a; rollup-2.61.1/test/chunking-form/samples/preserve-modules-empty/_expected/es/000077500000000000000000000000001415504077600273255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-empty/_expected/es/main.js000066400000000000000000000000571415504077600306110ustar00rootroot00000000000000import a from './two.js'; window.APP = { a }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-empty/_expected/es/two.js000066400000000000000000000000461415504077600304740ustar00rootroot00000000000000var a = {}; export { a as default }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-empty/_expected/system/000077500000000000000000000000001415504077600302425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-empty/_expected/system/main.js000066400000000000000000000003171415504077600315250ustar00rootroot00000000000000System.register(['./two.js'], (function () { 'use strict'; var a; return { setters: [function (module) { a = module["default"]; }], execute: (function () { window.APP = { a }; }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-empty/_expected/system/two.js000066400000000000000000000002201415504077600314030ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var a = exports('default', {}); }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-empty/main.js000066400000000000000000000000571415504077600262420ustar00rootroot00000000000000import { a } from './one'; window.APP = { a };rollup-2.61.1/test/chunking-form/samples/preserve-modules-empty/one.js000066400000000000000000000001151415504077600260720ustar00rootroot00000000000000export { default as a } from './two'; export { default as b } from './three';rollup-2.61.1/test/chunking-form/samples/preserve-modules-empty/three.js000066400000000000000000000000221415504077600264150ustar00rootroot00000000000000export default {};rollup-2.61.1/test/chunking-form/samples/preserve-modules-empty/two.js000066400000000000000000000000221415504077600261170ustar00rootroot00000000000000export default {};rollup-2.61.1/test/chunking-form/samples/preserve-modules-export-alias/000077500000000000000000000000001415504077600262305ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-export-alias/_config.js000066400000000000000000000002551415504077600301740ustar00rootroot00000000000000module.exports = { description: 'confirm export aliases are preserved in modules', options: { input: ['main1.js', 'main2.js'], output: { preserveModules: true } } }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-export-alias/_expected/000077500000000000000000000000001415504077600301705ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-export-alias/_expected/amd/000077500000000000000000000000001415504077600307315ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-export-alias/_expected/amd/dep.js000066400000000000000000000002711415504077600320370ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const foo = 1; exports.bar = foo; exports.foo = foo; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-export-alias/_expected/amd/main1.js000066400000000000000000000003001415504077600322650ustar00rootroot00000000000000define(['exports', './dep'], (function (exports, dep) { 'use strict'; exports.bar = dep.foo; exports.foo = dep.foo; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-export-alias/_expected/amd/main2.js000066400000000000000000000002501415504077600322720ustar00rootroot00000000000000define(['exports', './dep'], (function (exports, dep) { 'use strict'; exports.bar = dep.foo; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-export-alias/_expected/cjs/000077500000000000000000000000001415504077600307475ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-export-alias/_expected/cjs/dep.js000066400000000000000000000002051415504077600320520ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const foo = 1; exports.bar = foo; exports.foo = foo; rollup-2.61.1/test/chunking-form/samples/preserve-modules-export-alias/_expected/cjs/main1.js000066400000000000000000000002371415504077600323140ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var dep = require('./dep.js'); exports.bar = dep.foo; exports.foo = dep.foo; rollup-2.61.1/test/chunking-form/samples/preserve-modules-export-alias/_expected/cjs/main2.js000066400000000000000000000002101415504077600323040ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var dep = require('./dep.js'); exports.bar = dep.foo; rollup-2.61.1/test/chunking-form/samples/preserve-modules-export-alias/_expected/es/000077500000000000000000000000001415504077600305775ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-export-alias/_expected/es/dep.js000066400000000000000000000000541415504077600317040ustar00rootroot00000000000000const foo = 1; export { foo as bar, foo }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-export-alias/_expected/es/main1.js000066400000000000000000000000541415504077600321410ustar00rootroot00000000000000export { foo as bar, foo } from './dep.js'; rollup-2.61.1/test/chunking-form/samples/preserve-modules-export-alias/_expected/es/main2.js000066400000000000000000000000471415504077600321440ustar00rootroot00000000000000export { foo as bar } from './dep.js'; rollup-2.61.1/test/chunking-form/samples/preserve-modules-export-alias/_expected/system/000077500000000000000000000000001415504077600315145ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-export-alias/_expected/system/dep.js000066400000000000000000000002401415504077600326160ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const foo = 1; exports({ foo: foo, bar: foo }); }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-export-alias/_expected/system/main1.js000066400000000000000000000003201415504077600330520ustar00rootroot00000000000000System.register(['./dep.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports({ bar: module.foo, foo: module.foo }); }], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-export-alias/_expected/system/main2.js000066400000000000000000000002751415504077600330640ustar00rootroot00000000000000System.register(['./dep.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('bar', module.foo); }], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-export-alias/dep.js000066400000000000000000000000531415504077600273340ustar00rootroot00000000000000const foo = 1; export { foo, foo as bar };rollup-2.61.1/test/chunking-form/samples/preserve-modules-export-alias/main1.js000066400000000000000000000000411415504077600275660ustar00rootroot00000000000000export { foo, bar } from './dep';rollup-2.61.1/test/chunking-form/samples/preserve-modules-export-alias/main2.js000066400000000000000000000000341415504077600275710ustar00rootroot00000000000000export { bar } from './dep';rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/000077500000000000000000000000001415504077600270535ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_config.js000066400000000000000000000010241415504077600310120ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'entryFileNames pattern supported in combination with preserveModules', options: { input: 'src/main.ts', output: { entryFileNames: 'entry-[name]-[format]-[ext][extname][assetExtname].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-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/000077500000000000000000000000001415504077600310135ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/000077500000000000000000000000001415504077600315545ustar00rootroot00000000000000entry-foo-amd-ts.ts.js000066400000000000000000000001101415504077600355550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amddefine((function () { 'use strict'; var foo = 42; return foo; })); entry-lorem-amd-str.str.str.js000066400000000000000000000010111415504077600372640ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_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; })); entry-main-amd-ts.ts.js000066400000000000000000000006341415504077600357310ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amddefine(['exports', './entry-foo-amd-ts.ts', './nested/entry-bar-amd-ts.ts', './nested/entry-baz-amd-ts.ts', './entry-lorem-amd-str.str.str', './entry-no-ext-amd-'], (function (exports, foo, bar, baz, lorem, noExt) { 'use strict'; exports.foo = foo; exports.bar = bar; exports.baz = baz; exports.lorem = lorem; exports.noExt = noExt; Object.defineProperty(exports, '__esModule', { value: true }); })); entry-no-ext-amd-.js000066400000000000000000000001221415504077600352130ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amddefine((function () { 'use strict'; var noExt = 'no-ext'; return noExt; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/nested/000077500000000000000000000000001415504077600330365ustar00rootroot00000000000000entry-bar-amd-ts.ts.js000066400000000000000000000001161415504077600370260ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/nesteddefine((function () { 'use strict'; var bar = 'banana'; return bar; })); entry-baz-amd-ts.ts.js000066400000000000000000000001201415504077600370310ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/amd/nesteddefine((function () { 'use strict'; var baz = 'whatever'; return baz; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/000077500000000000000000000000001415504077600315725ustar00rootroot00000000000000entry-foo-cjs-ts.ts.js000066400000000000000000000000641415504077600356210ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs'use strict'; var foo = 42; module.exports = foo; entry-lorem-cjs-str.str.str.js000066400000000000000000000007651415504077600373370ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_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; entry-main-cjs-ts.ts.js000066400000000000000000000006741415504077600357710ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var foo = require('./entry-foo-cjs-ts.ts.js'); var bar = require('./nested/entry-bar-cjs-ts.ts.js'); var baz = require('./nested/entry-baz-cjs-ts.ts.js'); var lorem = require('./entry-lorem-cjs-str.str.str.js'); var noExt = require('./entry-no-ext-cjs-.js'); exports.foo = foo; exports.bar = bar; exports.baz = baz; exports.lorem = lorem; exports.noExt = noExt; entry-no-ext-cjs-.js000066400000000000000000000000761415504077600352570ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs'use strict'; var noExt = 'no-ext'; module.exports = noExt; rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/nested/000077500000000000000000000000001415504077600330545ustar00rootroot00000000000000entry-bar-cjs-ts.ts.js000066400000000000000000000000721415504077600370630ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/nested'use strict'; var bar = 'banana'; module.exports = bar; entry-baz-cjs-ts.ts.js000066400000000000000000000000741415504077600370750ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/cjs/nested'use strict'; var baz = 'whatever'; module.exports = baz; rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/000077500000000000000000000000001415504077600314225ustar00rootroot00000000000000entry-foo-es-ts.ts.js000066400000000000000000000000521415504077600352760ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/esvar foo = 42; export { foo as default }; entry-lorem-es-str.str.str.js000066400000000000000000000007531415504077600370140ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_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 }; entry-main-es-ts.ts.js000066400000000000000000000004721415504077600354450ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/esexport { default as foo } from './entry-foo-es-ts.ts.js'; export { default as bar } from './nested/entry-bar-es-ts.ts.js'; export { default as baz } from './nested/entry-baz-es-ts.ts.js'; export { default as lorem } from './entry-lorem-es-str.str.str.js'; export { default as noExt } from './entry-no-ext-es-.js'; entry-no-ext-es-.js000066400000000000000000000000641415504077600347340ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/esvar noExt = 'no-ext'; export { noExt as default }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/nested/000077500000000000000000000000001415504077600327045ustar00rootroot00000000000000entry-bar-es-ts.ts.js000066400000000000000000000000601415504077600365400ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/nestedvar bar = 'banana'; export { bar as default }; entry-baz-es-ts.ts.js000066400000000000000000000000621415504077600365520ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/es/nestedvar baz = 'whatever'; export { baz as default }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/000077500000000000000000000000001415504077600323375ustar00rootroot00000000000000entry-foo-system-ts.ts.js000066400000000000000000000002221415504077600371270ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var foo = exports('default', 42); }) }; })); entry-lorem-system-str.str.str.js000066400000000000000000000011211415504077600406340ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_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."); }) }; })); entry-main-system-ts.ts.js000066400000000000000000000011471415504077600372770ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/systemSystem.register(['./entry-foo-system-ts.ts.js', './nested/entry-bar-system-ts.ts.js', './nested/entry-baz-system-ts.ts.js', './entry-lorem-system-str.str.str.js', './entry-no-ext-system-.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('lorem', module["default"]); }, function (module) { exports('noExt', module["default"]); }], execute: (function () { }) }; })); entry-no-ext-system-.js000066400000000000000000000002321415504077600365630ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/nested/000077500000000000000000000000001415504077600336215ustar00rootroot00000000000000entry-bar-system-ts.ts.js000066400000000000000000000002301415504077600403710ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/nestedSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var bar = exports('default', 'banana'); }) }; })); entry-baz-system-ts.ts.js000066400000000000000000000002321415504077600404030ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/_expected/system/nestedSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var baz = exports('default', 'whatever'); }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/src/000077500000000000000000000000001415504077600276425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/src/foo.ts000066400000000000000000000000231415504077600307700ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/src/lorem.str000066400000000000000000000006761415504077600315230ustar00rootroot00000000000000Lorem 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-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/src/main.ts000066400000000000000000000004621415504077600311400ustar00rootroot00000000000000// @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 lorem } from './lorem.str'; // @ts-ignore export { default as noExt } from './no-ext'; rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/src/nested/000077500000000000000000000000001415504077600311245ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/src/nested/bar.ts000066400000000000000000000000311415504077600322320ustar00rootroot00000000000000export default 'banana'; rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/src/nested/baz.ts000066400000000000000000000000331415504077600322440ustar00rootroot00000000000000export default 'whatever'; rollup-2.61.1/test/chunking-form/samples/preserve-modules-filename-pattern/src/no-ext000066400000000000000000000000301415504077600307700ustar00rootroot00000000000000export default 'no-ext' rollup-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/000077500000000000000000000000001415504077600271345ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/_config.js000066400000000000000000000006171415504077600311020ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/000077500000000000000000000000001415504077600310745ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/amd/000077500000000000000000000000001415504077600316355ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/amd/_virtual/000077500000000000000000000000001415504077600334625ustar00rootroot00000000000000_One1.js000066400000000000000000000001131415504077600346750ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/amd/_virtualdefine((function () { 'use strict'; var c = 'One1.js'; return c; })); _One2.js000066400000000000000000000001121415504077600346750ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/amd/_virtualdefine((function () { 'use strict'; var b = 'One.js'; return b; })); _one.js000066400000000000000000000001121415504077600346530ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/amd/_virtualdefine((function () { 'use strict'; var a = 'one.js'; return a; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/amd/main.js000066400000000000000000000002471415504077600331220ustar00rootroot00000000000000define(['./_virtual/_one', './_virtual/_One2', './_virtual/_One1'], (function (_one, _One, _One1) { 'use strict'; window.APP = { a: _one, b: _One, c: _One1 }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/cjs/000077500000000000000000000000001415504077600316535ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/cjs/_virtual/000077500000000000000000000000001415504077600335005ustar00rootroot00000000000000_One1.js000066400000000000000000000000671415504077600347230ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/cjs/_virtual'use strict'; var c = 'One1.js'; module.exports = c; _One2.js000066400000000000000000000000661415504077600347230ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/cjs/_virtual'use strict'; var b = 'One.js'; module.exports = b; _one.js000066400000000000000000000000661415504077600347010ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/cjs/_virtual'use strict'; var a = 'one.js'; module.exports = a; rollup-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/cjs/main.js000066400000000000000000000002761415504077600331420ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/es/000077500000000000000000000000001415504077600315035ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/es/_virtual/000077500000000000000000000000001415504077600333305ustar00rootroot00000000000000_One1.js000066400000000000000000000000551415504077600345500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/es/_virtualvar c = 'One1.js'; export { c as default }; _One2.js000066400000000000000000000000541415504077600345500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/es/_virtualvar b = 'One.js'; export { b as default }; _one.js000066400000000000000000000000541415504077600345260ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/es/_virtualvar a = 'one.js'; export { a as default }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/es/main.js000066400000000000000000000002111415504077600327570ustar00rootroot00000000000000import a from './_virtual/_one.js'; import b from './_virtual/_One2.js'; import c from './_virtual/_One1.js'; window.APP = { a, b, c }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/system/000077500000000000000000000000001415504077600324205ustar00rootroot00000000000000_virtual/000077500000000000000000000000001415504077600341665ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/system_One1.js000066400000000000000000000002271415504077600354660ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002261415504077600354660ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002261415504077600354440ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/_expected/system/main.js000066400000000000000000000005711415504077600337050ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/preserve-modules-id-case-sensitive/main.js000066400000000000000000000001521415504077600304140ustar00rootroot00000000000000import a from '\0one.js'; import b from '\0One.js'; import c from '\0One1.js'; window.APP = { a, b, c }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-named-export-mode/000077500000000000000000000000001415504077600271455ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-named-export-mode/_config.js000066400000000000000000000003131415504077600311040ustar00rootroot00000000000000module.exports = { description: 'respects "named" export mode in all chunks when preserving modules', options: { input: 'main.js', output: { exports: 'named', preserveModules: true } } }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/000077500000000000000000000000001415504077600311055ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/amd/000077500000000000000000000000001415504077600316465ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/amd/default.js000066400000000000000000000002621415504077600336300ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var foo = 'default'; exports["default"] = foo; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/amd/main.js000066400000000000000000000010341415504077600331260ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/amd/named.js000066400000000000000000000002611415504077600332670ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const value = 'named'; exports.value = value; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/cjs/000077500000000000000000000000001415504077600316645ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/cjs/default.js000066400000000000000000000001771415504077600336530ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var foo = 'default'; exports["default"] = foo; rollup-2.61.1/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/cjs/main.js000066400000000000000000000007341415504077600331520ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/cjs/named.js000066400000000000000000000001761415504077600333120ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const value = 'named'; exports.value = value; rollup-2.61.1/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/es/000077500000000000000000000000001415504077600315145ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/es/default.js000066400000000000000000000000611415504077600334730ustar00rootroot00000000000000var foo = 'default'; export { foo as default }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/es/main.js000066400000000000000000000004131415504077600327740ustar00rootroot00000000000000import foo from './default.js'; export { default } 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)); rollup-2.61.1/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/es/named.js000066400000000000000000000000521415504077600331330ustar00rootroot00000000000000const value = 'named'; export { value }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/system/000077500000000000000000000000001415504077600324315ustar00rootroot00000000000000default.js000066400000000000000000000002311415504077600343300ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-modules-named-export-mode/_expected/system/main.js000066400000000000000000000007651415504077600337230ustar00rootroot00000000000000System.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.js000066400000000000000000000002311415504077600337700ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-modules-named-export-mode/default.js000066400000000000000000000000321415504077600311220ustar00rootroot00000000000000export default 'default'; rollup-2.61.1/test/chunking-form/samples/preserve-modules-named-export-mode/main.js000066400000000000000000000004051415504077600304260ustar00rootroot00000000000000import 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-2.61.1/test/chunking-form/samples/preserve-modules-named-export-mode/named.js000066400000000000000000000000361415504077600305660ustar00rootroot00000000000000export const value = 'named'; rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/000077500000000000000000000000001415504077600302735ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_config.js000066400000000000000000000002631415504077600322360ustar00rootroot00000000000000module.exports = { description: 'confirm exports are deconflicted when exporting nested index aliases', options: { input: 'main.js', output: { preserveModules: true } } }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/000077500000000000000000000000001415504077600322335ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/amd/000077500000000000000000000000001415504077600327745ustar00rootroot00000000000000main.js000066400000000000000000000003741415504077600342030ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); module-a/000077500000000000000000000000001415504077600344205ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/amdv1/000077500000000000000000000000001415504077600347465ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/amd/module-aindex.js000066400000000000000000000003051415504077600364110ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); module-b/000077500000000000000000000000001415504077600344215ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/amdv1/000077500000000000000000000000001415504077600347475ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/amd/module-bindex.js000066400000000000000000000003051415504077600364120ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/cjs/000077500000000000000000000000001415504077600330125ustar00rootroot00000000000000main.js000066400000000000000000000003541415504077600342170ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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/000077500000000000000000000000001415504077600344365ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/cjsv1/000077500000000000000000000000001415504077600347645ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/cjs/module-aindex.js000066400000000000000000000002221415504077600364250ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/cjs/module-a/v1'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const TEST_MODULE_A = 'A'; exports.TEST_MODULE_A = TEST_MODULE_A; module-b/000077500000000000000000000000001415504077600344375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/cjsv1/000077500000000000000000000000001415504077600347655ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/cjs/module-bindex.js000066400000000000000000000002221415504077600364260ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/cjs/module-b/v1'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const TEST_MODULE_B = 'A'; exports.TEST_MODULE_B = TEST_MODULE_B; rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/es/000077500000000000000000000000001415504077600326425ustar00rootroot00000000000000main.js000066400000000000000000000002461415504077600340470ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600342665ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/esv1/000077500000000000000000000000001415504077600346145ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/es/module-aindex.js000066400000000000000000000000661415504077600362630ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600342675ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/esv1/000077500000000000000000000000001415504077600346155ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/es/module-bindex.js000066400000000000000000000000661415504077600362640ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/es/module-b/v1const TEST_MODULE_B = 'A'; export { TEST_MODULE_B }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/system/000077500000000000000000000000001415504077600335575ustar00rootroot00000000000000main.js000066400000000000000000000004431415504077600347630ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600352035ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/systemv1/000077500000000000000000000000001415504077600355315ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/system/module-aindex.js000066400000000000000000000002451415504077600371770ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600352045ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/systemv1/000077500000000000000000000000001415504077600355325ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/_expected/system/module-bindex.js000066400000000000000000000002451415504077600372000ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/main.js000066400000000000000000000001011415504077600315450ustar00rootroot00000000000000export * from './module-a/index' export * from './module-b/index'rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/module-a/000077500000000000000000000000001415504077600317765ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/module-a/index.js000066400000000000000000000000771415504077600334470ustar00rootroot00000000000000import * as ModuleA_V1 from './v1/index' export { ModuleA_V1 }rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/module-a/v1/000077500000000000000000000000001415504077600323245ustar00rootroot00000000000000index.js000066400000000000000000000000401415504077600337040ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/module-a/v1export const TEST_MODULE_A = 'A'rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/module-b/000077500000000000000000000000001415504077600317775ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/module-b/index.js000066400000000000000000000000771415504077600334500ustar00rootroot00000000000000import * as ModuleB_V1 from './v1/index' export { ModuleB_V1 }rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/module-b/v1/000077500000000000000000000000001415504077600323255ustar00rootroot00000000000000index.js000066400000000000000000000000401415504077600337050ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-barrel-es-export/module-b/v1export const TEST_MODULE_B = 'A'rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/000077500000000000000000000000001415504077600264215ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_config.js000066400000000000000000000002441415504077600303630ustar00rootroot00000000000000module.exports = { description: 'confirm exports are preserved when exporting a module', options: { input: 'main.js', output: { preserveModules: true } } }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_expected/000077500000000000000000000000001415504077600303615ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_expected/amd/000077500000000000000000000000001415504077600311225ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_expected/amd/inner/000077500000000000000000000000001415504077600322355ustar00rootroot00000000000000more_inner/000077500000000000000000000000001415504077600343135ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_expected/amd/innersomething.js000066400000000000000000000003031415504077600366420ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); some_effect.js000066400000000000000000000001101415504077600347630ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_expected/amd/innerdefine((function () { 'use strict'; console.log('side-effect'); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_expected/amd/main.js000066400000000000000000000003731415504077600324070ustar00rootroot00000000000000define(['exports', './inner/more_inner/something', './inner/some_effect'], (function (exports, something, some_effect) { 'use strict'; exports.Something = something.Something; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_expected/cjs/000077500000000000000000000000001415504077600311405ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_expected/cjs/inner/000077500000000000000000000000001415504077600322535ustar00rootroot00000000000000more_inner/000077500000000000000000000000001415504077600343315ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_expected/cjs/innersomething.js000066400000000000000000000002201415504077600366560ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_expected/cjs/inner/more_inner'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const Something = 'Hello World'; exports.Something = Something; some_effect.js000066400000000000000000000000531415504077600350070ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_expected/cjs/inner'use strict'; console.log('side-effect'); rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_expected/cjs/main.js000066400000000000000000000003321415504077600324200ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var something = require('./inner/more_inner/something.js'); require('./inner/some_effect.js'); exports.Something = something.Something; rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_expected/es/000077500000000000000000000000001415504077600307705ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_expected/es/inner/000077500000000000000000000000001415504077600321035ustar00rootroot00000000000000more_inner/000077500000000000000000000000001415504077600341615ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_expected/es/innersomething.js000066400000000000000000000000701415504077600365110ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_expected/es/inner/more_innerconst Something = 'Hello World'; export { Something }; some_effect.js000066400000000000000000000000341415504077600346360ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_expected/es/innerconsole.log('side-effect'); rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_expected/es/main.js000066400000000000000000000001361415504077600322520ustar00rootroot00000000000000export { Something } from './inner/more_inner/something.js'; import './inner/some_effect.js'; rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_expected/system/000077500000000000000000000000001415504077600317055ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_expected/system/inner/000077500000000000000000000000001415504077600330205ustar00rootroot00000000000000more_inner/000077500000000000000000000000001415504077600350765ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_expected/system/innersomething.js000066400000000000000000000002471415504077600374340ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002051415504077600355530ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_expected/system/innerSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('side-effect'); }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/_expected/system/main.js000066400000000000000000000004121415504077600331640ustar00rootroot00000000000000System.register(['./inner/more_inner/something.js', './inner/some_effect.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('Something', module.Something); }, function () {}], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/inner/000077500000000000000000000000001415504077600275345ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/inner/index.js000066400000000000000000000000741415504077600312020ustar00rootroot00000000000000export * from './more_inner/index'; import './some_effect'; rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/inner/more_inner/000077500000000000000000000000001415504077600316715ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/inner/more_inner/index.js000066400000000000000000000000351415504077600333340ustar00rootroot00000000000000export * from './something'; something.js000066400000000000000000000000501415504077600341400ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/inner/more_innerexport const Something = 'Hello World'; rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/inner/some_effect.js000066400000000000000000000000341415504077600323460ustar00rootroot00000000000000console.log('side-effect'); rollup-2.61.1/test/chunking-form/samples/preserve-modules-nested-export/main.js000066400000000000000000000000371415504077600277030ustar00rootroot00000000000000export * from './inner/index'; rollup-2.61.1/test/chunking-form/samples/preserve-modules-non-entry-imports/000077500000000000000000000000001415504077600272445ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-non-entry-imports/_config.js000066400000000000000000000002421415504077600312040ustar00rootroot00000000000000module.exports = { description: 'imports and exports of non-entry points are tracked', options: { input: 'main.js', output: { preserveModules: true } } }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/000077500000000000000000000000001415504077600312045ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/amd/000077500000000000000000000000001415504077600317455ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/amd/dep2.js000066400000000000000000000001141415504077600331310ustar00rootroot00000000000000define((function () { 'use strict'; function foo() {} return foo; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/amd/main.js000066400000000000000000000001131415504077600332220ustar00rootroot00000000000000define(['./dep2'], (function (dep2) { 'use strict'; return dep2; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/cjs/000077500000000000000000000000001415504077600317635ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/cjs/dep2.js000066400000000000000000000000701415504077600331500ustar00rootroot00000000000000'use strict'; function foo() {} module.exports = foo; rollup-2.61.1/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/cjs/main.js000066400000000000000000000001121415504077600332370ustar00rootroot00000000000000'use strict'; var dep2 = require('./dep2.js'); module.exports = dep2; rollup-2.61.1/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/es/000077500000000000000000000000001415504077600316135ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/es/dep2.js000066400000000000000000000000561415504077600330040ustar00rootroot00000000000000function foo() {} export { foo as default }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/es/main.js000066400000000000000000000001021415504077600330660ustar00rootroot00000000000000import foo from './dep2.js'; export { default } from './dep2.js'; rollup-2.61.1/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/system/000077500000000000000000000000001415504077600325305ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/system/dep2.js000066400000000000000000000002371415504077600337220ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('default', foo); function foo() {} }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-non-entry-imports/_expected/system/main.js000066400000000000000000000003571415504077600340170ustar00rootroot00000000000000System.register(['./dep2.js'], (function (exports) { 'use strict'; var foo; return { setters: [function (module) { foo = module["default"]; exports('default', module["default"]); }], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-non-entry-imports/dep1.js000066400000000000000000000000411415504077600304260ustar00rootroot00000000000000export { default } from './dep2';rollup-2.61.1/test/chunking-form/samples/preserve-modules-non-entry-imports/dep2.js000066400000000000000000000000351415504077600304320ustar00rootroot00000000000000export default function() {};rollup-2.61.1/test/chunking-form/samples/preserve-modules-non-entry-imports/main.js000066400000000000000000000000561415504077600305270ustar00rootroot00000000000000import foo from './dep1'; export default foo;rollup-2.61.1/test/chunking-form/samples/preserve-modules-proxy-import/000077500000000000000000000000001415504077600263115ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-proxy-import/_config.js000066400000000000000000000003141415504077600302510ustar00rootroot00000000000000module.exports = { description: 'correctly resolves imports via a proxy module as direct imports when preserving modules', options: { external: 'external', output: { preserveModules: true } } }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-proxy-import/_expected/000077500000000000000000000000001415504077600302515ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-proxy-import/_expected/amd/000077500000000000000000000000001415504077600310125ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-proxy-import/_expected/amd/main.js000066400000000000000000000005561415504077600323020ustar00rootroot00000000000000define(['external'], (function (path) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var path__default = /*#__PURE__*/_interopDefaultLegacy(path); console.log(path__default["default"].normalize('foo\\bar')); console.log(path__default["default"].normalize('foo\\bar')); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-proxy-import/_expected/amd/proxy.js000066400000000000000000000004261415504077600325330ustar00rootroot00000000000000define(['external'], (function (path) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var path__default = /*#__PURE__*/_interopDefaultLegacy(path); return path__default["default"]; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-proxy-import/_expected/cjs/000077500000000000000000000000001415504077600310305ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-proxy-import/_expected/cjs/main.js000066400000000000000000000005351415504077600323150ustar00rootroot00000000000000'use strict'; var path = require('external'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var path__default = /*#__PURE__*/_interopDefaultLegacy(path); console.log(path__default["default"].normalize('foo\\bar')); console.log(path__default["default"].normalize('foo\\bar')); rollup-2.61.1/test/chunking-form/samples/preserve-modules-proxy-import/_expected/cjs/proxy.js000066400000000000000000000004201415504077600325430ustar00rootroot00000000000000'use strict'; var path = require('external'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var path__default = /*#__PURE__*/_interopDefaultLegacy(path); module.exports = path__default["default"]; rollup-2.61.1/test/chunking-form/samples/preserve-modules-proxy-import/_expected/es/000077500000000000000000000000001415504077600306605ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-proxy-import/_expected/es/main.js000066400000000000000000000001601415504077600321370ustar00rootroot00000000000000import path from 'external'; console.log(path.normalize('foo\\bar')); console.log(path.normalize('foo\\bar')); rollup-2.61.1/test/chunking-form/samples/preserve-modules-proxy-import/_expected/es/proxy.js000066400000000000000000000001011415504077600323670ustar00rootroot00000000000000import path from 'external'; export { default } from 'external'; rollup-2.61.1/test/chunking-form/samples/preserve-modules-proxy-import/_expected/system/000077500000000000000000000000001415504077600315755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-proxy-import/_expected/system/main.js000066400000000000000000000004261415504077600330610ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/preserve-modules-proxy-import/_expected/system/proxy.js000066400000000000000000000003601415504077600333130ustar00rootroot00000000000000System.register(['external'], (function (exports) { 'use strict'; var path; return { setters: [function (module) { path = module["default"]; exports('default', module["default"]); }], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-proxy-import/main.js000066400000000000000000000002261415504077600275730ustar00rootroot00000000000000import path from 'external'; import proxyPath from './proxy'; console.log(path.normalize('foo\\bar')); console.log(proxyPath.normalize('foo\\bar')); rollup-2.61.1/test/chunking-form/samples/preserve-modules-proxy-import/proxy.js000066400000000000000000000000621415504077600300260ustar00rootroot00000000000000import path from 'external'; export default path; rollup-2.61.1/test/chunking-form/samples/preserve-modules-reaching-outside/000077500000000000000000000000001415504077600270525ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-reaching-outside/_config.js000066400000000000000000000002241415504077600310120ustar00rootroot00000000000000module.exports = { description: 'change the module destination', options: { input: 'src/lib/main.js', output: { preserveModules: true } } }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/000077500000000000000000000000001415504077600310125ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/amd/000077500000000000000000000000001415504077600315535ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/amd/dep.js000066400000000000000000000003071415504077600326610ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function fn () { console.log('dep fn'); } exports.fn = fn; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/amd/lib/000077500000000000000000000000001415504077600323215ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/amd/lib/main.js000066400000000000000000000002101415504077600335740ustar00rootroot00000000000000define(['../dep'], (function (dep) { 'use strict'; class Main { constructor () { dep.fn(); } } return Main; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/cjs/000077500000000000000000000000001415504077600315715ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/cjs/dep.js000066400000000000000000000002151415504077600326750ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function fn () { console.log('dep fn'); } exports.fn = fn; rollup-2.61.1/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/cjs/lib/000077500000000000000000000000001415504077600323375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/cjs/lib/main.js000066400000000000000000000001741415504077600336230ustar00rootroot00000000000000'use strict'; var dep = require('../dep.js'); class Main { constructor () { dep.fn(); } } module.exports = Main; rollup-2.61.1/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/es/000077500000000000000000000000001415504077600314215ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/es/dep.js000066400000000000000000000000741415504077600325300ustar00rootroot00000000000000function fn () { console.log('dep fn'); } export { fn }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/es/lib/000077500000000000000000000000001415504077600321675ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/es/lib/main.js000066400000000000000000000001561415504077600334530ustar00rootroot00000000000000import { fn } from '../dep.js'; class Main { constructor () { fn(); } } export { Main as default }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/system/000077500000000000000000000000001415504077600323365ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/system/dep.js000066400000000000000000000003141415504077600334420ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('fn', fn); function fn () { console.log('dep fn'); } }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-reaching-outside/_expected/system/lib/000077500000000000000000000000001415504077600331045ustar00rootroot00000000000000main.js000066400000000000000000000004611415504077600343100ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-modules-reaching-outside/src/000077500000000000000000000000001415504077600276415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-reaching-outside/src/dep.js000066400000000000000000000000621415504077600307450ustar00rootroot00000000000000export function fn () { console.log('dep fn'); }rollup-2.61.1/test/chunking-form/samples/preserve-modules-reaching-outside/src/lib/000077500000000000000000000000001415504077600304075ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-reaching-outside/src/lib/main.js000066400000000000000000000001341415504077600316670ustar00rootroot00000000000000import { fn } from '../dep'; export default class Main { constructor () { fn(); } }rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/000077500000000000000000000000001415504077600246035ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_config.js000066400000000000000000000007531415504077600265520ustar00rootroot00000000000000const commonjs = require('@rollup/plugin-commonjs'); const resolve = require('@rollup/plugin-node-resolve').default; module.exports = { description: 'confirm preserveModulesRoot restructures src appropriately', expectedWarnings: ['MIXED_EXPORTS'], options: { input: ['src/under-build.js', 'src/below/module.js'], plugins: [ resolve({ moduleDirectories: ['custom_modules'] }), commonjs() ], output: { preserveModules: true, preserveModulesRoot: 'src' } } }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/000077500000000000000000000000001415504077600265435ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/amd/000077500000000000000000000000001415504077600273045ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/amd/_virtual/000077500000000000000000000000001415504077600311315ustar00rootroot00000000000000index.js_commonjs-exports.js000066400000000000000000000002661415504077600365450ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/amd/_virtualdefine(['exports'], (function (exports) { 'use strict'; var myBasePkg = {}; exports.__exports = myBasePkg; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/amd/below/000077500000000000000000000000001415504077600304145ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/amd/below/module.js000066400000000000000000000003521415504077600322370ustar00rootroot00000000000000define(['../custom_modules/@my-scope/my-base-pkg/index', '../_virtual/index.js_commonjs-exports'], (function (index$1, index) { 'use strict'; const base2 = index.__exports; var module = { base2, }; return module; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/amd/custom_modules/000077500000000000000000000000001415504077600323465ustar00rootroot00000000000000@my-scope/000077500000000000000000000000001415504077600341235ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/amd/custom_modulesmy-base-pkg/000077500000000000000000000000001415504077600362375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/amd/custom_modules/@my-scopeindex.js000066400000000000000000000003731415504077600377070ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/amd/custom_modules/@my-scope/my-base-pkgdefine(['../../../_virtual/index.js_commonjs-exports'], (function (index) { 'use strict'; Object.defineProperty(index.__exports, '__esModule', { value: true }); var hello = 'world'; index.__exports.hello = hello; return index.__exports; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/amd/under-build.js000066400000000000000000000003471415504077600320600ustar00rootroot00000000000000define(['./custom_modules/@my-scope/my-base-pkg/index', './_virtual/index.js_commonjs-exports'], (function (index$1, index) { 'use strict'; const base = index.__exports; var underBuild = { base }; return underBuild; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/cjs/000077500000000000000000000000001415504077600273225ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/cjs/_virtual/000077500000000000000000000000001415504077600311475ustar00rootroot00000000000000index.js_commonjs-exports.js000066400000000000000000000002031415504077600365520ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/cjs/_virtual'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var myBasePkg = {}; exports.__exports = myBasePkg; rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/cjs/below/000077500000000000000000000000001415504077600304325ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/cjs/below/module.js000066400000000000000000000003471415504077600322610ustar00rootroot00000000000000'use strict'; require('../custom_modules/@my-scope/my-base-pkg/index.js'); var index = require('../_virtual/index.js_commonjs-exports.js'); const base2 = index.__exports; var module$1 = { base2, }; module.exports = module$1; rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/cjs/custom_modules/000077500000000000000000000000001415504077600323645ustar00rootroot00000000000000@my-scope/000077500000000000000000000000001415504077600341415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/cjs/custom_modulesmy-base-pkg/000077500000000000000000000000001415504077600362555ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/cjs/custom_modules/@my-scopeindex.js000066400000000000000000000003671415504077600377300ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/cjs/custom_modules/@my-scope/my-base-pkg'use strict'; var index = require('../../../_virtual/index.js_commonjs-exports.js'); Object.defineProperty(index.__exports, '__esModule', { value: true }); var hello = 'world'; index.__exports.hello = hello; module.exports = index.__exports; rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/cjs/under-build.js000066400000000000000000000003451415504077600320740ustar00rootroot00000000000000'use strict'; require('./custom_modules/@my-scope/my-base-pkg/index.js'); var index = require('./_virtual/index.js_commonjs-exports.js'); const base = index.__exports; var underBuild = { base }; module.exports = underBuild; rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/es/000077500000000000000000000000001415504077600271525ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/es/_virtual/000077500000000000000000000000001415504077600307775ustar00rootroot00000000000000index.js_commonjs-exports.js000066400000000000000000000000701415504077600364040ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/es/_virtualvar myBasePkg = {}; export { myBasePkg as __exports }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/es/below/000077500000000000000000000000001415504077600302625ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/es/below/module.js000066400000000000000000000003431415504077600321050ustar00rootroot00000000000000import '../custom_modules/@my-scope/my-base-pkg/index.js'; import { __exports as myBasePkg } from '../_virtual/index.js_commonjs-exports.js'; const base2 = myBasePkg; var module = { base2, }; export { module as default }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/es/custom_modules/000077500000000000000000000000001415504077600322145ustar00rootroot00000000000000@my-scope/000077500000000000000000000000001415504077600337715ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/es/custom_modulesmy-base-pkg/000077500000000000000000000000001415504077600361055ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/es/custom_modules/@my-scopeindex.js000066400000000000000000000004421415504077600375520ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/es/custom_modules/@my-scope/my-base-pkgimport { __exports as myBasePkg } from '../../../_virtual/index.js_commonjs-exports.js'; export { __exports as default } from '../../../_virtual/index.js_commonjs-exports.js'; Object.defineProperty(myBasePkg, '__esModule', { value: true }); var hello = 'world'; myBasePkg.hello = hello; rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/es/under-build.js000066400000000000000000000003451415504077600317240ustar00rootroot00000000000000import './custom_modules/@my-scope/my-base-pkg/index.js'; import { __exports as myBasePkg } from './_virtual/index.js_commonjs-exports.js'; const base = myBasePkg; var underBuild = { base }; export { underBuild as default }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/system/000077500000000000000000000000001415504077600300675ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/system/_virtual/000077500000000000000000000000001415504077600317145ustar00rootroot00000000000000index.js_commonjs-exports.js000066400000000000000000000002321415504077600373210ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/system/_virtualSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { var myBasePkg = exports('__exports', {}); }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/system/below/000077500000000000000000000000001415504077600311775ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/system/below/module.js000066400000000000000000000006441415504077600330260ustar00rootroot00000000000000System.register(['../custom_modules/@my-scope/my-base-pkg/index.js', '../_virtual/index.js_commonjs-exports.js'], (function (exports) { 'use strict'; var myBasePkg; return { setters: [function () {}, function (module) { myBasePkg = module.__exports; }], execute: (function () { const base2 = myBasePkg; var module$1 = exports('default', { base2, }); }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/system/custom_modules/000077500000000000000000000000001415504077600331315ustar00rootroot00000000000000@my-scope/000077500000000000000000000000001415504077600347065ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/system/custom_modulesmy-base-pkg/000077500000000000000000000000001415504077600370225ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/system/custom_modules/@my-scopeindex.js000066400000000000000000000006271415504077600404740ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/system/custom_modules/@my-scope/my-base-pkgSystem.register(['../../../_virtual/index.js_commonjs-exports.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-2.61.1/test/chunking-form/samples/preserve-modules-root/_expected/system/under-build.js000066400000000000000000000006051415504077600326400ustar00rootroot00000000000000System.register(['./custom_modules/@my-scope/my-base-pkg/index.js', './_virtual/index.js_commonjs-exports.js'], (function (exports) { 'use strict'; var myBasePkg; return { setters: [function () {}, function (module) { myBasePkg = module.__exports; }], execute: (function () { const base = myBasePkg; var underBuild = exports('default', { base }); }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/custom_modules/000077500000000000000000000000001415504077600276455ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/custom_modules/@my-scope/000077500000000000000000000000001415504077600315015ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/custom_modules/@my-scope/my-base-pkg/000077500000000000000000000000001415504077600336155ustar00rootroot00000000000000index.js000066400000000000000000000001741415504077600352050ustar00rootroot00000000000000rollup-2.61.1/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.json000066400000000000000000000001461415504077600360250ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-modules-root/src/000077500000000000000000000000001415504077600253725ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/src/below/000077500000000000000000000000001415504077600265025ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/src/below/module.js000066400000000000000000000001161415504077600303230ustar00rootroot00000000000000const base2 = require('@my-scope/my-base-pkg') module.exports = { base2, } rollup-2.61.1/test/chunking-form/samples/preserve-modules-root/src/under-build.js000066400000000000000000000001141415504077600301360ustar00rootroot00000000000000const base = require('@my-scope/my-base-pkg'); module.exports = { base }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-scriptified-assets/000077500000000000000000000000001415504077600274255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-scriptified-assets/_config.js000066400000000000000000000011421415504077600313650ustar00rootroot00000000000000const path = require('path'); module.exports = { 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-2.61.1/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/000077500000000000000000000000001415504077600313655ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/amd/000077500000000000000000000000001415504077600321265ustar00rootroot00000000000000answer.num.js000066400000000000000000000001161415504077600345000ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/amddefine((function () { 'use strict'; var answer = 42; return answer; })); lorem.str.js000066400000000000000000000010111415504077600343230ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/amd/main.js000066400000000000000000000004151415504077600334100ustar00rootroot00000000000000define(['exports', './answer.num', './lorem.str', './no-ext'], (function (exports, answer, lorem, noExt) { 'use strict'; exports.answer = answer; exports.lorem = lorem; exports.noExt = noExt; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/amd/no-ext.js000066400000000000000000000001361415504077600336760ustar00rootroot00000000000000define((function () { 'use strict'; var noExt = "COULDN'T TRANSFORM"; return noExt; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/cjs/000077500000000000000000000000001415504077600321445ustar00rootroot00000000000000answer.num.js000066400000000000000000000000721415504077600345170ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/cjs'use strict'; var answer = 42; module.exports = answer; lorem.str.js000066400000000000000000000007651415504077600343600ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/cjs/main.js000066400000000000000000000004151415504077600334260ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/cjs/no-ext.js000066400000000000000000000001121415504077600337060ustar00rootroot00000000000000'use strict'; var noExt = "COULDN'T TRANSFORM"; module.exports = noExt; rollup-2.61.1/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/es/000077500000000000000000000000001415504077600317745ustar00rootroot00000000000000answer.num.js000066400000000000000000000000601415504077600343440ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/esvar answer = 42; export { answer as default }; lorem.str.js000066400000000000000000000007531415504077600342050ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/es/main.js000066400000000000000000000002301415504077600332510ustar00rootroot00000000000000export { default as answer } from './answer.num.js'; export { default as lorem } from './lorem.str.js'; export { default as noExt } from './no-ext.js'; rollup-2.61.1/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/es/no-ext.js000066400000000000000000000001001415504077600335330ustar00rootroot00000000000000var noExt = "COULDN'T TRANSFORM"; export { noExt as default }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-scriptified-assets/_expected/system/000077500000000000000000000000001415504077600327115ustar00rootroot00000000000000answer.num.js000066400000000000000000000002251415504077600352640ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000011211415504077600351100ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000005611415504077600341160ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002461415504077600344040ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-modules-scriptified-assets/src/000077500000000000000000000000001415504077600302145ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-scriptified-assets/src/answer.num000066400000000000000000000000031415504077600322250ustar00rootroot0000000000000042 rollup-2.61.1/test/chunking-form/samples/preserve-modules-scriptified-assets/src/lorem.str000066400000000000000000000006761415504077600320750ustar00rootroot00000000000000Lorem 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-2.61.1/test/chunking-form/samples/preserve-modules-scriptified-assets/src/main.js000066400000000000000000000002171415504077600314760ustar00rootroot00000000000000export { default as answer } from './answer.num'; export { default as lorem } from './lorem.str'; export { default as noExt } from './no-ext'; rollup-2.61.1/test/chunking-form/samples/preserve-modules-scriptified-assets/src/no-ext000066400000000000000000000000111415504077600313410ustar00rootroot00000000000000WHATEVER rollup-2.61.1/test/chunking-form/samples/preserve-modules-single-entry/000077500000000000000000000000001415504077600262405ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-single-entry/_config.js000066400000000000000000000002201415504077600301740ustar00rootroot00000000000000module.exports = { description: 'single entry names file correctly', options: { input: 'main.js', output: { preserveModules: true } } }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-single-entry/_expected/000077500000000000000000000000001415504077600302005ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-single-entry/_expected/amd/000077500000000000000000000000001415504077600307415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-single-entry/_expected/amd/main.js000066400000000000000000000000731415504077600322230ustar00rootroot00000000000000define((function () { 'use strict'; console.log(); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-single-entry/_expected/cjs/000077500000000000000000000000001415504077600307575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-single-entry/_expected/cjs/main.js000066400000000000000000000000361415504077600322400ustar00rootroot00000000000000'use strict'; console.log(); rollup-2.61.1/test/chunking-form/samples/preserve-modules-single-entry/_expected/es/000077500000000000000000000000001415504077600306075ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-single-entry/_expected/es/main.js000066400000000000000000000000171415504077600320670ustar00rootroot00000000000000console.log(); rollup-2.61.1/test/chunking-form/samples/preserve-modules-single-entry/_expected/system/000077500000000000000000000000001415504077600315245ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-single-entry/_expected/system/main.js000066400000000000000000000001701415504077600330040ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log(); }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-single-entry/main.js000066400000000000000000000000151415504077600275160ustar00rootroot00000000000000console.log()rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/000077500000000000000000000000001415504077600322055ustar00rootroot00000000000000_config.js000066400000000000000000000022211415504077600340650ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-patternmodule.exports = { description: 'Generates actual files whose filename adheres to entryFileNames for virtual modules when preserving modules', options: { input: 'main.js', output: { preserveModules: true, entryFileNames: 'entry-[name]-[format]-[ext][extname][assetExtname].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/000077500000000000000000000000001415504077600340665ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-patternamd/000077500000000000000000000000001415504077600346275ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected_virtual/000077500000000000000000000000001415504077600364545ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amdentry-_virtualModule-amd-.mjs000066400000000000000000000002721415504077600441360ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/_virtualdefine(['exports'], (function (exports) { 'use strict'; const virtual = "Virtual!"; exports.virtual = virtual; Object.defineProperty(exports, '__esModule', { value: true }); })); entry-_virtualWithAssetExt-amd-str.str.str.mjs000066400000000000000000000002761415504077600474600ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/_virtualdefine(['exports'], (function (exports) { 'use strict'; const virtual3 = "Virtual3!"; exports.virtual3 = virtual3; Object.defineProperty(exports, '__esModule', { value: true }); })); entry-_virtualWithExt-amd-js.js.mjs000066400000000000000000000002761415504077600452610ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amd/_virtualdefine(['exports'], (function (exports) { 'use strict'; const virtual2 = "Virtual2!"; exports.virtual2 = virtual2; Object.defineProperty(exports, '__esModule', { value: true }); })); entry-main-amd-js.js.mjs000066400000000000000000000006411415504077600412120ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/amddefine(['./_virtual/entry-_virtualModule-amd-.mjs', './_virtual/entry-_virtualWithExt-amd-js.js.mjs', './_virtual/entry-_virtualWithAssetExt-amd-str.str.str.mjs'], (function (_virtualModule, _virtualWithExt, _virtualWithAssetExt) { 'use strict'; assert.equal(_virtualModule.virtual, 'Virtual!'); assert.equal(_virtualWithExt.virtual2, 'Virtual2!'); assert.equal(_virtualWithAssetExt.virtual3, 'Virtual3!'); })); cjs/000077500000000000000000000000001415504077600346455ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected_virtual/000077500000000000000000000000001415504077600364725ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjsentry-_virtualModule-cjs-.mjs000066400000000000000000000002071415504077600441700ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/_virtual'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const virtual = "Virtual!"; exports.virtual = virtual; entry-_virtualWithAssetExt-cjs-str.str.str.mjs000066400000000000000000000002131415504077600475030ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/_virtual'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const virtual3 = "Virtual3!"; exports.virtual3 = virtual3; entry-_virtualWithExt-cjs-js.js.mjs000066400000000000000000000002131415504077600453040ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs/_virtual'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const virtual2 = "Virtual2!"; exports.virtual2 = virtual2; entry-main-cjs-js.js.mjs000066400000000000000000000006551415504077600412530ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/cjs'use strict'; var _virtualModule = require('./_virtual/entry-_virtualModule-cjs-.mjs'); var _virtualWithExt = require('./_virtual/entry-_virtualWithExt-cjs-js.js.mjs'); var _virtualWithAssetExt = require('./_virtual/entry-_virtualWithAssetExt-cjs-str.str.str.mjs'); assert.equal(_virtualModule.virtual, 'Virtual!'); assert.equal(_virtualWithExt.virtual2, 'Virtual2!'); assert.equal(_virtualWithAssetExt.virtual3, 'Virtual3!'); es/000077500000000000000000000000001415504077600344755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected_virtual/000077500000000000000000000000001415504077600363225ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/esentry-_virtualModule-es-.mjs000066400000000000000000000000611415504077600436460ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/_virtualconst virtual = "Virtual!"; export { virtual }; entry-_virtualWithAssetExt-es-str.str.str.mjs000066400000000000000000000000641415504077600471670ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/_virtualconst virtual3 = "Virtual3!"; export { virtual3 }; entry-_virtualWithExt-es-js.js.mjs000066400000000000000000000000641415504077600447700ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/es/_virtualconst virtual2 = "Virtual2!"; export { virtual2 }; entry-main-es-js.js.mjs000066400000000000000000000005201415504077600407220ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/esimport { virtual } from './_virtual/entry-_virtualModule-es-.mjs'; import { virtual2 } from './_virtual/entry-_virtualWithExt-es-js.js.mjs'; import { virtual3 } from './_virtual/entry-_virtualWithAssetExt-es-str.str.str.mjs'; assert.equal(virtual, 'Virtual!'); assert.equal(virtual2, 'Virtual2!'); assert.equal(virtual3, 'Virtual3!'); system/000077500000000000000000000000001415504077600354125ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected_virtual/000077500000000000000000000000001415504077600372375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/systementry-_virtualModule-system-.mjs000066400000000000000000000002401415504077600454770ustar00rootroot00000000000000rollup-2.61.1/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!"); }) }; })); entry-_virtualWithAssetExt-system-str.str.str.mjs000066400000000000000000000002431415504077600510200ustar00rootroot00000000000000rollup-2.61.1/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!"); }) }; })); entry-_virtualWithExt-system-js.js.mjs000066400000000000000000000002431415504077600466210ustar00rootroot00000000000000rollup-2.61.1/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!"); }) }; })); entry-main-system-js.js.mjs000066400000000000000000000011231415504077600425540ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/_expected/systemSystem.register(['./_virtual/entry-_virtualModule-system-.mjs', './_virtual/entry-_virtualWithExt-system-js.js.mjs', './_virtual/entry-_virtualWithAssetExt-system-str.str.str.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-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules-filename-pattern/main.js000066400000000000000000000001551415504077600334700ustar00rootroot00000000000000assert.equal(virtual, 'Virtual!'); assert.equal(virtual2, 'Virtual2!'); assert.equal(virtual3, 'Virtual3!'); rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules/000077500000000000000000000000001415504077600267545ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules/_config.js000066400000000000000000000010411415504077600307120ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/000077500000000000000000000000001415504077600307145ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/amd/000077500000000000000000000000001415504077600314555ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/amd/_virtual/000077500000000000000000000000001415504077600333025ustar00rootroot00000000000000_virtualModule.js000066400000000000000000000002721415504077600365550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/amd/_virtualdefine(['exports'], (function (exports) { 'use strict'; const virtual = "Virtual!"; exports.virtual = virtual; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/amd/main.js000066400000000000000000000002131415504077600327330ustar00rootroot00000000000000define(['./_virtual/_virtualModule'], (function (_virtualModule) { 'use strict'; assert.equal(_virtualModule.virtual, 'Virtual!'); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/cjs/000077500000000000000000000000001415504077600314735ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/cjs/_virtual/000077500000000000000000000000001415504077600333205ustar00rootroot00000000000000_virtualModule.js000066400000000000000000000002071415504077600365710ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/cjs/_virtual'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const virtual = "Virtual!"; exports.virtual = virtual; rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/cjs/main.js000066400000000000000000000002001415504077600327450ustar00rootroot00000000000000'use strict'; var _virtualModule = require('./_virtual/_virtualModule.js'); assert.equal(_virtualModule.virtual, 'Virtual!'); rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/es/000077500000000000000000000000001415504077600313235ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/es/_virtual/000077500000000000000000000000001415504077600331505ustar00rootroot00000000000000_virtualModule.js000066400000000000000000000000611415504077600364170ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/es/_virtualconst virtual = "Virtual!"; export { virtual }; rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/es/main.js000066400000000000000000000001341415504077600326030ustar00rootroot00000000000000import { virtual } from './_virtual/_virtualModule.js'; assert.equal(virtual, 'Virtual!'); rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/system/000077500000000000000000000000001415504077600322405ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/system/_virtual/000077500000000000000000000000001415504077600340655ustar00rootroot00000000000000_virtualModule.js000066400000000000000000000002401415504077600373330ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules/_expected/system/main.js000066400000000000000000000003731415504077600335250ustar00rootroot00000000000000System.register(['./_virtual/_virtualModule.js'], (function () { 'use strict'; var virtual; return { setters: [function (module) { virtual = module.virtual; }], execute: (function () { assert.equal(virtual, 'Virtual!'); }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules-virtual-modules/main.js000066400000000000000000000000431415504077600302330ustar00rootroot00000000000000assert.equal(virtual, 'Virtual!'); rollup-2.61.1/test/chunking-form/samples/preserve-modules/000077500000000000000000000000001415504077600236225ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules/_config.js000066400000000000000000000002261415504077600255640ustar00rootroot00000000000000module.exports = { description: 'Rewrite modules in-place', options: { input: ['main1.js', 'main2.js'], output: { preserveModules: true } } }; rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/000077500000000000000000000000001415504077600255625ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/amd/000077500000000000000000000000001415504077600263235ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/amd/deps/000077500000000000000000000000001415504077600272565ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/amd/deps/dep1.js000066400000000000000000000003101415504077600304370ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function fn () { console.log('dep1 fn'); } exports.fn = fn; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/amd/deps/dep2.js000066400000000000000000000003541415504077600304500ustar00rootroot00000000000000define(['exports', '../lib/lib2'], (function (exports, lib2) { 'use strict'; function fn () { lib2.fn(); console.log('dep2 fn'); } exports.fn = fn; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/amd/deps/dep3.js000066400000000000000000000003541415504077600304510ustar00rootroot00000000000000define(['exports', '../lib/lib1'], (function (exports, lib1) { 'use strict'; function fn () { lib1.fn(); console.log('dep3 fn'); } exports.fn = fn; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/amd/lib/000077500000000000000000000000001415504077600270715ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/amd/lib/lib1.js000066400000000000000000000003101415504077600302500ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function fn () { console.log('lib1 fn'); } exports.fn = fn; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/amd/lib/lib2.js000066400000000000000000000003101415504077600302510ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function fn () { console.log('lib2 fn'); } exports.fn = fn; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/amd/main1.js000066400000000000000000000002671415504077600276730ustar00rootroot00000000000000define(['./deps/dep1', './deps/dep2'], (function (dep1, dep2) { 'use strict'; class Main1 { constructor () { dep1.fn(); dep2.fn(); } } return Main1; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/amd/main2.js000066400000000000000000000002671415504077600276740ustar00rootroot00000000000000define(['./deps/dep2', './deps/dep3'], (function (dep2, dep3) { 'use strict'; class Main2 { constructor () { dep3.fn(); dep2.fn(); } } return Main2; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/cjs/000077500000000000000000000000001415504077600263415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/cjs/deps/000077500000000000000000000000001415504077600272745ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/cjs/deps/dep1.js000066400000000000000000000002161415504077600304620ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function fn () { console.log('dep1 fn'); } exports.fn = fn; rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/cjs/deps/dep2.js000066400000000000000000000003021415504077600304570ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var lib2 = require('../lib/lib2.js'); function fn () { lib2.fn(); console.log('dep2 fn'); } exports.fn = fn; rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/cjs/deps/dep3.js000066400000000000000000000003021415504077600304600ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var lib1 = require('../lib/lib1.js'); function fn () { lib1.fn(); console.log('dep3 fn'); } exports.fn = fn; rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/cjs/lib/000077500000000000000000000000001415504077600271075ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/cjs/lib/lib1.js000066400000000000000000000002161415504077600302730ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function fn () { console.log('lib1 fn'); } exports.fn = fn; rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/cjs/lib/lib2.js000066400000000000000000000002161415504077600302740ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function fn () { console.log('lib2 fn'); } exports.fn = fn; rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/cjs/main1.js000066400000000000000000000002721415504077600277050ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/preserve-modules/_expected/cjs/main2.js000066400000000000000000000002721415504077600277060ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/preserve-modules/_expected/es/000077500000000000000000000000001415504077600261715ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/es/deps/000077500000000000000000000000001415504077600271245ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/es/deps/dep1.js000066400000000000000000000000751415504077600303150ustar00rootroot00000000000000function fn () { console.log('dep1 fn'); } export { fn }; rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/es/deps/dep2.js000066400000000000000000000001651415504077600303160ustar00rootroot00000000000000import { fn as fn$1 } from '../lib/lib2.js'; function fn () { fn$1(); console.log('dep2 fn'); } export { fn }; rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/es/deps/dep3.js000066400000000000000000000001651415504077600303170ustar00rootroot00000000000000import { fn as fn$1 } from '../lib/lib1.js'; function fn () { fn$1(); console.log('dep3 fn'); } export { fn }; rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/es/lib/000077500000000000000000000000001415504077600267375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/es/lib/lib1.js000066400000000000000000000000751415504077600301260ustar00rootroot00000000000000function fn () { console.log('lib1 fn'); } export { fn }; rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/es/lib/lib2.js000066400000000000000000000000751415504077600301270ustar00rootroot00000000000000function fn () { console.log('lib2 fn'); } export { fn }; rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/es/main1.js000066400000000000000000000002561415504077600275370ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/preserve-modules/_expected/es/main2.js000066400000000000000000000002561415504077600275400ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/preserve-modules/_expected/system/000077500000000000000000000000001415504077600271065ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/system/deps/000077500000000000000000000000001415504077600300415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/system/deps/dep1.js000066400000000000000000000003151415504077600312270ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('fn', fn); function fn () { console.log('dep1 fn'); } }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/system/deps/dep2.js000066400000000000000000000004731415504077600312350ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/preserve-modules/_expected/system/deps/dep3.js000066400000000000000000000004731415504077600312360ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/preserve-modules/_expected/system/lib/000077500000000000000000000000001415504077600276545ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/system/lib/lib1.js000066400000000000000000000003151415504077600310400ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('fn', fn); function fn () { console.log('lib1 fn'); } }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/system/lib/lib2.js000066400000000000000000000003151415504077600310410ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('fn', fn); function fn () { console.log('lib2 fn'); } }) }; })); rollup-2.61.1/test/chunking-form/samples/preserve-modules/_expected/system/main1.js000066400000000000000000000006251415504077600304540ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/preserve-modules/_expected/system/main2.js000066400000000000000000000006251415504077600304550ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/preserve-modules/deps/000077500000000000000000000000001415504077600245555ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules/deps/dep1.js000066400000000000000000000000631415504077600257430ustar00rootroot00000000000000export function fn () { console.log('dep1 fn'); }rollup-2.61.1/test/chunking-form/samples/preserve-modules/deps/dep2.js000066400000000000000000000001551415504077600257460ustar00rootroot00000000000000import { fn as libfn } from '../lib/lib2.js'; export function fn () { libfn(); console.log('dep2 fn'); }rollup-2.61.1/test/chunking-form/samples/preserve-modules/deps/dep3.js000066400000000000000000000002251415504077600257450ustar00rootroot00000000000000import { fn as libfn, treeshaked } from '../lib/lib1.js'; export function fn () { libfn(); console.log('dep3 fn'); } export default treeshaked;rollup-2.61.1/test/chunking-form/samples/preserve-modules/lib/000077500000000000000000000000001415504077600243705ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/preserve-modules/lib/lib1.js000066400000000000000000000001751415504077600255600ustar00rootroot00000000000000export function fn () { console.log('lib1 fn'); } export function treeshaked () { console.log('this is tree shaken!'); }rollup-2.61.1/test/chunking-form/samples/preserve-modules/lib/lib2.js000066400000000000000000000000631415504077600255550ustar00rootroot00000000000000export function fn () { console.log('lib2 fn'); }rollup-2.61.1/test/chunking-form/samples/preserve-modules/main1.js000066400000000000000000000002341415504077600251640ustar00rootroot00000000000000import { fn } from './deps/dep1.js'; import { fn as fn2 } from './deps/dep2.js'; export default class Main1 { constructor () { fn(); fn2(); } }rollup-2.61.1/test/chunking-form/samples/preserve-modules/main2.js000066400000000000000000000003231415504077600251640ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/reexport-from-entry/000077500000000000000000000000001415504077600242715ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/reexport-from-entry/_config.js000066400000000000000000000002011415504077600262240ustar00rootroot00000000000000module.exports = { description: 'allows reexporting from other entry points', options: { input: ['main', 'otherEntry'] } }; rollup-2.61.1/test/chunking-form/samples/reexport-from-entry/_expected/000077500000000000000000000000001415504077600262315ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/reexport-from-entry/_expected/amd/000077500000000000000000000000001415504077600267725ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/reexport-from-entry/_expected/amd/generated-otherEntry.js000066400000000000000000000002301415504077600334220ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; let a = {}; let b = {}; let c = {}; exports.a = a; exports.b = b; exports.c = c; })); rollup-2.61.1/test/chunking-form/samples/reexport-from-entry/_expected/amd/main.js000066400000000000000000000003361415504077600302560ustar00rootroot00000000000000define(['exports', './generated-otherEntry'], (function (exports, otherEntry) { 'use strict'; exports.a = otherEntry.a; exports.c = otherEntry.c; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/reexport-from-entry/_expected/amd/otherEntry.js000066400000000000000000000003361415504077600314750ustar00rootroot00000000000000define(['exports', './generated-otherEntry'], (function (exports, otherEntry) { 'use strict'; exports.b = otherEntry.b; exports.c = otherEntry.c; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/reexport-from-entry/_expected/cjs/000077500000000000000000000000001415504077600270105ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/reexport-from-entry/_expected/cjs/generated-otherEntry.js000066400000000000000000000001421415504077600334420ustar00rootroot00000000000000'use strict'; let a = {}; let b = {}; let c = {}; exports.a = a; exports.b = b; exports.c = c; rollup-2.61.1/test/chunking-form/samples/reexport-from-entry/_expected/cjs/main.js000066400000000000000000000002751415504077600302760ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var otherEntry = require('./generated-otherEntry.js'); exports.a = otherEntry.a; exports.c = otherEntry.c; rollup-2.61.1/test/chunking-form/samples/reexport-from-entry/_expected/cjs/otherEntry.js000066400000000000000000000002751415504077600315150ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var otherEntry = require('./generated-otherEntry.js'); exports.b = otherEntry.b; exports.c = otherEntry.c; rollup-2.61.1/test/chunking-form/samples/reexport-from-entry/_expected/es/000077500000000000000000000000001415504077600266405ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/reexport-from-entry/_expected/es/generated-otherEntry.js000066400000000000000000000000721415504077600332740ustar00rootroot00000000000000let a = {}; let b = {}; let c = {}; export { a, b, c }; rollup-2.61.1/test/chunking-form/samples/reexport-from-entry/_expected/es/main.js000066400000000000000000000000621415504077600301200ustar00rootroot00000000000000export { a, c } from './generated-otherEntry.js'; rollup-2.61.1/test/chunking-form/samples/reexport-from-entry/_expected/es/otherEntry.js000066400000000000000000000000621415504077600313370ustar00rootroot00000000000000export { b, c } from './generated-otherEntry.js'; rollup-2.61.1/test/chunking-form/samples/reexport-from-entry/_expected/system/000077500000000000000000000000001415504077600275555ustar00rootroot00000000000000generated-otherEntry.js000066400000000000000000000003051415504077600341310ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/reexport-from-entry/_expected/systemSystem.register([], (function (exports) { 'use strict'; return { execute: (function () { let a = exports('a', {}); let b = exports('b', {}); let c = exports('c', {}); }) }; })); rollup-2.61.1/test/chunking-form/samples/reexport-from-entry/_expected/system/main.js000066400000000000000000000003311415504077600310340ustar00rootroot00000000000000System.register(['./generated-otherEntry.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports({ a: module.a, c: module.c }); }], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/reexport-from-entry/_expected/system/otherEntry.js000066400000000000000000000003311415504077600322530ustar00rootroot00000000000000System.register(['./generated-otherEntry.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports({ b: module.b, c: module.c }); }], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/reexport-from-entry/common.js000066400000000000000000000000461415504077600261170ustar00rootroot00000000000000export let a = {}; export let b = {}; rollup-2.61.1/test/chunking-form/samples/reexport-from-entry/main.js000066400000000000000000000001061415504077600255500ustar00rootroot00000000000000export { a } from './common.js'; export { c } from './otherEntry.js'; rollup-2.61.1/test/chunking-form/samples/reexport-from-entry/otherEntry.js000066400000000000000000000000641415504077600267720ustar00rootroot00000000000000export { b } from './common.js'; export let c = {}; rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/000077500000000000000000000000001415504077600243665ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/_config.js000066400000000000000000000002201415504077600263220ustar00rootroot00000000000000module.exports = { description: 'Tracing reexport shortpaths to entry points', options: { input: ['main1.js', 'main2.js', 'main3.js'] } }; rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/_expected/000077500000000000000000000000001415504077600263265ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/_expected/amd/000077500000000000000000000000001415504077600270675ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/_expected/amd/generated-dep2.js000066400000000000000000000001751415504077600322160ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function foo() {} console.log('dep2'); exports.foo = foo; })); rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/_expected/amd/main1.js000066400000000000000000000001311415504077600304250ustar00rootroot00000000000000define(['./generated-dep2'], (function (dep2) { 'use strict'; return dep2.foo; })); rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/_expected/amd/main2.js000066400000000000000000000001061415504077600304300ustar00rootroot00000000000000define(['./generated-dep2'], (function (dep2) { 'use strict'; })); rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/_expected/amd/main3.js000066400000000000000000000001061415504077600304310ustar00rootroot00000000000000define(['./generated-dep2'], (function (dep2) { 'use strict'; })); rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/_expected/cjs/000077500000000000000000000000001415504077600271055ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/_expected/cjs/generated-dep2.js000066400000000000000000000001121415504077600322230ustar00rootroot00000000000000'use strict'; function foo() {} console.log('dep2'); exports.foo = foo; rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/_expected/cjs/main1.js000066400000000000000000000001301415504077600304420ustar00rootroot00000000000000'use strict'; var dep2 = require('./generated-dep2.js'); module.exports = dep2.foo; rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/_expected/cjs/main2.js000066400000000000000000000000601415504077600304450ustar00rootroot00000000000000'use strict'; require('./generated-dep2.js'); rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/_expected/cjs/main3.js000066400000000000000000000000601415504077600304460ustar00rootroot00000000000000'use strict'; require('./generated-dep2.js'); rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/_expected/es/000077500000000000000000000000001415504077600267355ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/_expected/es/generated-dep2.js000066400000000000000000000000751415504077600320630ustar00rootroot00000000000000function foo() {} console.log('dep2'); export { foo as f }; rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/_expected/es/main1.js000066400000000000000000000001441415504077600302770ustar00rootroot00000000000000import { f as foo } from './generated-dep2.js'; export { f as default } from './generated-dep2.js'; rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/_expected/es/main2.js000066400000000000000000000000361415504077600303000ustar00rootroot00000000000000import './generated-dep2.js'; rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/_expected/es/main3.js000066400000000000000000000000361415504077600303010ustar00rootroot00000000000000import './generated-dep2.js'; rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/_expected/system/000077500000000000000000000000001415504077600276525ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/_expected/system/generated-dep2.js000066400000000000000000000002611415504077600327750ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('f', foo); function foo() {} console.log('dep2'); }) }; })); rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/_expected/system/main1.js000066400000000000000000000003471415504077600312210ustar00rootroot00000000000000System.register(['./generated-dep2.js'], (function (exports) { 'use strict'; var foo; return { setters: [function (module) { foo = module.f; exports('default', module.f); }], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/_expected/system/main2.js000066400000000000000000000002311415504077600312120ustar00rootroot00000000000000System.register(['./generated-dep2.js'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/_expected/system/main3.js000066400000000000000000000002311415504077600312130ustar00rootroot00000000000000System.register(['./generated-dep2.js'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/dep1.js000066400000000000000000000000411415504077600255500ustar00rootroot00000000000000export { default } from './dep2';rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/dep2.js000066400000000000000000000000621415504077600255540ustar00rootroot00000000000000export default function() {} console.log('dep2'); rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/main1.js000066400000000000000000000000561415504077600257320ustar00rootroot00000000000000import foo from './dep1'; export default foo; rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/main2.js000066400000000000000000000000241415504077600257260ustar00rootroot00000000000000import './dep1.js'; rollup-2.61.1/test/chunking-form/samples/reexport-shortpaths/main3.js000066400000000000000000000000241415504077600257270ustar00rootroot00000000000000import './dep2.js'; rollup-2.61.1/test/chunking-form/samples/render-chunk/000077500000000000000000000000001415504077600227065ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/render-chunk/_config.js000066400000000000000000000012451415504077600246520ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'transforms chunks in the renderChunk hook', options: { input: ['main1', 'main2'], plugins: { renderChunk(code, chunk, options) { assert.strictEqual(options.chunkFileNames, 'chunk-[name].js'); return ( code + `\nconsole.log('fileName', '${chunk.fileName}');` + `\nconsole.log('imports', '${chunk.imports.join(', ')}');` + `\nconsole.log('isEntry', ${chunk.isEntry});` + `\nconsole.log('name', '${chunk.name}');` + `\nconsole.log('modules.length', ${Object.keys(chunk.modules).length});` ); } }, output: { chunkFileNames: 'chunk-[name].js' } } }; rollup-2.61.1/test/chunking-form/samples/render-chunk/_expected/000077500000000000000000000000001415504077600246465ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/render-chunk/_expected/amd/000077500000000000000000000000001415504077600254075ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/render-chunk/_expected/amd/chunk-dep2.js000066400000000000000000000004061415504077600277050ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var num = 2; exports.num = num; })); console.log('fileName', 'chunk-dep2.js'); console.log('imports', ''); console.log('isEntry', false); console.log('name', 'dep2'); console.log('modules.length', 1); rollup-2.61.1/test/chunking-form/samples/render-chunk/_expected/amd/main1.js000066400000000000000000000004321415504077600267510ustar00rootroot00000000000000define(['./chunk-dep2'], (function (dep2) { 'use strict'; var num = 1; console.log(num + dep2.num); })); console.log('fileName', 'main1.js'); console.log('imports', 'chunk-dep2.js'); console.log('isEntry', true); console.log('name', 'main1'); console.log('modules.length', 2); rollup-2.61.1/test/chunking-form/samples/render-chunk/_expected/amd/main2.js000066400000000000000000000004321415504077600267520ustar00rootroot00000000000000define(['./chunk-dep2'], (function (dep2) { 'use strict'; var num = 3; console.log(dep2.num + num); })); console.log('fileName', 'main2.js'); console.log('imports', 'chunk-dep2.js'); console.log('isEntry', true); console.log('name', 'main2'); console.log('modules.length', 2); rollup-2.61.1/test/chunking-form/samples/render-chunk/_expected/cjs/000077500000000000000000000000001415504077600254255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/render-chunk/_expected/cjs/chunk-dep2.js000066400000000000000000000003241415504077600277220ustar00rootroot00000000000000'use strict'; var num = 2; exports.num = num; console.log('fileName', 'chunk-dep2.js'); console.log('imports', ''); console.log('isEntry', false); console.log('name', 'dep2'); console.log('modules.length', 1); rollup-2.61.1/test/chunking-form/samples/render-chunk/_expected/cjs/main1.js000066400000000000000000000004161415504077600267710ustar00rootroot00000000000000'use strict'; var dep2 = require('./chunk-dep2.js'); var num = 1; console.log(num + dep2.num); console.log('fileName', 'main1.js'); console.log('imports', 'chunk-dep2.js'); console.log('isEntry', true); console.log('name', 'main1'); console.log('modules.length', 2); rollup-2.61.1/test/chunking-form/samples/render-chunk/_expected/cjs/main2.js000066400000000000000000000004161415504077600267720ustar00rootroot00000000000000'use strict'; var dep2 = require('./chunk-dep2.js'); var num = 3; console.log(dep2.num + num); console.log('fileName', 'main2.js'); console.log('imports', 'chunk-dep2.js'); console.log('isEntry', true); console.log('name', 'main2'); console.log('modules.length', 2); rollup-2.61.1/test/chunking-form/samples/render-chunk/_expected/es/000077500000000000000000000000001415504077600252555ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/render-chunk/_expected/es/chunk-dep2.js000066400000000000000000000003071415504077600275530ustar00rootroot00000000000000var num = 2; export { num as n }; console.log('fileName', 'chunk-dep2.js'); console.log('imports', ''); console.log('isEntry', false); console.log('name', 'dep2'); console.log('modules.length', 1); rollup-2.61.1/test/chunking-form/samples/render-chunk/_expected/es/main1.js000066400000000000000000000004031415504077600266150ustar00rootroot00000000000000import { n as num$1 } from './chunk-dep2.js'; var num = 1; console.log(num + num$1); console.log('fileName', 'main1.js'); console.log('imports', 'chunk-dep2.js'); console.log('isEntry', true); console.log('name', 'main1'); console.log('modules.length', 2); rollup-2.61.1/test/chunking-form/samples/render-chunk/_expected/es/main2.js000066400000000000000000000004031415504077600266160ustar00rootroot00000000000000import { n as num$1 } from './chunk-dep2.js'; var num = 3; console.log(num$1 + num); console.log('fileName', 'main2.js'); console.log('imports', 'chunk-dep2.js'); console.log('isEntry', true); console.log('name', 'main2'); console.log('modules.length', 2); rollup-2.61.1/test/chunking-form/samples/render-chunk/_expected/system/000077500000000000000000000000001415504077600261725ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/render-chunk/_expected/system/chunk-dep2.js000066400000000000000000000004571415504077600304760ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var num = exports('n', 2); }) }; })); console.log('fileName', 'chunk-dep2.js'); console.log('imports', ''); console.log('isEntry', false); console.log('name', 'dep2'); console.log('modules.length', 1); rollup-2.61.1/test/chunking-form/samples/render-chunk/_expected/system/main1.js000066400000000000000000000006301415504077600275340ustar00rootroot00000000000000System.register(['./chunk-dep2.js'], (function () { 'use strict'; var num$1; return { setters: [function (module) { num$1 = module.n; }], execute: (function () { var num = 1; console.log(num + num$1); }) }; })); console.log('fileName', 'main1.js'); console.log('imports', 'chunk-dep2.js'); console.log('isEntry', true); console.log('name', 'main1'); console.log('modules.length', 2); rollup-2.61.1/test/chunking-form/samples/render-chunk/_expected/system/main2.js000066400000000000000000000006301415504077600275350ustar00rootroot00000000000000System.register(['./chunk-dep2.js'], (function () { 'use strict'; var num$1; return { setters: [function (module) { num$1 = module.n; }], execute: (function () { var num = 3; console.log(num$1 + num); }) }; })); console.log('fileName', 'main2.js'); console.log('imports', 'chunk-dep2.js'); console.log('isEntry', true); console.log('name', 'main2'); console.log('modules.length', 2); rollup-2.61.1/test/chunking-form/samples/render-chunk/dep1.js000066400000000000000000000000231415504077600240700ustar00rootroot00000000000000export var num = 1;rollup-2.61.1/test/chunking-form/samples/render-chunk/dep2.js000066400000000000000000000000231415504077600240710ustar00rootroot00000000000000export var num = 2;rollup-2.61.1/test/chunking-form/samples/render-chunk/dep3.js000066400000000000000000000000231415504077600240720ustar00rootroot00000000000000export var num = 3;rollup-2.61.1/test/chunking-form/samples/render-chunk/main1.js000066400000000000000000000001461415504077600242520ustar00rootroot00000000000000import { num as num1 } from './dep1'; import { num as num2 } from './dep2'; console.log(num1 + num2);rollup-2.61.1/test/chunking-form/samples/render-chunk/main2.js000066400000000000000000000001461415504077600242530ustar00rootroot00000000000000import { num as num1 } from './dep2'; import { num as num2 } from './dep3'; console.log(num1 + num2);rollup-2.61.1/test/chunking-form/samples/render-dynamic-import/000077500000000000000000000000001415504077600245325ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/render-dynamic-import/_config.js000066400000000000000000000012141415504077600264720ustar00rootroot00000000000000const path = require('path'); module.exports = { 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-2.61.1/test/chunking-form/samples/render-dynamic-import/_expected/000077500000000000000000000000001415504077600264725ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/render-dynamic-import/_expected/amd/000077500000000000000000000000001415504077600272335ustar00rootroot00000000000000generated-imported-via-special-handler.js000066400000000000000000000001041415504077600370720ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/render-dynamic-import/_expected/amddefine((function () { 'use strict'; console.log('special'); })); rollup-2.61.1/test/chunking-form/samples/render-dynamic-import/_expected/amd/main.js000066400000000000000000000005211415504077600305130ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/render-dynamic-import/_expected/cjs/000077500000000000000000000000001415504077600272515ustar00rootroot00000000000000generated-imported-via-special-handler.js000066400000000000000000000000471415504077600371160ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/render-dynamic-import/_expected/cjs'use strict'; console.log('special'); rollup-2.61.1/test/chunking-form/samples/render-dynamic-import/_expected/cjs/main.js000066400000000000000000000004411415504077600305320ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/render-dynamic-import/_expected/es/000077500000000000000000000000001415504077600271015ustar00rootroot00000000000000generated-imported-via-special-handler.js000066400000000000000000000000301415504077600367360ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/render-dynamic-import/_expected/esconsole.log('special'); rollup-2.61.1/test/chunking-form/samples/render-dynamic-import/_expected/es/main.js000066400000000000000000000004171415504077600303650ustar00rootroot00000000000000esSpecialHandler('./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-2.61.1/test/chunking-form/samples/render-dynamic-import/_expected/system/000077500000000000000000000000001415504077600300165ustar00rootroot00000000000000generated-imported-via-special-handler.js000066400000000000000000000002011415504077600376530ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/render-dynamic-import/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('special'); }) }; })); rollup-2.61.1/test/chunking-form/samples/render-dynamic-import/_expected/system/main.js000066400000000000000000000006311415504077600313000ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/render-dynamic-import/imported-via-special-handler.js000066400000000000000000000000301415504077600325120ustar00rootroot00000000000000console.log('special'); rollup-2.61.1/test/chunking-form/samples/render-dynamic-import/main.js000066400000000000000000000001411415504077600260100ustar00rootroot00000000000000import('./imported-via-special-handler.js'); import(someVariable); import(someResolvedVariable); rollup-2.61.1/test/chunking-form/samples/resolve-dynamic-import/000077500000000000000000000000001415504077600247325ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-dynamic-import/_config.js000066400000000000000000000035651415504077600267050ustar00rootroot00000000000000const path = require('path'); const EXISTING = path.resolve(__dirname, 'existing.js'); module.exports = { 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-2.61.1/test/chunking-form/samples/resolve-dynamic-import/_expected/000077500000000000000000000000001415504077600266725ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-dynamic-import/_expected/amd/000077500000000000000000000000001415504077600274335ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-dynamic-import/_expected/amd/main.js000066400000000000000000000054321415504077600307210ustar00rootroot00000000000000define(['require', './direct-relative-external', 'to-indirect-relative-external', 'direct-absolute-external', 'to-indirect-absolute-external'], (function (require, directRelativeExternal, toIndirectRelativeExternal, directAbsoluteExternal, toIndirectAbsoluteExternal) { 'use strict'; 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); } // nested Promise.resolve().then(function () { return existing; }); new Promise(function (resolve, reject) { require(['./direct-relative-external'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }); new Promise(function (resolve, reject) { require(['to-indirect-relative-external'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }); new Promise(function (resolve, reject) { require(['direct-absolute-external'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }); new Promise(function (resolve, reject) { require(['to-indirect-absolute-external'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }); const value = 'existing'; console.log('existing'); var existing = /*#__PURE__*/Object.freeze({ __proto__: null, value: value }); //main Promise.resolve().then(function () { return existing; }); new Promise(function (resolve, reject) { require(['./direct-relative-external'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }); new Promise(function (resolve, reject) { require(['to-indirect-relative-external'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }); new Promise(function (resolve, reject) { require(['direct-absolute-external'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }); new Promise(function (resolve, reject) { require(['to-indirect-absolute-external'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }); (function (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }); })('dynamic-direct-external' + unknown); new Promise(function (resolve, reject) { require(['to-dynamic-indirect-external'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }); Promise.resolve().then(function () { return existing; }); (function (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }); })('my' + 'replacement'); })); rollup-2.61.1/test/chunking-form/samples/resolve-dynamic-import/_expected/cjs/000077500000000000000000000000001415504077600274515ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-dynamic-import/_expected/cjs/main.js000066400000000000000000000043511415504077600307360ustar00rootroot00000000000000'use strict'; require('./direct-relative-external'); require('to-indirect-relative-external'); require('direct-absolute-external'); require('to-indirect-absolute-external'); 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); } // nested Promise.resolve().then(function () { return existing; }); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('./direct-relative-external')); }); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('to-indirect-relative-external')); }); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('direct-absolute-external')); }); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('to-indirect-absolute-external')); }); const value = 'existing'; console.log('existing'); var existing = /*#__PURE__*/Object.freeze({ __proto__: null, value: value }); //main Promise.resolve().then(function () { return existing; }); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('./direct-relative-external')); }); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('to-indirect-relative-external')); }); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('direct-absolute-external')); }); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('to-indirect-absolute-external')); }); (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })('dynamic-direct-external' + unknown); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('to-dynamic-indirect-external')); }); Promise.resolve().then(function () { return existing; }); (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })('my' + 'replacement'); rollup-2.61.1/test/chunking-form/samples/resolve-dynamic-import/_expected/es/000077500000000000000000000000001415504077600273015ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-dynamic-import/_expected/es/main.js000066400000000000000000000016121415504077600305630ustar00rootroot00000000000000import './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'); const value = 'existing'; console.log('existing'); var existing = /*#__PURE__*/Object.freeze({ __proto__: null, value: value }); //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-2.61.1/test/chunking-form/samples/resolve-dynamic-import/_expected/system/000077500000000000000000000000001415504077600302165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-dynamic-import/_expected/system/main.js000066400000000000000000000022741415504077600315050ustar00rootroot00000000000000System.register(['./direct-relative-external', 'to-indirect-relative-external', 'direct-absolute-external', 'to-indirect-absolute-external'], (function (exports, module) { 'use strict'; return { setters: [function () {}, function () {}, function () {}, function () {}], 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'); const value = 'existing'; console.log('existing'); var existing = /*#__PURE__*/Object.freeze({ __proto__: null, value: value }); //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-2.61.1/test/chunking-form/samples/resolve-dynamic-import/existing.js000066400000000000000000000000721415504077600271210ustar00rootroot00000000000000export const value = 'existing'; console.log('existing'); rollup-2.61.1/test/chunking-form/samples/resolve-dynamic-import/main.js000066400000000000000000000010651415504077600262160ustar00rootroot00000000000000import './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-2.61.1/test/chunking-form/samples/resolve-dynamic-import/nested/000077500000000000000000000000001415504077600262145ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-dynamic-import/nested/nested.js000066400000000000000000000002751415504077600300400ustar00rootroot00000000000000// nested import('existing-name'); import('../direct-relative-external'); import('../indirect-relative-external'); import('direct-absolute-external'); import('indirect-absolute-external'); rollup-2.61.1/test/chunking-form/samples/resolve-file-url/000077500000000000000000000000001415504077600235155ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_config.js000066400000000000000000000023341415504077600254610ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/000077500000000000000000000000001415504077600254555ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/amd/000077500000000000000000000000001415504077600262165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/amd/assets/000077500000000000000000000000001415504077600275205ustar00rootroot00000000000000asset-resolved-8bd22e6e.txt000066400000000000000000000000231415504077600343540ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/amd/assetsAsset for: resolvedasset-solved-28a7ac89.txt000066400000000000000000000000211415504077600337500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/amd/assetsAsset for: solvedasset-unresolved-8dcd7fca.txt000066400000000000000000000000251415504077600350630ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/amd/assetsAsset for: unresolvedrollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/amd/main.js000066400000000000000000000007271415504077600275060ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; const asset$1 = 'resolved'; const chunk$1 = 'resolved'; const asset = new URL(require.toUrl('./assets/asset-unresolved-8dcd7fca.txt'), document.baseURI).href; const chunk = new URL(require.toUrl('./nested/chunk.js'), document.baseURI).href; new Promise(function (resolve, reject) { require(['./nested/chunk2'], resolve, reject); }).then(result => console.log(result, chunk$1, chunk, asset$1, asset)); })); rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/amd/nested/000077500000000000000000000000001415504077600275005ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/amd/nested/chunk.js000066400000000000000000000001021415504077600311370ustar00rootroot00000000000000define((function () { 'use strict'; console.log('chunk'); })); rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/amd/nested/chunk2.js000066400000000000000000000007041415504077600312310ustar00rootroot00000000000000define(['require', 'exports'], (function (require, exports) { 'use strict'; const asset = 'chunkId=nested/chunk2.js:moduleId=solved:fileName=assets/asset-solved-28a7ac89.txt:format=amd:relativePath=../assets/asset-solved-28a7ac89.txt:referenceId=6296c678'; const chunk = 'chunkId=nested/chunk2.js:moduleId=solved:fileName=nested/chunk.js:format=amd:relativePath=chunk.js:referenceId=f6c25ae7'; exports.asset = asset; exports.chunk = chunk; })); rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/cjs/000077500000000000000000000000001415504077600262345ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/cjs/assets/000077500000000000000000000000001415504077600275365ustar00rootroot00000000000000asset-resolved-8bd22e6e.txt000066400000000000000000000000231415504077600343720ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/cjs/assetsAsset for: resolvedasset-solved-28a7ac89.txt000066400000000000000000000000211415504077600337660ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/cjs/assetsAsset for: solvedasset-unresolved-8dcd7fca.txt000066400000000000000000000000251415504077600351010ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/cjs/assetsAsset for: unresolvedrollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/cjs/main.js000066400000000000000000000013361415504077600275210ustar00rootroot00000000000000'use strict'; const asset$1 = 'resolved'; const chunk$1 = 'resolved'; const asset = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/asset-unresolved-8dcd7fca.txt').href : new URL('assets/asset-unresolved-8dcd7fca.txt', document.currentScript && document.currentScript.src || document.baseURI).href); const chunk = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/nested/chunk.js').href : new URL('nested/chunk.js', document.currentScript && document.currentScript.src || document.baseURI).href); Promise.resolve().then(function () { return require('./nested/chunk2.js'); }).then(result => console.log(result, chunk$1, chunk, asset$1, asset)); rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/cjs/nested/000077500000000000000000000000001415504077600275165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/cjs/nested/chunk.js000066400000000000000000000000451415504077600311630ustar00rootroot00000000000000'use strict'; console.log('chunk'); rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/cjs/nested/chunk2.js000066400000000000000000000005741415504077600312540ustar00rootroot00000000000000'use strict'; const asset = 'chunkId=nested/chunk2.js:moduleId=solved:fileName=assets/asset-solved-28a7ac89.txt:format=cjs:relativePath=../assets/asset-solved-28a7ac89.txt:referenceId=6296c678'; const chunk = 'chunkId=nested/chunk2.js:moduleId=solved:fileName=nested/chunk.js:format=cjs:relativePath=chunk.js:referenceId=f6c25ae7'; exports.asset = asset; exports.chunk = chunk; rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/es/000077500000000000000000000000001415504077600260645ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/es/assets/000077500000000000000000000000001415504077600273665ustar00rootroot00000000000000asset-resolved-8bd22e6e.txt000066400000000000000000000000231415504077600342220ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/es/assetsAsset for: resolvedasset-solved-28a7ac89.txt000066400000000000000000000000211415504077600336160ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/es/assetsAsset for: solvedasset-unresolved-8dcd7fca.txt000066400000000000000000000000251415504077600347310ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/es/assetsAsset for: unresolvedrollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/es/main.js000066400000000000000000000004611415504077600273470ustar00rootroot00000000000000const asset$1 = 'resolved'; const chunk$1 = 'resolved'; const asset = new URL('assets/asset-unresolved-8dcd7fca.txt', import.meta.url).href; const chunk = new URL('nested/chunk.js', import.meta.url).href; import('./nested/chunk2.js').then(result => console.log(result, chunk$1, chunk, asset$1, asset)); rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/es/nested/000077500000000000000000000000001415504077600273465ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/es/nested/chunk.js000066400000000000000000000000261415504077600310120ustar00rootroot00000000000000console.log('chunk'); rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/es/nested/chunk2.js000066400000000000000000000005261415504077600311010ustar00rootroot00000000000000const asset = 'chunkId=nested/chunk2.js:moduleId=solved:fileName=assets/asset-solved-28a7ac89.txt:format=es:relativePath=../assets/asset-solved-28a7ac89.txt:referenceId=6296c678'; const chunk = 'chunkId=nested/chunk2.js:moduleId=solved:fileName=nested/chunk.js:format=es:relativePath=chunk.js:referenceId=f6c25ae7'; export { asset, chunk }; rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/system/000077500000000000000000000000001415504077600270015ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/system/assets/000077500000000000000000000000001415504077600303035ustar00rootroot00000000000000asset-resolved-8bd22e6e.txt000066400000000000000000000000231415504077600351370ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/system/assetsAsset for: resolvedasset-solved-28a7ac89.txt000066400000000000000000000000211415504077600345330ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/system/assetsAsset for: solvedasset-unresolved-8dcd7fca.txt000066400000000000000000000000251415504077600356460ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/system/assetsAsset for: unresolvedrollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/system/main.js000066400000000000000000000006741415504077600302720ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const asset$1 = 'resolved'; const chunk$1 = 'resolved'; const asset = new URL('assets/asset-unresolved-8dcd7fca.txt', module.meta.url).href; const chunk = new URL('nested/chunk.js', module.meta.url).href; module.import('./nested/chunk2.js').then(result => console.log(result, chunk$1, chunk, asset$1, asset)); }) }; })); rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/system/nested/000077500000000000000000000000001415504077600302635ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/system/nested/chunk.js000066400000000000000000000001771415504077600317360ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('chunk'); }) }; })); rollup-2.61.1/test/chunking-form/samples/resolve-file-url/_expected/system/nested/chunk2.js000066400000000000000000000007431415504077600320170ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { const asset = exports('asset', 'chunkId=nested/chunk2.js:moduleId=solved:fileName=assets/asset-solved-28a7ac89.txt:format=system:relativePath=../assets/asset-solved-28a7ac89.txt:referenceId=6296c678'); const chunk = exports('chunk', 'chunkId=nested/chunk2.js:moduleId=solved:fileName=nested/chunk.js:format=system:relativePath=chunk.js:referenceId=f6c25ae7'); }) }; })); rollup-2.61.1/test/chunking-form/samples/resolve-file-url/chunk.js000066400000000000000000000000261415504077600251610ustar00rootroot00000000000000console.log('chunk'); rollup-2.61.1/test/chunking-form/samples/resolve-file-url/main.js000066400000000000000000000003241415504077600247760ustar00rootroot00000000000000import { 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-2.61.1/test/chunking-form/samples/sanitize-chunk-names/000077500000000000000000000000001415504077600243565ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/sanitize-chunk-names/_config.js000066400000000000000000000006271415504077600263250ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/sanitize-chunk-names/_expected/000077500000000000000000000000001415504077600263165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/sanitize-chunk-names/_expected/amd/000077500000000000000000000000001415504077600270575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/sanitize-chunk-names/_expected/amd/_virtual_entry-1.js000066400000000000000000000001651415504077600326230ustar00rootroot00000000000000define((function () { 'use strict'; var _virtual_entry1 = "\u0000virtual:entry-1"; return _virtual_entry1; })); rollup-2.61.1/test/chunking-form/samples/sanitize-chunk-names/_expected/amd/_virtual_entry-2.js000066400000000000000000000001651415504077600326240ustar00rootroot00000000000000define((function () { 'use strict'; var _virtual_entry2 = "\u0000virtual:entry-2"; return _virtual_entry2; })); another-_slug_-_result.js000066400000000000000000000002041415504077600337130ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/sanitize-chunk-names/_expected/amddefine((function () { 'use strict'; var another__slug___result = "another-[slug]-#result"; return another__slug___result; })); rollup-2.61.1/test/chunking-form/samples/sanitize-chunk-names/_expected/cjs/000077500000000000000000000000001415504077600270755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/sanitize-chunk-names/_expected/cjs/_virtual_entry-1.js000066400000000000000000000001411415504077600326330ustar00rootroot00000000000000'use strict'; var _virtual_entry1 = "\u0000virtual:entry-1"; module.exports = _virtual_entry1; rollup-2.61.1/test/chunking-form/samples/sanitize-chunk-names/_expected/cjs/_virtual_entry-2.js000066400000000000000000000001411415504077600326340ustar00rootroot00000000000000'use strict'; var _virtual_entry2 = "\u0000virtual:entry-2"; module.exports = _virtual_entry2; another-_slug_-_result.js000066400000000000000000000001601415504077600337320ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/sanitize-chunk-names/_expected/cjs'use strict'; var another__slug___result = "another-[slug]-#result"; module.exports = another__slug___result; rollup-2.61.1/test/chunking-form/samples/sanitize-chunk-names/_expected/es/000077500000000000000000000000001415504077600267255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/sanitize-chunk-names/_expected/es/_virtual_entry-1.js000066400000000000000000000001271415504077600324670ustar00rootroot00000000000000var _virtual_entry1 = "\u0000virtual:entry-1"; export { _virtual_entry1 as default }; rollup-2.61.1/test/chunking-form/samples/sanitize-chunk-names/_expected/es/_virtual_entry-2.js000066400000000000000000000001271415504077600324700ustar00rootroot00000000000000var _virtual_entry2 = "\u0000virtual:entry-2"; export { _virtual_entry2 as default }; rollup-2.61.1/test/chunking-form/samples/sanitize-chunk-names/_expected/es/another-_slug_-_result.js000066400000000000000000000001461415504077600336450ustar00rootroot00000000000000var another__slug___result = "another-[slug]-#result"; export { another__slug___result as default }; rollup-2.61.1/test/chunking-form/samples/sanitize-chunk-names/_expected/system/000077500000000000000000000000001415504077600276425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/sanitize-chunk-names/_expected/system/_virtual_entry-1.js000066400000000000000000000002631415504077600334050ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var _virtual_entry1 = exports('default', "\u0000virtual:entry-1"); }) }; })); rollup-2.61.1/test/chunking-form/samples/sanitize-chunk-names/_expected/system/_virtual_entry-2.js000066400000000000000000000002631415504077600334060ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var _virtual_entry2 = exports('default', "\u0000virtual:entry-2"); }) }; })); another-_slug_-_result.js000066400000000000000000000002731415504077600345040ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/sanitize-chunk-names/main1.js000066400000000000000000000000261415504077600257170ustar00rootroot00000000000000console.log('main1'); rollup-2.61.1/test/chunking-form/samples/sanitize-internal-exports/000077500000000000000000000000001415504077600254635ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/sanitize-internal-exports/_config.js000066400000000000000000000001641415504077600274260ustar00rootroot00000000000000module.exports = { description: 'make sure internal exports are sanitized', options: { input: ['main.js'] } }; rollup-2.61.1/test/chunking-form/samples/sanitize-internal-exports/_expected/000077500000000000000000000000001415504077600274235ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/sanitize-internal-exports/_expected/amd/000077500000000000000000000000001415504077600301645ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/sanitize-internal-exports/_expected/amd/generated-lazy.js000066400000000000000000000002071415504077600334340ustar00rootroot00000000000000define(['exports', './main'], (function (exports, main) { 'use strict'; var lazy = () => main.v1; exports["default"] = lazy; })); rollup-2.61.1/test/chunking-form/samples/sanitize-internal-exports/_expected/amd/main.js000066400000000000000000000176661415504077600314660ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/sanitize-internal-exports/_expected/cjs/000077500000000000000000000000001415504077600302025ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/sanitize-internal-exports/_expected/cjs/generated-lazy.js000066400000000000000000000001471415504077600334550ustar00rootroot00000000000000'use strict'; var main = require('./main.js'); var lazy = () => main.v1; exports["default"] = lazy; rollup-2.61.1/test/chunking-form/samples/sanitize-internal-exports/_expected/cjs/main.js000066400000000000000000000165021415504077600314700ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/chunking-form/samples/sanitize-internal-exports/_expected/es/000077500000000000000000000000001415504077600300325ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/sanitize-internal-exports/_expected/es/generated-lazy.js000066400000000000000000000001231415504077600332770ustar00rootroot00000000000000import { v1 } from './main.js'; var lazy = () => v1; export { lazy as default }; rollup-2.61.1/test/chunking-form/samples/sanitize-internal-exports/_expected/es/main.js000066400000000000000000000064721415504077600313250ustar00rootroot00000000000000var 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-2.61.1/test/chunking-form/samples/sanitize-internal-exports/_expected/system/000077500000000000000000000000001415504077600307475ustar00rootroot00000000000000generated-lazy.js000066400000000000000000000003461415504077600341440ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/sanitize-internal-exports/_expected/system/main.js000066400000000000000000000133511415504077600322340ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/sanitize-internal-exports/constants.js000066400000000000000000000034161415504077600300410ustar00rootroot00000000000000export 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-2.61.1/test/chunking-form/samples/sanitize-internal-exports/lazy.js000066400000000000000000000000731415504077600270000ustar00rootroot00000000000000import { v1 } from './constants'; export default () => v1; rollup-2.61.1/test/chunking-form/samples/sanitize-internal-exports/main.js000066400000000000000000000001031415504077600267370ustar00rootroot00000000000000export * from './constants'; export const lazy = import('./lazy'); rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/000077500000000000000000000000001415504077600260425ustar00rootroot00000000000000avoid-imports-preserve-modules/000077500000000000000000000000001415504077600340575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies_config.js000066400000000000000000000002621415504077600360210ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modulesmodule.exports = { description: 'avoids empty imports if they do not have side-effects when preserving modules (#3359)', options: { output: { preserveModules: true } } }; _expected/000077500000000000000000000000001415504077600360175ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modulesamd/000077500000000000000000000000001415504077600365605ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expecteda.js000066400000000000000000000002371415504077600373400ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); b.js000066400000000000000000000002371415504077600373410ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); main.js000066400000000000000000000001361415504077600400420ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002571415504077600377030ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); cjs/000077500000000000000000000000001415504077600365765ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expecteda.js000066400000000000000000000001541415504077600373540ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const a = 1; exports.a = a; b.js000066400000000000000000000001541415504077600373550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const b = 2; exports.b = b; main.js000066400000000000000000000001441415504077600400570ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002161415504077600377140ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var b = require('./b.js'); const d = b.b + 4; exports.d = d; es/000077500000000000000000000000001415504077600364265ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expecteda.js000066400000000000000000000000341415504077600372010ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/esconst a = 1; export { a }; b.js000066400000000000000000000000341415504077600372020ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expected/esconst b = 2; export { b }; main.js000066400000000000000000000001171415504077600377070ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000751415504077600375470ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600373435ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modules/_expecteda.js000066400000000000000000000002131415504077600401150ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002131415504077600401160ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003751415504077600406320ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003261415504077600404630ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000241415504077600346310ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modulesexport const a = 1; b.js000066400000000000000000000000241415504077600346320ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modulesexport const b = 2; c.js000066400000000000000000000000241415504077600346330ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modulesexport const c = 3; index.js000066400000000000000000000001131415504077600355170ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modulesexport { a } from './a'; export { b } from './b'; export { c } from './c'; main.js000066400000000000000000000001141415504077600353350ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-imports-preserve-modulesimport { a } from './index'; import { d } from './one'; console.log(a + d); one.js000066400000000000000000000000651415504077600351770ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600350075ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies_config.js000066400000000000000000000002561415504077600367540ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-importsmodule.exports = { description: 'avoids empty imports if they do not have side-effects', options: { input: ['main1', 'main2'], external: ['external-side-effect'] } }; _expected/000077500000000000000000000000001415504077600367475ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-importsamd/000077500000000000000000000000001415504077600375105ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-imports/_expectedmain1.js000066400000000000000000000002411415504077600410500ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001561415504077600410560ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600375265ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-imports/_expectedmain1.js000066400000000000000000000001671415504077600410750ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001071415504077600410700ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600373565ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-imports/_expectedmain1.js000066400000000000000000000001461415504077600407220ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000661415504077600407240ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-imports/_expected/esimport 'external-side-effect'; console.log('main2'); system/000077500000000000000000000000001415504077600402735ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-imports/_expectedmain1.js000066400000000000000000000003531415504077600416370ustar00rootroot00000000000000rollup-2.61.1/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: [function () {}], execute: (function () { function onlyUsedByOne() { console.log('Hello'); } onlyUsedByOne(); }) }; })); main2.js000066400000000000000000000002621415504077600416370ustar00rootroot00000000000000rollup-2.61.1/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: [function () {}], execute: (function () { console.log('main2'); }) }; })); dep1.js000066400000000000000000000001431415504077600361740ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000441415504077600363500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-importsimport dep from './dep1.js'; dep(); main2.js000066400000000000000000000000631415504077600363520ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/avoid-side-effect-free-empty-importsimport dep from './dep1.js'; console.log('main2'); rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/000077500000000000000000000000001415504077600330125ustar00rootroot00000000000000_config.js000066400000000000000000000002751415504077600347010ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modulesmodule.exports = { description: 'hoist side-effect imports when avoiding empty imports', options: { input: ['main1', 'main2', 'main3'] }, expectedWarnings: ['CIRCULAR_DEPENDENCY'] }; _expected/000077500000000000000000000000001415504077600346735ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modulesamd/000077500000000000000000000000001415504077600354345ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expectedgenerated-dep2-effect.js000066400000000000000000000001011415504077600420020ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/amddefine((function () { 'use strict'; console.log('dep2'); })); generated-dep4-effect.js000066400000000000000000000001011415504077600420040ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/amddefine((function () { 'use strict'; console.log('dep4'); })); main1.js000066400000000000000000000003461415504077600370020ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002201415504077600367720ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001511415504077600367760ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600354525ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expectedgenerated-dep2-effect.js000066400000000000000000000000441415504077600420260ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/cjs'use strict'; console.log('dep2'); generated-dep4-effect.js000066400000000000000000000000441415504077600420300ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/cjs'use strict'; console.log('dep4'); main1.js000066400000000000000000000003061415504077600370140ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001641415504077600370170ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001151415504077600370140ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600353025ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expectedgenerated-dep2-effect.js000066400000000000000000000000251415504077600416550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/esconsole.log('dep2'); generated-dep4-effect.js000066400000000000000000000000251415504077600416570ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/esconsole.log('dep4'); main1.js000066400000000000000000000002631415504077600366460ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001411415504077600366420ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000741415504077600366500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/esimport './generated-dep4-effect.js'; console.log('main3'); system/000077500000000000000000000000001415504077600362175ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expectedgenerated-dep2-effect.js000066400000000000000000000001761415504077600426010ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001761415504077600426030ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000005041415504077600375610ustar00rootroot00000000000000rollup-2.61.1/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: [function () {}, function () {}], execute: (function () { var value = 42; function onlyUsedByOne(value) { console.log('Hello', value); } onlyUsedByOne(value); }) }; })); main2.js000066400000000000000000000003461415504077600375660ustar00rootroot00000000000000rollup-2.61.1/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: [function () {}, function () {}], execute: (function () { console.log('main2'); }) }; })); main3.js000066400000000000000000000002701415504077600375630ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modules/_expected/systemSystem.register(['./generated-dep4-effect.js'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { console.log('main3'); }) }; })); dep1.js000066400000000000000000000001761415504077600341260ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000251415504077600353520ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modulesconsole.log('dep2'); dep3.js000066400000000000000000000000771415504077600341300ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modulesimport './dep1'; import './dep4-effect.js'; export default 42; dep4-effect.js000066400000000000000000000000251415504077600353540ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modulesconsole.log('dep4'); main1.js000066400000000000000000000001101415504077600342660ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modulesimport dep from './dep1.js'; import value from './dep3.js'; dep(value); main2.js000066400000000000000000000000521415504077600342740ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modulesimport './dep1.js'; console.log('main2'); main3.js000066400000000000000000000000611415504077600342750ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/hoist-side-effect-modulesimport './dep4-effect.js'; console.log('main3'); module-side-effects-empty-imports/000077500000000000000000000000001415504077600344365ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies_config.js000066400000000000000000000002661415504077600364040ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-importsmodule.exports = { description: 'avoids empty imports if moduleSideEffects are false', options: { input: ['main1', 'main2'], treeshake: { moduleSideEffects: false } } }; _expected/000077500000000000000000000000001415504077600363765ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-importsamd/000077500000000000000000000000001415504077600371375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-imports/_expectedmain1.js000066400000000000000000000002001415504077600404720ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001021415504077600404740ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-imports/_expected/amddefine((function () { 'use strict'; console.log('main2'); })); cjs/000077500000000000000000000000001415504077600371555ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-imports/_expectedmain1.js000066400000000000000000000001411415504077600405140ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000451415504077600405200ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-imports/_expected/cjs'use strict'; console.log('main2'); es/000077500000000000000000000000001415504077600370055ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-imports/_expectedmain1.js000066400000000000000000000001221415504077600403430ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000261415504077600403470ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-imports/_expected/esconsole.log('main2'); system/000077500000000000000000000000001415504077600377225ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-imports/_expectedmain1.js000066400000000000000000000003011415504077600412570ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001771415504077600412730ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000671415504077600355470ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-importsexport default 42; console.log('Ignored side-effect'); main1.js000066400000000000000000000000731415504077600360010ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-empty-importsimport value from './dep.js'; console.log('main1', value); main2.js000066400000000000000000000000641415504077600360020ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600337765ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies_config.js000066400000000000000000000002471415504077600357430ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1module.exports = { description: 'handles re-exports in entry points if moduleSideEffects are false', options: { treeshake: { moduleSideEffects: false } } }; _expected/000077500000000000000000000000001415504077600357365ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1amd/000077500000000000000000000000001415504077600364775ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1/_expectedmain.js000066400000000000000000000002541415504077600377620ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); cjs/000077500000000000000000000000001415504077600365155ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1/_expectedmain.js000066400000000000000000000001711415504077600377760ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const value = 42; exports.value = value; es/000077500000000000000000000000001415504077600363455ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1/_expectedmain.js000066400000000000000000000000451415504077600376260ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1/_expected/esconst value = 42; export { value }; system/000077500000000000000000000000001415504077600372625ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1/_expectedmain.js000066400000000000000000000002241415504077600405420ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000331415504077600351610ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1export * from './dep2.js'; dep2.js000066400000000000000000000000311415504077600351600ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1export const value = 42; main.js000066400000000000000000000000431415504077600352550ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-1export { value } from './dep1.js'; module-side-effects-reexports-2/000077500000000000000000000000001415504077600337775ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies_config.js000066400000000000000000000002471415504077600357440ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2module.exports = { description: 'handles re-exports in entry points if moduleSideEffects are false', options: { treeshake: { moduleSideEffects: false } } }; _expected/000077500000000000000000000000001415504077600357375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2amd/000077500000000000000000000000001415504077600365005ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2/_expectedmain.js000066400000000000000000000002541415504077600377630ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); cjs/000077500000000000000000000000001415504077600365165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2/_expectedmain.js000066400000000000000000000001711415504077600377770ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const value = 42; exports.value = value; es/000077500000000000000000000000001415504077600363465ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2/_expectedmain.js000066400000000000000000000000451415504077600376270ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2/_expected/esconst value = 42; export { value }; system/000077500000000000000000000000001415504077600372635ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2/_expectedmain.js000066400000000000000000000002241415504077600405430ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000331415504077600351620ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2export * from './dep2.js'; dep2.js000066400000000000000000000000311415504077600351610ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2export const value = 42; main.js000066400000000000000000000000651415504077600352620ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-2import { value } from './dep1.js'; export { value }; module-side-effects-reexports-3/000077500000000000000000000000001415504077600340005ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies_config.js000066400000000000000000000002471415504077600357450ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3module.exports = { description: 'handles re-exports in entry points if moduleSideEffects are false', options: { treeshake: { moduleSideEffects: false } } }; _expected/000077500000000000000000000000001415504077600357405ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3amd/000077500000000000000000000000001415504077600365015ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3/_expectedmain.js000066400000000000000000000002541415504077600377640ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); cjs/000077500000000000000000000000001415504077600365175ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3/_expectedmain.js000066400000000000000000000001711415504077600400000ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const value = 42; exports.value = value; es/000077500000000000000000000000001415504077600363475ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3/_expectedmain.js000066400000000000000000000000451415504077600376300ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3/_expected/esconst value = 42; export { value }; system/000077500000000000000000000000001415504077600372645ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3/_expectedmain.js000066400000000000000000000002241415504077600405440ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000331415504077600351630ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3export * from './dep2.js'; dep2.js000066400000000000000000000000311415504077600351620ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3export const value = 42; main.js000066400000000000000000000000331415504077600352560ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/side-effect-free-dependencies/module-side-effects-reexports-3export * from './dep1.js'; rollup-2.61.1/test/chunking-form/samples/single-file-manual-chunk/000077500000000000000000000000001415504077600251005ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/single-file-manual-chunk/_config.js000066400000000000000000000003521415504077600270420ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/single-file-manual-chunk/_expected/000077500000000000000000000000001415504077600270405ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/single-file-manual-chunk/_expected/amd/000077500000000000000000000000001415504077600276015ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/single-file-manual-chunk/_expected/amd/generated-first.js000066400000000000000000000000761415504077600332250ustar00rootroot00000000000000define((function () { 'use strict'; console.log('a'); })); rollup-2.61.1/test/chunking-form/samples/single-file-manual-chunk/_expected/amd/generated-second.js000066400000000000000000000004031415504077600333430ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/single-file-manual-chunk/_expected/amd/main.js000066400000000000000000000006441415504077600310670ustar00rootroot00000000000000define(['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-2.61.1/test/chunking-form/samples/single-file-manual-chunk/_expected/cjs/000077500000000000000000000000001415504077600276175ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/single-file-manual-chunk/_expected/cjs/generated-first.js000066400000000000000000000000411415504077600332330ustar00rootroot00000000000000'use strict'; console.log('a'); rollup-2.61.1/test/chunking-form/samples/single-file-manual-chunk/_expected/cjs/generated-second.js000066400000000000000000000003111415504077600333570ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/single-file-manual-chunk/_expected/cjs/main.js000066400000000000000000000005121415504077600310770ustar00rootroot00000000000000'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-2.61.1/test/chunking-form/samples/single-file-manual-chunk/_expected/es/000077500000000000000000000000001415504077600274475ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/single-file-manual-chunk/_expected/es/generated-first.js000066400000000000000000000000221415504077600330620ustar00rootroot00000000000000console.log('a'); rollup-2.61.1/test/chunking-form/samples/single-file-manual-chunk/_expected/es/generated-second.js000066400000000000000000000002551415504077600332160ustar00rootroot00000000000000console.log('b'); var b = /*#__PURE__*/Object.freeze({ __proto__: null }); console.log('c'); var c = /*#__PURE__*/Object.freeze({ __proto__: null }); export { b, c }; rollup-2.61.1/test/chunking-form/samples/single-file-manual-chunk/_expected/es/main.js000066400000000000000000000002501415504077600307260ustar00rootroot00000000000000import('./generated-first.js'); import('./generated-second.js').then(function (n) { return n.b; }); import('./generated-second.js').then(function (n) { return n.c; }); rollup-2.61.1/test/chunking-form/samples/single-file-manual-chunk/_expected/system/000077500000000000000000000000001415504077600303645ustar00rootroot00000000000000generated-first.js000066400000000000000000000001731415504077600337270ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/single-file-manual-chunk/_expected/systemSystem.register([], (function () { 'use strict'; return { execute: (function () { console.log('a'); }) }; })); generated-second.js000066400000000000000000000005101415504077600340460ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/single-file-manual-chunk/_expected/system/main.js000066400000000000000000000004731415504077600316520ustar00rootroot00000000000000System.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-2.61.1/test/chunking-form/samples/single-file-manual-chunk/a.js000066400000000000000000000000211415504077600256470ustar00rootroot00000000000000console.log('a');rollup-2.61.1/test/chunking-form/samples/single-file-manual-chunk/b.js000066400000000000000000000000211415504077600256500ustar00rootroot00000000000000console.log('b');rollup-2.61.1/test/chunking-form/samples/single-file-manual-chunk/c.js000066400000000000000000000000211415504077600256510ustar00rootroot00000000000000console.log('c');rollup-2.61.1/test/chunking-form/samples/single-file-manual-chunk/main.js000066400000000000000000000000661415504077600263640ustar00rootroot00000000000000import('./a.js'); import('./b.js'); import('./c.js'); rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/000077500000000000000000000000001415504077600251175ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/000077500000000000000000000000001415504077600320025ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_config.js000066400000000000000000000004071415504077600337450ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_expected/000077500000000000000000000000001415504077600337425ustar00rootroot00000000000000amd/000077500000000000000000000000001415504077600344245ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_expectedgenerated-component.js000066400000000000000000000013761415504077600407270ustar00rootroot00000000000000rollup-2.61.1/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__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, 'default': component }, [component])); exports.component = component$1; })); generated-main.js000066400000000000000000000006501415504077600376430ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003461415504077600357110ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); cjs/000077500000000000000000000000001415504077600344425ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_expectedgenerated-component.js000066400000000000000000000013141415504077600407350ustar00rootroot00000000000000rollup-2.61.1/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__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, 'default': component }, [component])); exports.component = component$1; generated-main.js000066400000000000000000000005211415504077600376560ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003051415504077600357220ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var main = require('./generated-main.js'); exports.component = main.component; exports.lib = main.lib.named.named; es/000077500000000000000000000000001415504077600342725ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_expectedgenerated-component.js000066400000000000000000000012521415504077600405660ustar00rootroot00000000000000rollup-2.61.1/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__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, 'default': component }, [component])); export { component$1 as c }; generated-main.js000066400000000000000000000003741415504077600375140ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002371415504077600355560ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600352075ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/_expectedgenerated-component.js000066400000000000000000000015671415504077600415140ustar00rootroot00000000000000rollup-2.61.1/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__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, 'default': component }, [component])); exports('c', component$1); }) }; })); generated-main.js000066400000000000000000000005721415504077600404310ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000004161415504077600364720ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002041415504077600342570ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001541415504077600346750ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001421415504077600347540ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/chained-default-reexportimport { named } from './lib.js'; console.log('side-effect', named); export { named as default }; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/lib.js000066400000000000000000000001011415504077600330760ustar00rootroot00000000000000const lib = { named: { named: 42 } }; export { lib as default }; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/chained-default-reexport/main.js000066400000000000000000000001461415504077600332650ustar00rootroot00000000000000export { default as lib } from './lib-reexport.js'; export const component = import('./component.js');deduplicate-synthetic-named-exports-and-default/000077500000000000000000000000001415504077600363015ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports_config.js000066400000000000000000000004741415504077600402500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-defaultmodule.exports = { 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/000077500000000000000000000000001415504077600402415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-defaultamd/000077500000000000000000000000001415504077600410025ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expectedgenerated-lib.js000066400000000000000000000002041415504077600440360ustar00rootroot00000000000000rollup-2.61.1/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.lib = lib; })); main1.js000066400000000000000000000003161415504077600423450ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/amddefine(['exports', './generated-lib'], (function (exports, lib) { 'use strict'; exports.lib = lib.lib; exports.foo = lib.lib.foo; Object.defineProperty(exports, '__esModule', { value: true }); })); main2.js000066400000000000000000000002011415504077600423370ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/amddefine(['./generated-lib'], (function (lib) { 'use strict'; console.log(lib.lib, lib.lib.foo, lib.lib.bar, lib.lib.baz); })); main3.js000066400000000000000000000002661415504077600423530ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/amddefine(['exports', './generated-lib'], (function (exports, lib) { 'use strict'; exports.foo = lib.lib.foo; Object.defineProperty(exports, '__esModule', { value: true }); })); cjs/000077500000000000000000000000001415504077600410205ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expectedgenerated-lib.js000066400000000000000000000001221415504077600440530ustar00rootroot00000000000000rollup-2.61.1/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.lib = lib; main1.js000066400000000000000000000002551415504077600423650ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var lib = require('./generated-lib.js'); exports.lib = lib.lib; exports.foo = lib.lib.foo; main2.js000066400000000000000000000001661415504077600423670ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/cjs'use strict'; var lib = require('./generated-lib.js'); console.log(lib.lib, lib.lib.foo, lib.lib.bar, lib.lib.baz); main3.js000066400000000000000000000002261415504077600423650ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var lib = require('./generated-lib.js'); exports.foo = lib.lib.foo; es/000077500000000000000000000000001415504077600406505ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expectedgenerated-lib.js000066400000000000000000000001051415504077600437040ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/esvar lib = { foo: true, bar: true, baz: true }; export { lib as l }; main1.js000066400000000000000000000002041415504077600422070ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/esimport { l as lib } from './generated-lib.js'; export { l as lib } from './generated-lib.js'; var foo = lib.foo; export { foo }; main2.js000066400000000000000000000001351415504077600422130ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/esimport { l as lib } from './generated-lib.js'; console.log(lib, lib.foo, lib.bar, lib.baz); main3.js000066400000000000000000000001251415504077600422130ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/esimport { l as lib } from './generated-lib.js'; var foo = lib.foo; export { foo }; system/000077500000000000000000000000001415504077600415655ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expectedgenerated-lib.js000066400000000000000000000002551415504077600446270ustar00rootroot00000000000000rollup-2.61.1/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('l', { foo: true, bar: true, baz: true }); }) }; })); main1.js000066400000000000000000000003771415504077600431370ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/systemSystem.register(['./generated-lib.js'], (function (exports) { 'use strict'; var lib; return { setters: [function (module) { lib = module.l; exports('lib', module.l); }], execute: (function () { exports('foo', lib.foo); }) }; })); main2.js000066400000000000000000000003551415504077600431340ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/systemSystem.register(['./generated-lib.js'], (function () { 'use strict'; var lib; return { setters: [function (module) { lib = module.l; }], execute: (function () { console.log(lib, lib.foo, lib.bar, lib.baz); }) }; })); main3.js000066400000000000000000000003421415504077600431310ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-default/_expected/systemSystem.register(['./generated-lib.js'], (function (exports) { 'use strict'; var lib; return { setters: [function (module) { lib = module.l; }], execute: (function () { exports('foo', lib.foo); }) }; })); lib.js000066400000000000000000000000641415504077600374050ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-defaultexport default { foo: true, bar: true, baz: true }; main1.js000066400000000000000000000000601415504077600376400ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-defaultexport { default as lib, foo } from './lib.js'; main2.js000066400000000000000000000001201415504077600376360ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000401415504077600376400ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/deduplicate-synthetic-named-exports-and-defaultexport { foo } from './lib.js'; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/default-reexport/000077500000000000000000000000001415504077600304115ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/default-reexport/_config.js000066400000000000000000000004451415504077600323560ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/synthetic-named-exports/default-reexport/_expected/000077500000000000000000000000001415504077600323515ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/default-reexport/_expected/amd/000077500000000000000000000000001415504077600331125ustar00rootroot00000000000000generated-component.js000066400000000000000000000013431415504077600373300ustar00rootroot00000000000000rollup-2.61.1/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__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, 'default': component }, [component])); exports.component = component$1; })); main.js000066400000000000000000000006341415504077600343200ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/default-reexport/_expected/cjs/000077500000000000000000000000001415504077600331305ustar00rootroot00000000000000generated-component.js000066400000000000000000000012611415504077600373450ustar00rootroot00000000000000rollup-2.61.1/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__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, 'default': component }, [component])); exports.component = component$1; main.js000066400000000000000000000005051415504077600343330ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/default-reexport/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/chunking-form/samples/synthetic-named-exports/default-reexport/_expected/es/000077500000000000000000000000001415504077600327605ustar00rootroot00000000000000generated-component.js000066400000000000000000000012171415504077600371760ustar00rootroot00000000000000rollup-2.61.1/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__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, 'default': component }, [component])); export { component$1 as c }; main.js000066400000000000000000000002461415504077600341650ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/synthetic-named-exports/default-reexport/_expected/system/000077500000000000000000000000001415504077600336755ustar00rootroot00000000000000generated-component.js000066400000000000000000000015431415504077600401150ustar00rootroot00000000000000rollup-2.61.1/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__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, 'default': component }, [component])); exports('c', component$1); }) }; })); main.js000066400000000000000000000004651415504077600351050ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/synthetic-named-exports/default-reexport/component.js000066400000000000000000000001261415504077600327500ustar00rootroot00000000000000import lib, { someExport } from './lib-reexport'; export default { lib, someExport }; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/default-reexport/lib-reexport.js000066400000000000000000000001211415504077600333550ustar00rootroot00000000000000import lib from './lib.js'; console.log('side-effect', lib); export default lib; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/default-reexport/lib.js000066400000000000000000000000231415504077600315100ustar00rootroot00000000000000export default {}; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/default-reexport/main.js000066400000000000000000000001461415504077600316740ustar00rootroot00000000000000export { default as lib } from './lib-reexport.js'; export const component = import('./component.js');rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/dynamic-import/000077500000000000000000000000001415504077600300535ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/dynamic-import/_config.js000066400000000000000000000003741415504077600320210ustar00rootroot00000000000000module.exports = { description: 'synthetic named exports', options: { input: ['main.js'], plugins: [ { transform(code, id) { if (id.endsWith('dep.js')) { return { code, syntheticNamedExports: true }; } } } ] } }; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/dynamic-import/_expected/000077500000000000000000000000001415504077600320135ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/dynamic-import/_expected/amd/000077500000000000000000000000001415504077600325545ustar00rootroot00000000000000generated-dep.js000066400000000000000000000012431415504077600355370ustar00rootroot00000000000000rollup-2.61.1/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__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, 'default': dep, bar: bar }, [dep])); exports.dep = dep$1; })); main.js000066400000000000000000000003711415504077600337600ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/synthetic-named-exports/dynamic-import/_expected/cjs/000077500000000000000000000000001415504077600325725ustar00rootroot00000000000000generated-dep.js000066400000000000000000000011351415504077600355550ustar00rootroot00000000000000rollup-2.61.1/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__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, 'default': dep, bar: bar }, [dep])); exports.dep = dep$1; main.js000066400000000000000000000002731415504077600337770ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/synthetic-named-exports/dynamic-import/_expected/es/000077500000000000000000000000001415504077600324225ustar00rootroot00000000000000generated-dep.js000066400000000000000000000011201415504077600353770ustar00rootroot00000000000000rollup-2.61.1/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__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, 'default': dep, bar: bar }, [dep])); export { dep$1 as d }; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/dynamic-import/_expected/es/main.js000066400000000000000000000001711415504077600337030ustar00rootroot00000000000000import('./generated-dep.js').then(function (n) { return n.d; }).then(({ foo, bar, baz }) => console.log(foo, bar, baz)); rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/dynamic-import/_expected/system/000077500000000000000000000000001415504077600333375ustar00rootroot00000000000000generated-dep.js000066400000000000000000000013741415504077600363270ustar00rootroot00000000000000rollup-2.61.1/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__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, 'default': dep, bar: bar }, [dep])); exports('d', dep$1); }) }; })); main.js000066400000000000000000000003701415504077600345420ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/synthetic-named-exports/dynamic-import/dep.js000066400000000000000000000000611415504077600311560ustar00rootroot00000000000000export default { foo: 1 }; export const bar = 2; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/dynamic-import/main.js000066400000000000000000000001141415504077600313310ustar00rootroot00000000000000import('./dep.js').then(({ foo, bar, baz }) => console.log(foo, bar, baz)); rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/entry/000077500000000000000000000000001415504077600262605ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/entry/_config.js000066400000000000000000000004231415504077600302210ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/synthetic-named-exports/entry/_expected/000077500000000000000000000000001415504077600302205ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/entry/_expected/amd/000077500000000000000000000000001415504077600307615ustar00rootroot00000000000000generated-main.js000066400000000000000000000003111415504077600341130ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/synthetic-named-exports/entry/_expected/amd/main.js000066400000000000000000000002731415504077600322450ustar00rootroot00000000000000define(['exports', './generated-main'], (function (exports, main) { 'use strict'; exports.exists = main.exists; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/entry/_expected/amd/other.js000066400000000000000000000001571415504077600324430ustar00rootroot00000000000000define(['./generated-main'], (function (main) { 'use strict'; console.log(main.__synthetic.synthetic); })); rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/entry/_expected/cjs/000077500000000000000000000000001415504077600307775ustar00rootroot00000000000000generated-main.js000066400000000000000000000002251415504077600341350ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/synthetic-named-exports/entry/_expected/cjs/main.js000066400000000000000000000002331415504077600322570ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var main = require('./generated-main.js'); exports.exists = main.exists; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/entry/_expected/cjs/other.js000066400000000000000000000001441415504077600324550ustar00rootroot00000000000000'use strict'; var main = require('./generated-main.js'); console.log(main.__synthetic.synthetic); rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/entry/_expected/es/000077500000000000000000000000001415504077600306275ustar00rootroot00000000000000generated-main.js000066400000000000000000000001641415504077600337670ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/entry/_expected/esconst exists = 'exists'; const __synthetic = { synthetic: 'synthetic' }; export { __synthetic as _, exists as e }; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/entry/_expected/es/main.js000066400000000000000000000000631415504077600321100ustar00rootroot00000000000000export { e as exists } from './generated-main.js'; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/entry/_expected/es/other.js000066400000000000000000000001351415504077600323050ustar00rootroot00000000000000import { _ as __synthetic } from './generated-main.js'; console.log(__synthetic.synthetic); rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/entry/_expected/system/000077500000000000000000000000001415504077600315445ustar00rootroot00000000000000generated-main.js000066400000000000000000000003301415504077600346770ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/synthetic-named-exports/entry/_expected/system/main.js000066400000000000000000000003111415504077600330210ustar00rootroot00000000000000System.register(['./generated-main.js'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('exists', module.e); }], execute: (function () { }) }; })); rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/entry/_expected/system/other.js000066400000000000000000000003651415504077600332270ustar00rootroot00000000000000System.register(['./generated-main.js'], (function () { 'use strict'; var __synthetic; return { setters: [function (module) { __synthetic = module._; }], execute: (function () { console.log(__synthetic.synthetic); }) }; })); rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/entry/main.js000066400000000000000000000001271415504077600275420ustar00rootroot00000000000000export const exists = 'exists'; export const __synthetic = { synthetic: 'synthetic' }; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/entry/other.js000066400000000000000000000000741415504077600277400ustar00rootroot00000000000000import { synthetic } from './main'; console.log(synthetic); rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/global-conflict/000077500000000000000000000000001415504077600301565ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/global-conflict/_config.js000066400000000000000000000004331415504077600321200ustar00rootroot00000000000000module.exports = { description: 'avoids conflicts with global variables when re-exporting synthetic named exports', options: { plugins: [ { name: 'test-plugin', transform(code) { return { code, syntheticNamedExports: true }; } } ] } }; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/global-conflict/_expected/000077500000000000000000000000001415504077600321165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/global-conflict/_expected/amd/000077500000000000000000000000001415504077600326575ustar00rootroot00000000000000main.js000066400000000000000000000003551415504077600340650ustar00rootroot00000000000000rollup-2.61.1/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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/global-conflict/_expected/cjs/000077500000000000000000000000001415504077600326755ustar00rootroot00000000000000main.js000066400000000000000000000002701415504077600340770ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/global-conflict/_expected/cjs'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var dep = { foo: 'bar' }; // This should log a global variable console.log(foo); exports.foo = dep.foo; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/global-conflict/_expected/es/000077500000000000000000000000001415504077600325255ustar00rootroot00000000000000main.js000066400000000000000000000002001415504077600337200ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/synthetic-named-exports/global-conflict/_expected/system/000077500000000000000000000000001415504077600334425ustar00rootroot00000000000000main.js000066400000000000000000000003441415504077600346460ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/synthetic-named-exports/global-conflict/dep.js000066400000000000000000000001261415504077600312630ustar00rootroot00000000000000export default { foo: 'bar' }; // This should log a global variable console.log(foo); rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/global-conflict/main.js000066400000000000000000000000401415504077600314320ustar00rootroot00000000000000export { foo } from './dep.js'; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2/000077500000000000000000000000001415504077600331605ustar00rootroot00000000000000_config.js000066400000000000000000000005211415504077600350410ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2module.exports = { description: 'mixed synthetic named exports 2', options: { input: ['main.js', 'main2.js'], plugins: [ { transform(code, id) { if (id.endsWith('dep1.js') || id.endsWith('dep2.js')) { return { code, syntheticNamedExports: true }; } return null; } } ] } }; _expected/000077500000000000000000000000001415504077600350415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2amd/000077500000000000000000000000001415504077600356025ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2/_expectedgenerated-dep2.js000066400000000000000000000001711415504077600407250ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001461415504077600370650ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001461415504077600371470ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600356205ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2/_expectedgenerated-dep2.js000066400000000000000000000001071415504077600407420ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001331415504077600370770ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001331415504077600371610ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600354505ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2/_expectedgenerated-dep2.js000066400000000000000000000000711415504077600405720ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2/_expected/esvar dep2 = {bar: {foo: 'works'}}; export { dep2 as d }; main.js000066400000000000000000000001151415504077600367270ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001151415504077600370110ustar00rootroot00000000000000rollup-2.61.1/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/000077500000000000000000000000001415504077600363655ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2/_expectedgenerated-dep2.js000066400000000000000000000002401415504077600415050ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003361415504077600376510ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003361415504077600377330ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000511415504077600342640ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2export {bar as default} from './dep2.js';dep2.js000066400000000000000000000000451415504077600342700ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2export default {bar: {foo: 'works'}};main.js000066400000000000000000000000621415504077600343610ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2import { foo } from './dep1.js'; console.log(foo);main2.js000066400000000000000000000000671415504077600344500ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports-2import { bar } from './dep2.js'; console.log(bar.foo); rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports/000077500000000000000000000000001415504077600330215ustar00rootroot00000000000000_config.js000066400000000000000000000004411415504077600347030ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exportsmodule.exports = { description: 'mixed synthetic named exports', options: { input: ['main.js'], plugins: [ { resolveId(id) { if (id.endsWith('dep1.js')) { return { id, syntheticNamedExports: true }; } return null; } } ] } }; _expected/000077500000000000000000000000001415504077600347025ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exportsamd/000077500000000000000000000000001415504077600354435ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports/_expectedmain.js000066400000000000000000000017131415504077600367270ustar00rootroot00000000000000rollup-2.61.1/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__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, foo: foo, 'default': d }, [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; Object.defineProperty(exports, '__esModule', { value: true }); })); cjs/000077500000000000000000000000001415504077600354615ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports/_expectedmain.js000066400000000000000000000015311415504077600367430ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports/_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 d = { fn: 42, hello: 'hola' }; const foo = 100; var ns = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, foo: foo, 'default': d }, [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/000077500000000000000000000000001415504077600353115ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports/_expectedmain.js000066400000000000000000000014271415504077600365770ustar00rootroot00000000000000rollup-2.61.1/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__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, foo: foo, 'default': d }, [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/000077500000000000000000000000001415504077600362265ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exports/_expectedmain.js000066400000000000000000000021001415504077600375010ustar00rootroot00000000000000rollup-2.61.1/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__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, foo: foo, 'default': d }, [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.js000066400000000000000000000001221415504077600341240ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exportsconst d = { fn: 42, hello: 'hola' }; export const foo = 100; export default d;dep2.js000066400000000000000000000000521415504077600341270ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/mixed-synthetic-named-exportsexport {fn, foo, stuff} from './dep1.js'; main.js000066400000000000000000000003121415504077600342200ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/000077500000000000000000000000001415504077600273565ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/_config.js000066400000000000000000000005031415504077600313160ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/000077500000000000000000000000001415504077600313165ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/amd/000077500000000000000000000000001415504077600320575ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/amd/main.js000066400000000000000000000001611415504077600333370ustar00rootroot00000000000000define((function () { 'use strict'; var main = { one: { two: { three: { four: 42 } } } }; return main; })); rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/amd/main2.js000066400000000000000000000001171415504077600334220ustar00rootroot00000000000000define(['./main'], (function (main) { 'use strict'; return main.one; })); rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/amd/main3.js000066400000000000000000000001231415504077600334200ustar00rootroot00000000000000define(['./main'], (function (main) { 'use strict'; return main.one.two; })); rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/amd/main4.js000066400000000000000000000001311415504077600334200ustar00rootroot00000000000000define(['./main'], (function (main) { 'use strict'; return main.one.two.three; })); rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/amd/main5.js000066400000000000000000000001361415504077600334260ustar00rootroot00000000000000define(['./main'], (function (main) { 'use strict'; return main.one.two.three.four; })); rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/cjs/000077500000000000000000000000001415504077600320755ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/cjs/main.js000066400000000000000000000001351415504077600333560ustar00rootroot00000000000000'use strict'; var main = { one: { two: { three: { four: 42 } } } }; module.exports = main; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/cjs/main2.js000066400000000000000000000001161415504077600334370ustar00rootroot00000000000000'use strict'; var main = require('./main.js'); module.exports = main.one; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/cjs/main3.js000066400000000000000000000001221415504077600334350ustar00rootroot00000000000000'use strict'; var main = require('./main.js'); module.exports = main.one.two; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/cjs/main4.js000066400000000000000000000001301415504077600334350ustar00rootroot00000000000000'use strict'; var main = require('./main.js'); module.exports = main.one.two.three; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/cjs/main5.js000066400000000000000000000001351415504077600334430ustar00rootroot00000000000000'use strict'; var main = require('./main.js'); module.exports = main.one.two.three.four; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/es/000077500000000000000000000000001415504077600317255ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/es/main.js000066400000000000000000000001231415504077600332030ustar00rootroot00000000000000var main = { one: { two: { three: { four: 42 } } } }; export { main as default }; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/es/main2.js000066400000000000000000000001201415504077600332620ustar00rootroot00000000000000import main from './main.js'; var one = main.one; export { one as default }; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/es/main3.js000066400000000000000000000001241415504077600332670ustar00rootroot00000000000000import main from './main.js'; var two = main.one.two; export { two as default }; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/es/main4.js000066400000000000000000000001361415504077600332730ustar00rootroot00000000000000import main from './main.js'; var three = main.one.two.three; export { three as default }; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/es/main5.js000066400000000000000000000001411415504077600332700ustar00rootroot00000000000000import main from './main.js'; var four = main.one.two.three.four; export { four as default }; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/_expected/system/000077500000000000000000000000001415504077600326425ustar00rootroot00000000000000main.js000066400000000000000000000002721415504077600340460ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003511415504077600341260ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003551415504077600341330ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003631415504077600341330ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003701415504077600341320ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/main.js000066400000000000000000000000721415504077600306370ustar00rootroot00000000000000export default { one: { two: { three: { four: 42 } } } }; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/main2.js000066400000000000000000000000541415504077600307210ustar00rootroot00000000000000export { one as default } from './main.js'; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/main3.js000066400000000000000000000000551415504077600307230ustar00rootroot00000000000000export { two as default } from './main2.js'; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/main4.js000066400000000000000000000000571415504077600307260ustar00rootroot00000000000000export { three as default } from './main3.js'; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/multi-level/main5.js000066400000000000000000000000561415504077600307260ustar00rootroot00000000000000export { four as default } from './main4.js'; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/namespace/000077500000000000000000000000001415504077600270535ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/namespace/_config.js000066400000000000000000000004751415504077600310230ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/synthetic-named-exports/namespace/_expected/000077500000000000000000000000001415504077600310135ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/namespace/_expected/amd/000077500000000000000000000000001415504077600315545ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/namespace/_expected/amd/main.js000066400000000000000000000021051415504077600330340ustar00rootroot00000000000000define(['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__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, 'default': synthetic, foo: foo }, [synthetic])); const bar = 'bar'; var dep = 'not-overwritten'; var dep$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, bar: bar, 'default': dep, synthetic: synthetic$1, foo: foo }, [synthetic])); exports.dep = dep$1; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/namespace/_expected/cjs/000077500000000000000000000000001415504077600315725ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/namespace/_expected/cjs/main.js000066400000000000000000000017601415504077600330600ustar00rootroot00000000000000'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); } var synthetic = { foo: 'synthetic-foo', bar: 'synthetic-bar', baz: 'synthetic-baz', default: 'not-in-namespace' }; const foo = 'foo'; var synthetic$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, 'default': synthetic, foo: foo }, [synthetic])); const bar = 'bar'; var dep = 'not-overwritten'; var dep$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, bar: bar, 'default': dep, synthetic: synthetic$1, foo: foo }, [synthetic])); exports.dep = dep$1; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/namespace/_expected/es/000077500000000000000000000000001415504077600314225ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/namespace/_expected/es/main.js000066400000000000000000000016451415504077600327120ustar00rootroot00000000000000function _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__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, 'default': synthetic, foo: foo }, [synthetic])); const bar = 'bar'; var dep = 'not-overwritten'; var dep$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, bar: bar, 'default': dep, synthetic: synthetic$1, foo: foo }, [synthetic])); export { dep$1 as dep }; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/namespace/_expected/system/000077500000000000000000000000001415504077600323375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/namespace/_expected/system/main.js000066400000000000000000000021731415504077600336240ustar00rootroot00000000000000System.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__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, 'default': synthetic, foo: foo }, [synthetic])); const bar = 'bar'; var dep = 'not-overwritten'; var dep$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, bar: bar, 'default': dep, synthetic: synthetic$1, foo: foo }, [synthetic])); exports('dep', dep$1); }) }; })); rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/namespace/dep.js000066400000000000000000000002111415504077600301530ustar00rootroot00000000000000export * as synthetic from './synthetic.js'; export const bar = 'bar'; export default 'not-overwritten'; export * from './synthetic.js'; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/namespace/main.js000066400000000000000000000000411415504077600303300ustar00rootroot00000000000000export * as dep from './dep.js'; rollup-2.61.1/test/chunking-form/samples/synthetic-named-exports/namespace/synthetic.js000066400000000000000000000002201415504077600314150ustar00rootroot00000000000000export default { foo: 'synthetic-foo', bar: 'synthetic-bar', baz: 'synthetic-baz', default: 'not-in-namespace' }; export const foo = 'foo'; rollup-2.61.1/test/chunking-form/samples/system-exports-wrap-pure-annotation/000077500000000000000000000000001415504077600274375ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/system-exports-wrap-pure-annotation/_config.js000066400000000000000000000002041415504077600313750ustar00rootroot00000000000000module.exports = { description: 'system exports should wrap pure annotations', options: { input: ['main1.js', 'main2.js'] } }; rollup-2.61.1/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/000077500000000000000000000000001415504077600313775ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/amd/000077500000000000000000000000001415504077600321405ustar00rootroot00000000000000generated-dep.js000066400000000000000000000002241415504077600351210ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/amd/main1.js000066400000000000000000000001371415504077600335040ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log('1', dep.dep); })); rollup-2.61.1/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/amd/main2.js000066400000000000000000000001371415504077600335050ustar00rootroot00000000000000define(['./generated-dep'], (function (dep) { 'use strict'; console.log('2', dep.dep); })); rollup-2.61.1/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/cjs/000077500000000000000000000000001415504077600321565ustar00rootroot00000000000000generated-dep.js000066400000000000000000000001361415504077600351410ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/cjs'use strict'; var dep = /*#__PURE__*/ (function() { return 0; })(); exports.dep = dep; rollup-2.61.1/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/cjs/main1.js000066400000000000000000000001241415504077600335160ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('1', dep.dep); rollup-2.61.1/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/cjs/main2.js000066400000000000000000000001241415504077600335170ustar00rootroot00000000000000'use strict'; var dep = require('./generated-dep.js'); console.log('2', dep.dep); rollup-2.61.1/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/es/000077500000000000000000000000001415504077600320065ustar00rootroot00000000000000generated-dep.js000066400000000000000000000001211415504077600347630ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/esvar dep = /*#__PURE__*/ (function() { return 0; })(); export { dep as d }; rollup-2.61.1/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/es/main1.js000066400000000000000000000001071415504077600333470ustar00rootroot00000000000000import { d as dep } from './generated-dep.js'; console.log('1', dep); rollup-2.61.1/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/es/main2.js000066400000000000000000000001071415504077600333500ustar00rootroot00000000000000import { d as dep } from './generated-dep.js'; console.log('2', dep); rollup-2.61.1/test/chunking-form/samples/system-exports-wrap-pure-annotation/_expected/system/000077500000000000000000000000001415504077600327235ustar00rootroot00000000000000generated-dep.js000066400000000000000000000003051415504077600357040ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003271415504077600342110ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000003271415504077600342120ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/chunking-form/samples/system-exports-wrap-pure-annotation/dep.js000066400000000000000000000001021415504077600305360ustar00rootroot00000000000000export var dep = /*#__PURE__*/ (function() { return 0; })(); rollup-2.61.1/test/chunking-form/samples/system-exports-wrap-pure-annotation/main1.js000066400000000000000000000000701415504077600307770ustar00rootroot00000000000000import { dep } from './dep.js'; console.log('1', dep); rollup-2.61.1/test/chunking-form/samples/system-exports-wrap-pure-annotation/main2.js000066400000000000000000000000701415504077600310000ustar00rootroot00000000000000import { dep } from './dep.js'; console.log('2', dep); rollup-2.61.1/test/chunking-form/samples/tree-shaken-dynamic-hash/000077500000000000000000000000001415504077600250725ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/tree-shaken-dynamic-hash/_config.js000066400000000000000000000003271415504077600270360ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/chunking-form/samples/tree-shaken-dynamic-hash/_expected/000077500000000000000000000000001415504077600270325ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/tree-shaken-dynamic-hash/_expected/amd/000077500000000000000000000000001415504077600275735ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/tree-shaken-dynamic-hash/_expected/amd/16d985e6.js000066400000000000000000000001141415504077600312200ustar00rootroot00000000000000define((function () { 'use strict'; var main = null; return main; })); rollup-2.61.1/test/chunking-form/samples/tree-shaken-dynamic-hash/_expected/cjs/000077500000000000000000000000001415504077600276115ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/tree-shaken-dynamic-hash/_expected/cjs/05ff8838.js000066400000000000000000000000701415504077600312370ustar00rootroot00000000000000'use strict'; var main = null; module.exports = main; rollup-2.61.1/test/chunking-form/samples/tree-shaken-dynamic-hash/_expected/es/000077500000000000000000000000001415504077600274415ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/tree-shaken-dynamic-hash/_expected/es/bed29d35.js000066400000000000000000000000561415504077600312210ustar00rootroot00000000000000var main = null; export { main as default }; rollup-2.61.1/test/chunking-form/samples/tree-shaken-dynamic-hash/_expected/system/000077500000000000000000000000001415504077600303565ustar00rootroot00000000000000rollup-2.61.1/test/chunking-form/samples/tree-shaken-dynamic-hash/_expected/system/0998116a.js000066400000000000000000000002251415504077600317150ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', null); }) }; })); rollup-2.61.1/test/chunking-form/samples/tree-shaken-dynamic-hash/foo.js000066400000000000000000000000231415504077600262060ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/chunking-form/samples/tree-shaken-dynamic-hash/main.js000066400000000000000000000000641415504077600263540ustar00rootroot00000000000000export default false ? import('./foo.js') : null; rollup-2.61.1/test/cli/000077500000000000000000000000001415504077600146555ustar00rootroot00000000000000rollup-2.61.1/test/cli/index.js000066400000000000000000000065341415504077600163320ustar00rootroot00000000000000const assert = require('assert'); const { exec } = require('child_process'); const path = require('path'); const sander = require('sander'); const { normaliseOutput, runTestSuiteWithSamples, assertDirectoriesAreEqual } = require('../utils.js'); const cwd = process.cwd(); sander.rimrafSync(__dirname, 'node_modules'); sander.copydirSync(__dirname, 'node_modules_rename_me').to(__dirname, 'node_modules'); runTestSuiteWithSamples( 'cli', path.resolve(__dirname, 'samples'), (dir, config) => { (config.skip ? it.skip : config.solo ? it.only : it)( path.basename(dir) + ': ' + config.description, done => { process.chdir(config.cwd || dir); if (config.before) config.before(); const command = config.command.replace( /(^| )rollup($| )/g, `node ${path.resolve(__dirname, '../../dist/bin')}${path.sep}rollup ` ); const childProcess = exec( command, { timeout: 40000, env: { ...process.env, FORCE_COLOR: '0', ...config.env } }, (err, code, stderr) => { if (config.after) config.after(); if (err && !err.killed) { if (config.error) { const shouldContinue = config.error(err); if (!shouldContinue) return done(); } else { throw err; } } if ('stderr' in config) { const shouldContinue = config.stderr(stderr); if (!shouldContinue) return done(); } else if (stderr) { console.error(stderr); } let unintendedError; if (config.execute) { try { const fn = new Function('require', 'module', 'exports', 'assert', code); const module = { exports: {} }; fn(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 (err) { if (config.error) { config.error(err); } else { unintendedError = err; } } if (config.show || unintendedError) { console.log(code + '\n\n\n'); } if (config.solo) console.groupEnd(); unintendedError ? done(unintendedError) : done(); } else if (config.result) { try { config.result(code); done(); } catch (err) { done(err); } } else if (config.test) { try { config.test(); done(); } catch (err) { done(err); } } else if ( sander.existsSync('_expected') && sander.statSync('_expected').isDirectory() ) { try { assertDirectoriesAreEqual('_actual', '_expected'); done(); } catch (err) { done(err); } } else { const expected = sander.readFileSync('_expected.js').toString(); try { assert.equal(normaliseOutput(code), normaliseOutput(expected)); done(); } catch (err) { done(err); } } } ); childProcess.stderr.on('data', async data => { if (config.abortOnStderr) { try { if (await config.abortOnStderr(data)) { childProcess.kill('SIGTERM'); } } catch (err) { childProcess.kill('SIGTERM'); done(err); } } }); } ).timeout(50000); }, () => process.chdir(cwd) ); rollup-2.61.1/test/cli/node_modules/000077500000000000000000000000001415504077600173325ustar00rootroot00000000000000rollup-2.61.1/test/cli/node_modules/bar/000077500000000000000000000000001415504077600200765ustar00rootroot00000000000000rollup-2.61.1/test/cli/node_modules/bar/lib/000077500000000000000000000000001415504077600206445ustar00rootroot00000000000000rollup-2.61.1/test/cli/node_modules/bar/lib/config.js000066400000000000000000000003021415504077600224420ustar00rootroot00000000000000const replace = require( '@rollup/plugin-replace' ); module.exports = { input: 'main.js', output: { format: 'cjs' }, plugins: [ replace( { preventAssignment: true, ANSWER: 42 } ) ] }; rollup-2.61.1/test/cli/node_modules/bar/package.json000066400000000000000000000000351415504077600223620ustar00rootroot00000000000000{ "main": "lib/config.js" } rollup-2.61.1/test/cli/node_modules/rollup-config-foo/000077500000000000000000000000001415504077600226735ustar00rootroot00000000000000rollup-2.61.1/test/cli/node_modules/rollup-config-foo/lib/000077500000000000000000000000001415504077600234415ustar00rootroot00000000000000rollup-2.61.1/test/cli/node_modules/rollup-config-foo/lib/config.js000066400000000000000000000003021415504077600252370ustar00rootroot00000000000000const replace = require( '@rollup/plugin-replace' ); module.exports = { input: 'main.js', output: { format: 'cjs' }, plugins: [ replace( { preventAssignment: true, ANSWER: 42 } ) ] }; rollup-2.61.1/test/cli/node_modules/rollup-config-foo/package.json000066400000000000000000000000351415504077600251570ustar00rootroot00000000000000{ "main": "lib/config.js" } rollup-2.61.1/test/cli/node_modules_rename_me/000077500000000000000000000000001415504077600213425ustar00rootroot00000000000000rollup-2.61.1/test/cli/node_modules_rename_me/bar/000077500000000000000000000000001415504077600221065ustar00rootroot00000000000000rollup-2.61.1/test/cli/node_modules_rename_me/bar/lib/000077500000000000000000000000001415504077600226545ustar00rootroot00000000000000rollup-2.61.1/test/cli/node_modules_rename_me/bar/lib/config.js000066400000000000000000000003021415504077600244520ustar00rootroot00000000000000const replace = require( '@rollup/plugin-replace' ); module.exports = { input: 'main.js', output: { format: 'cjs' }, plugins: [ replace( { preventAssignment: true, ANSWER: 42 } ) ] }; rollup-2.61.1/test/cli/node_modules_rename_me/bar/package.json000066400000000000000000000000351415504077600243720ustar00rootroot00000000000000{ "main": "lib/config.js" } rollup-2.61.1/test/cli/node_modules_rename_me/rollup-config-foo/000077500000000000000000000000001415504077600247035ustar00rootroot00000000000000rollup-2.61.1/test/cli/node_modules_rename_me/rollup-config-foo/lib/000077500000000000000000000000001415504077600254515ustar00rootroot00000000000000rollup-2.61.1/test/cli/node_modules_rename_me/rollup-config-foo/lib/config.js000066400000000000000000000003021415504077600272470ustar00rootroot00000000000000const replace = require( '@rollup/plugin-replace' ); module.exports = { input: 'main.js', output: { format: 'cjs' }, plugins: [ replace( { preventAssignment: true, ANSWER: 42 } ) ] }; rollup-2.61.1/test/cli/node_modules_rename_me/rollup-config-foo/package.json000066400000000000000000000000351415504077600271670ustar00rootroot00000000000000{ "main": "lib/config.js" } rollup-2.61.1/test/cli/samples/000077500000000000000000000000001415504077600163215ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/allow-output-prefix/000077500000000000000000000000001415504077600222705ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/allow-output-prefix/_config.js000066400000000000000000000002641415504077600242340ustar00rootroot00000000000000module.exports = { description: 'allows output options to be prefixed with "output."', command: 'rollup main.js --output.format es --output.footer "console.log(\'Rollup!\')"' }; rollup-2.61.1/test/cli/samples/allow-output-prefix/_expected.js000066400000000000000000000000611415504077600245630ustar00rootroot00000000000000assert.equal( 1 + 1, 2 ); console.log('Rollup!') rollup-2.61.1/test/cli/samples/allow-output-prefix/main.js000066400000000000000000000000321415504077600235450ustar00rootroot00000000000000assert.equal( 1 + 1, 2 ); rollup-2.61.1/test/cli/samples/amd/000077500000000000000000000000001415504077600170625ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/amd/_config.js000066400000000000000000000002221415504077600210200ustar00rootroot00000000000000module.exports = { description: 'sets AMD module ID and define function', command: 'rollup -i main.js -f amd --amd.id foo --amd.define defn' }; rollup-2.61.1/test/cli/samples/amd/_expected.js000066400000000000000000000001171415504077600213570ustar00rootroot00000000000000defn('foo', (function () { 'use strict'; var main = 42; return main; })); rollup-2.61.1/test/cli/samples/amd/main.js000066400000000000000000000000221415504077600203360ustar00rootroot00000000000000export default 42;rollup-2.61.1/test/cli/samples/banner-intro-outro-footer/000077500000000000000000000000001415504077600233615ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/banner-intro-outro-footer/_config.js000066400000000000000000000003071415504077600253230ustar00rootroot00000000000000module.exports = { description: 'adds banner/intro/outro/footer', command: 'rollup -i main.js -f iife --indent --banner "// banner" --intro "// intro" --outro "// outro" --footer "// footer"' }; rollup-2.61.1/test/cli/samples/banner-intro-outro-footer/_expected.js000066400000000000000000000001441415504077600256560ustar00rootroot00000000000000// banner (function () { 'use strict'; // intro console.log( 42 ); // outro })(); // footer rollup-2.61.1/test/cli/samples/banner-intro-outro-footer/main.js000066400000000000000000000000231415504077600246360ustar00rootroot00000000000000console.log( 42 ); rollup-2.61.1/test/cli/samples/code-splitting-named-default-inputs/000077500000000000000000000000001415504077600252725ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/code-splitting-named-default-inputs/_config.js000066400000000000000000000007621415504077600272410ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-b70571c1.js:\n` + "console.log('main1');\n" + '\n' + `//→ Entry 2-cc781491.js:\n` + "console.log('main2');\n" + '\n' + `//→ main3-5e259623.js:\n` + "console.log('main3');\n" ); } }; rollup-2.61.1/test/cli/samples/code-splitting-named-default-inputs/main 2.js000066400000000000000000000000261415504077600266740ustar00rootroot00000000000000console.log('main2'); rollup-2.61.1/test/cli/samples/code-splitting-named-default-inputs/main1.js000066400000000000000000000000261415504077600266330ustar00rootroot00000000000000console.log('main1'); rollup-2.61.1/test/cli/samples/code-splitting-named-default-inputs/main3.js000066400000000000000000000000261415504077600266350ustar00rootroot00000000000000console.log('main3'); rollup-2.61.1/test/cli/samples/code-splitting-named-inputs/000077500000000000000000000000001415504077600236505ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/code-splitting-named-inputs/_config.js000066400000000000000000000010011415504077600256020ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-b70571c1.js:\n` + "console.log('main1');\n" + '\n' + `//→ Entry 2-cc781491.js:\n` + "console.log('main2');\n" + '\n' + `//→ main3-5e259623.js:\n` + "console.log('main3');\n" ); } }; rollup-2.61.1/test/cli/samples/code-splitting-named-inputs/main 2.js000066400000000000000000000000261415504077600252520ustar00rootroot00000000000000console.log('main2'); rollup-2.61.1/test/cli/samples/code-splitting-named-inputs/main1.js000066400000000000000000000000261415504077600252110ustar00rootroot00000000000000console.log('main1'); rollup-2.61.1/test/cli/samples/code-splitting-named-inputs/main3.js000066400000000000000000000000261415504077600252130ustar00rootroot00000000000000console.log('main3'); rollup-2.61.1/test/cli/samples/config-async-function/000077500000000000000000000000001415504077600225245ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-async-function/_config.js000066400000000000000000000001501415504077600244620ustar00rootroot00000000000000module.exports = { description: 'supports using an async function as config', command: 'rollup -c' }; rollup-2.61.1/test/cli/samples/config-async-function/_expected.js000066400000000000000000000000661415504077600250240ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-2.61.1/test/cli/samples/config-async-function/main.js000066400000000000000000000000231415504077600240010ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/cli/samples/config-async-function/rollup.config.js000066400000000000000000000001471415504077600256450ustar00rootroot00000000000000export default async () => ({ input: 'main.js', output: { format: 'cjs', exports: 'auto' }, }); rollup-2.61.1/test/cli/samples/config-cjs-dirname/000077500000000000000000000000001415504077600217605ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-cjs-dirname/_config.js000066400000000000000000000001741415504077600237240ustar00rootroot00000000000000module.exports = { description: 'does not transpile cjs configs and provides correct __filename', command: 'rollup -c' }; rollup-2.61.1/test/cli/samples/config-cjs-dirname/_expected.js000066400000000000000000000001471415504077600242600ustar00rootroot00000000000000console.log('nested/plugin.js'); console.log('plugin.js'); var main = 42; export { main as default }; rollup-2.61.1/test/cli/samples/config-cjs-dirname/main.js000066400000000000000000000000231415504077600232350ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/cli/samples/config-cjs-dirname/nested/000077500000000000000000000000001415504077600232425ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-cjs-dirname/nested/plugin.js000066400000000000000000000002771415504077600251040ustar00rootroot00000000000000const path = require('path'); module.exports = () => ({ transform(code) { return `console.log('${path .relative(process.cwd(), __filename) .replace('\\', '/')}');\n${code}`; } }); rollup-2.61.1/test/cli/samples/config-cjs-dirname/plugin.js000066400000000000000000000002771415504077600236220ustar00rootroot00000000000000const path = require('path'); module.exports = () => ({ transform(code) { return `console.log('${path .relative(process.cwd(), __filename) .replace('\\', '/')}');\n${code}`; } }); rollup-2.61.1/test/cli/samples/config-cjs-dirname/rollup.config.cjs000066400000000000000000000003001415504077600252330ustar00rootroot00000000000000const plugin = require('./plugin'); const nestedPlugin = require('./nested/plugin'); module.exports = { input: 'main.js', output: { format: 'esm' }, plugins: [plugin(), nestedPlugin()] }; rollup-2.61.1/test/cli/samples/config-cwd-case-insensitive/000077500000000000000000000000001415504077600236105ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-cwd-case-insensitive/_config.js000066400000000000000000000004471415504077600255570ustar00rootroot00000000000000function toggleCase(s) { return s == s.toLowerCase() ? s.toUpperCase() : s.toLowerCase(); } module.exports = { 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-2.61.1/test/cli/samples/config-cwd-case-insensitive/main.js000066400000000000000000000000341415504077600250670ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-2.61.1/test/cli/samples/config-cwd-case-insensitive/rollup.config.js000066400000000000000000000003021415504077600267220ustar00rootroot00000000000000var replace = require( '@rollup/plugin-replace' ); module.exports = { input: 'main.js', output: { format: 'cjs' }, plugins: [ replace( { preventAssignment: true, 'ANSWER': 42 } ) ] }; rollup-2.61.1/test/cli/samples/config-defineConfig-cjs/000077500000000000000000000000001415504077600227215ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-defineConfig-cjs/_config.js000066400000000000000000000002451415504077600246640ustar00rootroot00000000000000module.exports = { description: 'uses cjs config file which return config wrapped by defineConfig', command: 'rollup --config rollup.config.js', execute: true }; rollup-2.61.1/test/cli/samples/config-defineConfig-cjs/main.js000066400000000000000000000000251415504077600242000ustar00rootroot00000000000000module.exports = 42; rollup-2.61.1/test/cli/samples/config-defineConfig-cjs/rollup.config.js000066400000000000000000000002241415504077600260360ustar00rootroot00000000000000const { defineConfig } = require("../../../../dist/rollup"); module.exports = defineConfig({ input: 'main.js', output: { format: 'cjs' }, }); rollup-2.61.1/test/cli/samples/config-defineConfig-mjs/000077500000000000000000000000001415504077600227335ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-defineConfig-mjs/_config.js000066400000000000000000000002731415504077600246770ustar00rootroot00000000000000module.exports = { description: 'uses mjs config file which return config wrapped by defineConfig', command: 'rollup --config rollup.config.mjs', minNodeVersion: 13, execute: true }; rollup-2.61.1/test/cli/samples/config-defineConfig-mjs/main.js000066400000000000000000000000251415504077600242120ustar00rootroot00000000000000module.exports = 42; rollup-2.61.1/test/cli/samples/config-defineConfig-mjs/rollup.config.mjs000066400000000000000000000002221415504077600262230ustar00rootroot00000000000000import { defineConfig } from "../../../../dist/es/rollup.js" export default defineConfig({ input: 'main.js', output: { format: 'cjs' }, }); rollup-2.61.1/test/cli/samples/config-env-multiple/000077500000000000000000000000001415504077600222055ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-env-multiple/_config.js000066400000000000000000000003711415504077600241500ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/cli/samples/config-env-multiple/main.js000066400000000000000000000002311415504077600234630ustar00rootroot00000000000000assert.equal( '__ENVIRONMENT__', 'production' ); assert.equal( '__FOO__', 'foo' ); assert.equal('__SECOND__', 'true'); assert.equal('__KEY__', "value"); rollup-2.61.1/test/cli/samples/config-env-multiple/rollup.config.js000066400000000000000000000005411415504077600253240ustar00rootroot00000000000000var 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-2.61.1/test/cli/samples/config-env/000077500000000000000000000000001415504077600203545ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-env/_config.js000066400000000000000000000002731415504077600223200ustar00rootroot00000000000000module.exports = { description: 'passes environment variables to config file', command: 'rollup --config --environment PRODUCTION,FOO:bar,HOST:http://localhost:4000', execute: true }; rollup-2.61.1/test/cli/samples/config-env/main.js000066400000000000000000000002101415504077600216270ustar00rootroot00000000000000assert.equal( '__ENVIRONMENT__', 'production' ); assert.equal( '__FOO__', 'bar' ); assert.equal( '__HOST__', 'http://localhost:4000' ); rollup-2.61.1/test/cli/samples/config-env/rollup.config.js000066400000000000000000000005001415504077600234660ustar00rootroot00000000000000var 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-2.61.1/test/cli/samples/config-es6/000077500000000000000000000000001415504077600202615ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-es6/_config.js000066400000000000000000000002001415504077600222130ustar00rootroot00000000000000module.exports = { description: 'uses ES6 module config file', command: 'rollup --config rollup.config.js', execute: true }; rollup-2.61.1/test/cli/samples/config-es6/main.js000066400000000000000000000000341415504077600215400ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-2.61.1/test/cli/samples/config-es6/rollup.config.js000066400000000000000000000003511415504077600233770ustar00rootroot00000000000000import replace from '@rollup/plugin-replace'; export const ignoresNonDefaultExports = true export default { input: 'main.js', output: { format: 'cjs' }, plugins: [ replace( { preventAssignment: true, 'ANSWER': 42 } ) ] }; rollup-2.61.1/test/cli/samples/config-external-function/000077500000000000000000000000001415504077600232315ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-external-function/_config.js000066400000000000000000000001771415504077600252000ustar00rootroot00000000000000module.exports = { description: 'external option gets passed from config', command: 'rollup -c -e assert,external-module' }; rollup-2.61.1/test/cli/samples/config-external-function/_expected.js000066400000000000000000000003051415504077600255250ustar00rootroot00000000000000'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-2.61.1/test/cli/samples/config-external-function/main.js000066400000000000000000000002111415504077600245050ustar00rootroot00000000000000import { execute } from './_config.js'; import { ok } from 'assert'; import { method } from 'external-module'; ok( execute ); method(); rollup-2.61.1/test/cli/samples/config-external-function/rollup.config.js000066400000000000000000000005001415504077600263430ustar00rootroot00000000000000import assert from 'assert'; import { resolve } from 'path'; var config = resolve( './_config.js' ); export default { input: 'main.js', output: { format: 'cjs' }, external: function ( id ) { return id === config; }, plugins: [ { load: function ( id ) { assert.notEqual( id, config ); } } ] }; rollup-2.61.1/test/cli/samples/config-external/000077500000000000000000000000001415504077600214065ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-external/_config.js000066400000000000000000000001451415504077600233500ustar00rootroot00000000000000module.exports = { description: 'external option gets passed from config', command: 'rollup -c' }; rollup-2.61.1/test/cli/samples/config-external/_expected.js000066400000000000000000000001731415504077600237050ustar00rootroot00000000000000'use strict'; var _config_js = require('./_config.js'); var assert = require('assert'); assert.ok( _config_js.execute ); rollup-2.61.1/test/cli/samples/config-external/main.js000066400000000000000000000001251415504077600226660ustar00rootroot00000000000000import { execute } from './_config.js'; import { ok } from 'assert'; ok( execute ); rollup-2.61.1/test/cli/samples/config-external/rollup.config.js000066400000000000000000000004501415504077600245240ustar00rootroot00000000000000import 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: function ( id ) { assert.notEqual( id, config ); } } ] }; rollup-2.61.1/test/cli/samples/config-function-modify-command/000077500000000000000000000000001415504077600243125ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-function-modify-command/_config.js000066400000000000000000000003211415504077600262500ustar00rootroot00000000000000module.exports = { description: 'allows cleaning up and modifying the command args in the config file', command: 'rollup --config rollup.config.js --some-option="foo" --another-option=42', execute: true }; rollup-2.61.1/test/cli/samples/config-function-modify-command/main.js000066400000000000000000000002221415504077600255700ustar00rootroot00000000000000assert.deepEqual(COMMAND_OPTIONS, { _: [], config: 'rollup.config.js', c: 'rollup.config.js', 'some-option': 'foo', 'another-option': 42 }); rollup-2.61.1/test/cli/samples/config-function-modify-command/rollup.config.js000066400000000000000000000006731415504077600274370ustar00rootroot00000000000000import 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-2.61.1/test/cli/samples/config-function/000077500000000000000000000000001415504077600214115ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-function/_config.js000066400000000000000000000003041415504077600233500ustar00rootroot00000000000000module.exports = { description: 'if the config file returns a function then this will be called with the command args', command: 'rollup --config rollup.config.js --silent', execute: true }; rollup-2.61.1/test/cli/samples/config-function/main.js000066400000000000000000000001631415504077600226730ustar00rootroot00000000000000assert.deepEqual(COMMAND_OPTIONS, { _: [], config: 'rollup.config.js', c: 'rollup.config.js', silent: true }); rollup-2.61.1/test/cli/samples/config-function/rollup.config.js000066400000000000000000000006471415504077600245370ustar00rootroot00000000000000import 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-2.61.1/test/cli/samples/config-import-meta/000077500000000000000000000000001415504077600220225ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-import-meta/_config.js000066400000000000000000000001521415504077600237620ustar00rootroot00000000000000module.exports = { description: 'uses correct import.meta.url in config files', command: 'rollup -c' }; rollup-2.61.1/test/cli/samples/config-import-meta/_expected.js000066400000000000000000000000541415504077600243170ustar00rootroot00000000000000var test = 'test text'; console.log(test); rollup-2.61.1/test/cli/samples/config-import-meta/main.js000066400000000000000000000000551415504077600233040ustar00rootroot00000000000000import test from 'test'; console.log(test); rollup-2.61.1/test/cli/samples/config-import-meta/plugin/000077500000000000000000000000001415504077600233205ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-import-meta/plugin/plugin.js000066400000000000000000000012311415504077600251510ustar00rootroot00000000000000import { 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-2.61.1/test/cli/samples/config-import-meta/plugin/test.txt000066400000000000000000000000111415504077600250300ustar00rootroot00000000000000test textrollup-2.61.1/test/cli/samples/config-import-meta/rollup.config.js000066400000000000000000000002041415504077600251350ustar00rootroot00000000000000import plugin from './plugin/plugin.js'; export default { input: 'main.js', output: { format: 'es' }, plugins: [plugin()] }; rollup-2.61.1/test/cli/samples/config-json/000077500000000000000000000000001415504077600205355ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-json/_config.js000066400000000000000000000002061415504077600224750ustar00rootroot00000000000000module.exports = { description: 'allows config file to import json', command: 'rollup --config rollup.config.js', execute: true }; rollup-2.61.1/test/cli/samples/config-json/main.js000066400000000000000000000000501415504077600220120ustar00rootroot00000000000000assert.equal( '__VERSION__', '0.0.1' ); rollup-2.61.1/test/cli/samples/config-json/package.json000066400000000000000000000000271415504077600230220ustar00rootroot00000000000000{ "version": "0.0.1" }rollup-2.61.1/test/cli/samples/config-json/rollup.config.js000066400000000000000000000003551415504077600236570ustar00rootroot00000000000000import replace from '@rollup/plugin-replace'; import pkg from './package.json'; module.exports = { input: 'main.js', output: { format: 'cjs' }, plugins: [ replace( { preventAssignment: true, '__VERSION__': pkg.version } ) ] }; rollup-2.61.1/test/cli/samples/config-missing-export/000077500000000000000000000000001415504077600225545ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-missing-export/_config.js000066400000000000000000000003571415504077600245230ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'throws error if config does not export an object', command: 'rollup -c', error(err) { assert.ok(/Config file must export an options object/.test(err.message)); } }; rollup-2.61.1/test/cli/samples/config-missing-export/rollup.config.js000066400000000000000000000000001415504077600256610ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-mjs-plugins/000077500000000000000000000000001415504077600220345ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-mjs-plugins/_config.js000066400000000000000000000002311415504077600237720ustar00rootroot00000000000000module.exports = { description: 'supports native esm as well as CJS plugins when using .mjs in Node 13+', minNodeVersion: 13, command: 'rollup -c' }; rollup-2.61.1/test/cli/samples/config-mjs-plugins/_expected.js000066400000000000000000000002071415504077600243310ustar00rootroot00000000000000#!/usr/bin/env node 'use strict'; console.log('nested/plugin.mjs'); console.log('plugin.mjs'); var main = 42; module.exports = main; rollup-2.61.1/test/cli/samples/config-mjs-plugins/main.js000066400000000000000000000000271415504077600233150ustar00rootroot00000000000000export default ANSWER; rollup-2.61.1/test/cli/samples/config-mjs-plugins/nested/000077500000000000000000000000001415504077600233165ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-mjs-plugins/nested/plugin.mjs000066400000000000000000000003661415504077600253340ustar00rootroot00000000000000import { 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-2.61.1/test/cli/samples/config-mjs-plugins/plugin.mjs000066400000000000000000000003661415504077600240520ustar00rootroot00000000000000import { 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-2.61.1/test/cli/samples/config-mjs-plugins/rollup.config.mjs000066400000000000000000000006761415504077600253410ustar00rootroot00000000000000// This is a CJS plugin import replace from '@rollup/plugin-replace/dist/rollup-plugin-replace.cjs.js'; // This is an ESM plugin 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-2.61.1/test/cli/samples/config-mjs/000077500000000000000000000000001415504077600203555ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-mjs/_config.js000066400000000000000000000001751415504077600223220ustar00rootroot00000000000000module.exports = { description: 'uses config file (.mjs)', command: 'rollup --config rollup.config.mjs', execute: true }; rollup-2.61.1/test/cli/samples/config-mjs/main.js000066400000000000000000000000341415504077600216340ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-2.61.1/test/cli/samples/config-mjs/rollup.config.mjs000066400000000000000000000002711415504077600236510ustar00rootroot00000000000000import replace from '@rollup/plugin-replace'; export default { input: 'main.js', output: { format: 'cjs' }, plugins: [ replace( { preventAssignment: true, ANSWER: 42 } ) ] }; rollup-2.61.1/test/cli/samples/config-multiple-getfilename/000077500000000000000000000000001415504077600236755ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-multiple-getfilename/_config.js000066400000000000000000000001651415504077600256410ustar00rootroot00000000000000module.exports = { description: 'returns correct file names for multiple outputs (#3467)', command: 'rollup -c' }; rollup-2.61.1/test/cli/samples/config-multiple-getfilename/_expected/000077500000000000000000000000001415504077600256355ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-multiple-getfilename/_expected/cjs-main.js000066400000000000000000000000661415504077600276760ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-2.61.1/test/cli/samples/config-multiple-getfilename/_expected/cjs.txt000066400000000000000000000000131415504077600271470ustar00rootroot00000000000000cjs-main.jsrollup-2.61.1/test/cli/samples/config-multiple-getfilename/_expected/es-main.js000066400000000000000000000000541415504077600275230ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-2.61.1/test/cli/samples/config-multiple-getfilename/_expected/es.txt000066400000000000000000000000121415504077600267760ustar00rootroot00000000000000es-main.jsrollup-2.61.1/test/cli/samples/config-multiple-getfilename/main.js000066400000000000000000000000231415504077600251520ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/cli/samples/config-multiple-getfilename/rollup.config.js000066400000000000000000000010331415504077600270110ustar00rootroot00000000000000let 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-2.61.1/test/cli/samples/config-multiple-source-maps/000077500000000000000000000000001415504077600236535ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-multiple-source-maps/_config.js000066400000000000000000000001611415504077600256130ustar00rootroot00000000000000module.exports = { description: 'correctly generates sourcemaps for multiple outputs', command: 'rollup -c' }; rollup-2.61.1/test/cli/samples/config-multiple-source-maps/_expected/000077500000000000000000000000001415504077600256135ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-multiple-source-maps/_expected/main-cjs.js000066400000000000000000000001201415504077600276430ustar00rootroot00000000000000'use strict'; assert.equal( ANSWER, 42 ); //# sourceMappingURL=main-cjs.js.map rollup-2.61.1/test/cli/samples/config-multiple-source-maps/_expected/main-cjs.js.map000066400000000000000000000002671415504077600304330ustar00rootroot00000000000000{"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-2.61.1/test/cli/samples/config-multiple-source-maps/_expected/main-es.js000066400000000000000000000001001415504077600274710ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); //# sourceMappingURL=main-es.js.map rollup-2.61.1/test/cli/samples/config-multiple-source-maps/_expected/main-es.js.map000066400000000000000000000002621415504077600302560ustar00rootroot00000000000000{"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-2.61.1/test/cli/samples/config-multiple-source-maps/main.js000066400000000000000000000000341415504077600251320ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-2.61.1/test/cli/samples/config-multiple-source-maps/rollup.config.js000066400000000000000000000004101415504077600267650ustar00rootroot00000000000000export 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-2.61.1/test/cli/samples/config-no-module/000077500000000000000000000000001415504077600214635ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-no-module/_config.js000066400000000000000000000015601415504077600234270ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { description: 'provides a helpful error message if a transpiled config is interpreted as "module"', minNodeVersion: 13, command: 'cd sub && rollup -c', error: () => true, stderr: stderr => assertIncludes( stderr, '[!] Error: While loading the Rollup configuration from "rollup.config.js", Node tried to require an ES module from a CommonJS ' + 'file, which is not supported. A common cause is if there is a package.json file with "type": "module" in the same folder. You can ' + 'try to fix this by changing the extension of your configuration file to ".cjs" or ".mjs" depending on the content, which will ' + 'prevent Rollup from trying to preprocess the file but rather hand it to Node directly.\n' + 'https://rollupjs.org/guide/en/#using-untranspiled-config-files' ) }; rollup-2.61.1/test/cli/samples/config-no-module/sub/000077500000000000000000000000001415504077600222545ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-no-module/sub/main.js000066400000000000000000000000231415504077600235310ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/cli/samples/config-no-module/sub/package.json000066400000000000000000000000261415504077600245400ustar00rootroot00000000000000{ "type": "module" } rollup-2.61.1/test/cli/samples/config-no-module/sub/rollup.config.js000066400000000000000000000002151415504077600253710ustar00rootroot00000000000000import { shebang } from 'rollup-plugin-thatworks'; export default { input: 'main.js', output: { format: 'cjs' }, plugins: [shebang()] }; rollup-2.61.1/test/cli/samples/config-no-output/000077500000000000000000000000001415504077600215365ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-no-output/_config.js000066400000000000000000000004571415504077600235060ustar00rootroot00000000000000const assert = require('assert'); const fs = require('fs'); module.exports = { description: 'uses -o from CLI', command: 'rollup -c -o output.js', test() { const output = fs.readFileSync('output.js', 'utf-8'); assert.equal(output.trim(), 'console.log(42);'); fs.unlinkSync('output.js'); } }; rollup-2.61.1/test/cli/samples/config-no-output/main.js000066400000000000000000000000201415504077600230100ustar00rootroot00000000000000console.log(42);rollup-2.61.1/test/cli/samples/config-no-output/rollup.config.js000066400000000000000000000001031415504077600246470ustar00rootroot00000000000000export default { input: 'main.js', output: { format: 'es' } };rollup-2.61.1/test/cli/samples/config-override/000077500000000000000000000000001415504077600214035ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-override/_config.js000066400000000000000000000002211415504077600233400ustar00rootroot00000000000000module.exports = { description: 'overrides config file with command line arguments', command: 'rollup -c -i main.js -f cjs', execute: true }; rollup-2.61.1/test/cli/samples/config-override/main.js000066400000000000000000000000341415504077600226620ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-2.61.1/test/cli/samples/config-override/rollup.config.js000066400000000000000000000002731415504077600245240ustar00rootroot00000000000000import replace from '@rollup/plugin-replace'; export default { input: 'nope.js', output: { format: 'amd' }, plugins: [ replace( { preventAssignment: true, 'ANSWER': 42 } ) ] }; rollup-2.61.1/test/cli/samples/config-plugin-entry/000077500000000000000000000000001415504077600222215ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-plugin-entry/_config.js000066400000000000000000000001411415504077600241570ustar00rootroot00000000000000module.exports = { description: 'allows plugins to set options.entry', command: 'rollup -c' }; rollup-2.61.1/test/cli/samples/config-plugin-entry/_expected.js000066400000000000000000000000201415504077600245070ustar00rootroot00000000000000console.log(42);rollup-2.61.1/test/cli/samples/config-plugin-entry/main.js000066400000000000000000000000201415504077600234730ustar00rootroot00000000000000console.log(42);rollup-2.61.1/test/cli/samples/config-plugin-entry/rollup.config.js000066400000000000000000000002001415504077600253300ustar00rootroot00000000000000export default { output: { format: 'es' }, plugins: [ { options: opts => { opts.input = 'main.js'; } } ] }; rollup-2.61.1/test/cli/samples/config-promise-cjs/000077500000000000000000000000001415504077600220175ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-promise-cjs/_config.js000066400000000000000000000002221415504077600237550ustar00rootroot00000000000000module.exports = { description: 'uses cjs config file which returns a Promise', command: 'rollup --config rollup.config.cjs', execute: true }; rollup-2.61.1/test/cli/samples/config-promise-cjs/main.js000066400000000000000000000000341415504077600232760ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-2.61.1/test/cli/samples/config-promise-cjs/rollup.config.cjs000066400000000000000000000003121415504077600252750ustar00rootroot00000000000000const replace = require('@rollup/plugin-replace'); module.exports = Promise.resolve({ input: 'main.js', output: { format: 'cjs' }, plugins: [replace({ preventAssignment: true, ANSWER: 42 })] }); rollup-2.61.1/test/cli/samples/config-promise-mjs/000077500000000000000000000000001415504077600220315ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-promise-mjs/_config.js000066400000000000000000000002471415504077600237760ustar00rootroot00000000000000module.exports = { description: 'uses mjs config file which returns a Promise', minNodeVersion: 13, command: 'rollup --config rollup.config.mjs', execute: true }; rollup-2.61.1/test/cli/samples/config-promise-mjs/main.js000066400000000000000000000000341415504077600233100ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-2.61.1/test/cli/samples/config-promise-mjs/rollup.config.mjs000066400000000000000000000003031415504077600253210ustar00rootroot00000000000000import replace from '@rollup/plugin-replace'; export default Promise.resolve({ input: 'main.js', output: { format: 'cjs' }, plugins: [replace({ preventAssignment: true, ANSWER: 42 })] }); rollup-2.61.1/test/cli/samples/config-promise/000077500000000000000000000000001415504077600212425ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-promise/_config.js000066400000000000000000000002151415504077600232020ustar00rootroot00000000000000module.exports = { description: 'uses config file which returns a Promise', command: 'rollup --config rollup.config.js', execute: true }; rollup-2.61.1/test/cli/samples/config-promise/main.js000066400000000000000000000000341415504077600225210ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-2.61.1/test/cli/samples/config-promise/rollup.config.js000066400000000000000000000003371415504077600243640ustar00rootroot00000000000000import 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-2.61.1/test/cli/samples/config-true/000077500000000000000000000000001415504077600205435ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-true/_config.js000066400000000000000000000001521415504077600225030ustar00rootroot00000000000000module.exports = { description: 'defaults to rollup.config.js', command: 'rollup -c', execute: true }; rollup-2.61.1/test/cli/samples/config-true/main.js000066400000000000000000000000341415504077600220220ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-2.61.1/test/cli/samples/config-true/rollup.config.js000066400000000000000000000002731415504077600236640ustar00rootroot00000000000000import replace from '@rollup/plugin-replace'; export default { input: 'main.js', output: { format: 'cjs' }, plugins: [ replace( { preventAssignment: true, 'ANSWER': 42 } ) ] }; rollup-2.61.1/test/cli/samples/config-ts/000077500000000000000000000000001415504077600202125ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-ts/_config.js000066400000000000000000000002711415504077600221540ustar00rootroot00000000000000module.exports = { description: 'supports loading TypeScript config files via plugin option', command: 'rollup --config rollup.config.ts --configPlugin typescript', execute: true }; rollup-2.61.1/test/cli/samples/config-ts/main.js000066400000000000000000000000231415504077600214670ustar00rootroot00000000000000assert.ok( true ); rollup-2.61.1/test/cli/samples/config-ts/rollup.config.ts000066400000000000000000000002571415504077600233470ustar00rootroot00000000000000import { RollupOptions } from '../../../../dist/rollup'; const options: RollupOptions = { input: 'main.js', output: { format: 'cjs' } }; export { options as default }; rollup-2.61.1/test/cli/samples/config-warnings/000077500000000000000000000000001415504077600214145ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-warnings/_config.js000066400000000000000000000004521415504077600233570ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { description: 'displays warnings when a config is loaded', command: 'rollup -c', stderr: stderr => assertIncludes( stderr, 'loaded rollup.config.js with warnings\n(!) Use of eval is strongly discouraged' ) }; rollup-2.61.1/test/cli/samples/config-warnings/_expected.js000066400000000000000000000000001415504077600237000ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config-warnings/main.js000066400000000000000000000000231415504077600226710ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/cli/samples/config-warnings/rollup.config.js000066400000000000000000000001151415504077600245300ustar00rootroot00000000000000export default { input: eval('"main.js"'), output: { format: 'cjs' } }; rollup-2.61.1/test/cli/samples/config/000077500000000000000000000000001415504077600175665ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/config/_config.js000066400000000000000000000001651415504077600215320ustar00rootroot00000000000000module.exports = { description: 'uses config file', command: 'rollup --config rollup.config.js', execute: true }; rollup-2.61.1/test/cli/samples/config/main.js000066400000000000000000000000341415504077600210450ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-2.61.1/test/cli/samples/config/rollup.config.js000066400000000000000000000003021415504077600227000ustar00rootroot00000000000000var replace = require( '@rollup/plugin-replace' ); module.exports = { input: 'main.js', output: { format: 'cjs' }, plugins: [ replace( { preventAssignment: true, 'ANSWER': 42 } ) ] }; rollup-2.61.1/test/cli/samples/context/000077500000000000000000000000001415504077600200055ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/context/_config.js000066400000000000000000000002101415504077600217400ustar00rootroot00000000000000module.exports = { description: 'Uses --context to set `this` value', command: 'rollup main.js --format commonjs --context window' }; rollup-2.61.1/test/cli/samples/context/_expected.js000066400000000000000000000002101415504077600222740ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); console.log(window); const foo = 42; exports.foo = foo; rollup-2.61.1/test/cli/samples/context/main.js000066400000000000000000000000521415504077600212640ustar00rootroot00000000000000console.log(this); export const foo = 42; rollup-2.61.1/test/cli/samples/custom-frame-with-pos/000077500000000000000000000000001415504077600224735ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/custom-frame-with-pos/_config.js000066400000000000000000000006141415504077600244360ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { 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' + 'Error: My error.' ) }; rollup-2.61.1/test/cli/samples/custom-frame-with-pos/main.js000066400000000000000000000000461415504077600237550ustar00rootroot00000000000000console.log("everyday I'm throwing"); rollup-2.61.1/test/cli/samples/custom-frame-with-pos/rollup.config.js000066400000000000000000000003771415504077600256210ustar00rootroot00000000000000module.exports = { input: 'main.js', output: { format: 'cjs' }, plugins: [ { transform() { const err = new Error('My error.'); err.frame = 'custom code frame'; this.error(err, { line: 1, column: 5, }); } }, ] }; rollup-2.61.1/test/cli/samples/custom-frame/000077500000000000000000000000001415504077600207235ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/custom-frame/_config.js000066400000000000000000000007001415504077600226620ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { 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\nError: My error.\n' + ' at Object.transform' ); assertIncludes(stderr, 'rollup.config.js:11:17'); } }; rollup-2.61.1/test/cli/samples/custom-frame/main.js000066400000000000000000000000461415504077600222050ustar00rootroot00000000000000console.log("everyday I'm throwing"); rollup-2.61.1/test/cli/samples/custom-frame/rollup.config.js000066400000000000000000000003301415504077600240360ustar00rootroot00000000000000module.exports = { input: 'main.js', output: { format: 'cjs' }, plugins: [ { transform() { const err = new Error('My error.'); err.frame = 'custom code frame'; this.error(err); } }, ] }; rollup-2.61.1/test/cli/samples/deconflict-entry-point-in-subdir/000077500000000000000000000000001415504077600246135ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/deconflict-entry-point-in-subdir/_config.js000066400000000000000000000002741415504077600265600ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/cli/samples/deconflict-entry-point-in-subdir/_expected/000077500000000000000000000000001415504077600265535ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/deconflict-entry-point-in-subdir/_expected/main.js000066400000000000000000000000251415504077600300320ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/cli/samples/deconflict-entry-point-in-subdir/_expected/main2.js000066400000000000000000000000241415504077600301130ustar00rootroot00000000000000console.log('sub'); rollup-2.61.1/test/cli/samples/deconflict-entry-point-in-subdir/main.js000066400000000000000000000000251415504077600260720ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/cli/samples/deconflict-entry-point-in-subdir/sub/000077500000000000000000000000001415504077600254045ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/deconflict-entry-point-in-subdir/sub/main.js000066400000000000000000000000241415504077600266620ustar00rootroot00000000000000console.log('sub'); rollup-2.61.1/test/cli/samples/duplicate-import-options/000077500000000000000000000000001415504077600232745ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/duplicate-import-options/_config.js000066400000000000000000000005101415504077600252320ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { 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-2.61.1/test/cli/samples/duplicate-import-options/main.js000066400000000000000000000000321415504077600245510ustar00rootroot00000000000000assert.equal( 1 + 1, 2 ); rollup-2.61.1/test/cli/samples/emit-file-multiple-dirs/000077500000000000000000000000001415504077600227645ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/emit-file-multiple-dirs/_config.js000066400000000000000000000001661415504077600247310ustar00rootroot00000000000000module.exports = { description: 'writes files emitted by plugins in different output dirs', command: 'rollup -c' }; rollup-2.61.1/test/cli/samples/emit-file-multiple-dirs/_expected/000077500000000000000000000000001415504077600247245ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/emit-file-multiple-dirs/_expected/dist1/000077500000000000000000000000001415504077600257505ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/emit-file-multiple-dirs/_expected/dist1/main.js000066400000000000000000000000531415504077600272300ustar00rootroot00000000000000'use strict'; assert.equal( ANSWER, 42 ); rollup-2.61.1/test/cli/samples/emit-file-multiple-dirs/_expected/dist1/myfile000066400000000000000000000000031415504077600271510ustar00rootroot00000000000000abcrollup-2.61.1/test/cli/samples/emit-file-multiple-dirs/_expected/dist2/000077500000000000000000000000001415504077600257515ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/emit-file-multiple-dirs/_expected/dist2/main.js000066400000000000000000000000341415504077600272300ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-2.61.1/test/cli/samples/emit-file-multiple-dirs/_expected/dist2/myfile000066400000000000000000000000031415504077600271520ustar00rootroot00000000000000abcrollup-2.61.1/test/cli/samples/emit-file-multiple-dirs/main.js000066400000000000000000000000341415504077600242430ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-2.61.1/test/cli/samples/emit-file-multiple-dirs/rollup.config.js000066400000000000000000000004501415504077600261020ustar00rootroot00000000000000export 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-2.61.1/test/cli/samples/empty-chunk-multiple/000077500000000000000000000000001415504077600224165ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/empty-chunk-multiple/_config.js000066400000000000000000000004031415504077600243550ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { description: 'shows warning when multiple chunks empty', command: 'rollup -c', error: () => true, stderr: stderr => assertIncludes(stderr, '(!) Generated empty chunks\na, b') }; rollup-2.61.1/test/cli/samples/empty-chunk-multiple/a.js000066400000000000000000000000001415504077600231620ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/empty-chunk-multiple/b.js000066400000000000000000000000001415504077600231630ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/empty-chunk-multiple/main.js000066400000000000000000000000441415504077600236760ustar00rootroot00000000000000import('./a.js'); import('./b.js'); rollup-2.61.1/test/cli/samples/empty-chunk-multiple/rollup.config.js000066400000000000000000000001071415504077600255330ustar00rootroot00000000000000module.exports = { input: 'main.js', output: { format: 'cjs' } }; rollup-2.61.1/test/cli/samples/empty-chunk/000077500000000000000000000000001415504077600205655ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/empty-chunk/_config.js000066400000000000000000000003731415504077600225320ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { description: 'shows warning when chunk empty', command: 'rollup -c', error: () => true, stderr: stderr => assertIncludes(stderr, '(!) Generated an empty chunk\nmain') }; rollup-2.61.1/test/cli/samples/empty-chunk/main.js000066400000000000000000000000001415504077600220350ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/empty-chunk/rollup.config.js000066400000000000000000000001071415504077600237020ustar00rootroot00000000000000module.exports = { input: 'main.js', output: { format: 'cjs' } }; rollup-2.61.1/test/cli/samples/external-modules-auto-global/000077500000000000000000000000001415504077600240155ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/external-modules-auto-global/_config.js000066400000000000000000000004721415504077600257620ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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.strictEqual(stderr.indexOf('(!)'), -1); } }; rollup-2.61.1/test/cli/samples/external-modules-auto-global/main.js000066400000000000000000000002101415504077600252700ustar00rootroot00000000000000import { max } from 'mathematics'; import { resolve } from 'promises'; assert.equal( max( 1, 2, 3 ), 3 ); assert.ok( resolve().then ); rollup-2.61.1/test/cli/samples/external-modules/000077500000000000000000000000001415504077600216115ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/external-modules/_config.js000066400000000000000000000004421415504077600235530ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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.strictEqual(stderr.indexOf('(!)'), -1); } }; rollup-2.61.1/test/cli/samples/external-modules/main.js000066400000000000000000000003121415504077600230670ustar00rootroot00000000000000import { 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-2.61.1/test/cli/samples/fail-after-warnings/000077500000000000000000000000001415504077600221615ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/fail-after-warnings/_config.js000066400000000000000000000005231415504077600241230ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { 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-2.61.1/test/cli/samples/fail-after-warnings/_expected.js000066400000000000000000000000441415504077600244550ustar00rootroot00000000000000import 'unknown'; console.log(42); rollup-2.61.1/test/cli/samples/fail-after-warnings/main.js000066400000000000000000000000631415504077600234420ustar00rootroot00000000000000import something from 'unknown'; console.log(42); rollup-2.61.1/test/cli/samples/format-aliases/000077500000000000000000000000001415504077600212305ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/format-aliases/_config.js000066400000000000000000000001331415504077600231670ustar00rootroot00000000000000module.exports = { description: 'supports format aliases', command: 'rollup --config' }; rollup-2.61.1/test/cli/samples/format-aliases/_expected/000077500000000000000000000000001415504077600231705ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/format-aliases/_expected/amd.js000066400000000000000000000007521415504077600242730ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, external) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external__default = /*#__PURE__*/_interopDefaultLegacy(external); console.log('main'); Object.defineProperty(exports, 'value', { enumerable: true, get: function () { return external__default["default"]; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/cli/samples/format-aliases/_expected/cjs.js000066400000000000000000000007011415504077600243030ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var external = require('external'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external__default = /*#__PURE__*/_interopDefaultLegacy(external); console.log('main'); Object.defineProperty(exports, 'value', { enumerable: true, get: function () { return external__default["default"]; } }); rollup-2.61.1/test/cli/samples/format-aliases/_expected/commonjs.js000066400000000000000000000007011415504077600253510ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var external = require('external'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external__default = /*#__PURE__*/_interopDefaultLegacy(external); console.log('main'); Object.defineProperty(exports, 'value', { enumerable: true, get: function () { return external__default["default"]; } }); rollup-2.61.1/test/cli/samples/format-aliases/_expected/es.js000066400000000000000000000001031415504077600241270ustar00rootroot00000000000000export { default as value } from 'external'; console.log('main'); rollup-2.61.1/test/cli/samples/format-aliases/_expected/esm.js000066400000000000000000000001031415504077600243040ustar00rootroot00000000000000export { default as value } from 'external'; console.log('main'); rollup-2.61.1/test/cli/samples/format-aliases/_expected/iife.js000066400000000000000000000007671415504077600244540ustar00rootroot00000000000000var bundle = (function (exports, external) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external__default = /*#__PURE__*/_interopDefaultLegacy(external); console.log('main'); Object.defineProperty(exports, 'value', { enumerable: true, get: function () { return external__default["default"]; } }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, external); rollup-2.61.1/test/cli/samples/format-aliases/_expected/module.js000066400000000000000000000001031415504077600250050ustar00rootroot00000000000000export { default as value } from 'external'; console.log('main'); rollup-2.61.1/test/cli/samples/format-aliases/_expected/system.js000066400000000000000000000003471415504077600250560ustar00rootroot00000000000000System.register('bundle', ['external'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('value', module["default"]); }], execute: (function () { console.log('main'); }) }; })); rollup-2.61.1/test/cli/samples/format-aliases/_expected/systemjs.js000066400000000000000000000003471415504077600254130ustar00rootroot00000000000000System.register('bundle', ['external'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('value', module["default"]); }], execute: (function () { console.log('main'); }) }; })); rollup-2.61.1/test/cli/samples/format-aliases/_expected/umd.js000066400000000000000000000014551415504077600243200ustar00rootroot00000000000000(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 _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external__default = /*#__PURE__*/_interopDefaultLegacy(external); console.log('main'); Object.defineProperty(exports, 'value', { enumerable: true, get: function () { return external__default["default"]; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/cli/samples/format-aliases/_expected/undefined.js000066400000000000000000000001031415504077600254610ustar00rootroot00000000000000export { default as value } from 'external'; console.log('main'); rollup-2.61.1/test/cli/samples/format-aliases/main.js000066400000000000000000000001051415504077600225060ustar00rootroot00000000000000import value from 'external'; console.log('main'); export { value }; rollup-2.61.1/test/cli/samples/format-aliases/rollup.config.js000066400000000000000000000004751415504077600243550ustar00rootroot00000000000000export 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-2.61.1/test/cli/samples/generated-code-preset-override/000077500000000000000000000000001415504077600243045ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/generated-code-preset-override/_config.js000066400000000000000000000002541415504077600262470ustar00rootroot00000000000000module.exports = { description: 'overrides the generatedCode option when using presets', command: 'rollup --config --generatedCode es5 --generatedCode.arrowFunctions' }; rollup-2.61.1/test/cli/samples/generated-code-preset-override/_expected.js000066400000000000000000000003651415504077600266060ustar00rootroot00000000000000System.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-2.61.1/test/cli/samples/generated-code-preset-override/main.js000066400000000000000000000001331415504077600255630ustar00rootroot00000000000000export { baz } from 'external'; const foo = 1; export { foo, foo as bar, foo as default }; rollup-2.61.1/test/cli/samples/generated-code-preset-override/rollup.config.js000066400000000000000000000002601415504077600274210ustar00rootroot00000000000000export default { input: 'main.js', output: { format: 'system', generatedCode: { arrowFunctions: true, objectShorthand: true, reservedNamesAsProps: false } } }rollup-2.61.1/test/cli/samples/generated-code-unknown-preset/000077500000000000000000000000001415504077600241645ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/generated-code-unknown-preset/_config.js000066400000000000000000000010201415504077600261170ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { description: 'overrides the generatedCode option when using presets', command: 'rollup main.js --format es --generatedCode unknown', error: () => true, stderr: stderr => { assertIncludes( stderr, '[!] Error: 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/guide/en/#outputgeneratedcode' ); } }; rollup-2.61.1/test/cli/samples/generated-code-unknown-preset/main.js000066400000000000000000000000251415504077600254430ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/cli/samples/indent-none/000077500000000000000000000000001415504077600205375ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/indent-none/_config.js000066400000000000000000000002011415504077600224720ustar00rootroot00000000000000module.exports = { description: 'disables indentation with --no-indent', command: 'rollup main.js --format umd --no-indent' }; rollup-2.61.1/test/cli/samples/indent-none/_expected.js000066400000000000000000000002411415504077600230320ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; assert.equal( 1 + 1, 2 ); })); rollup-2.61.1/test/cli/samples/indent-none/main.js000066400000000000000000000000321415504077600220140ustar00rootroot00000000000000assert.equal( 1 + 1, 2 ); rollup-2.61.1/test/cli/samples/interop/000077500000000000000000000000001415504077600200015ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/interop/_config.js000066400000000000000000000002141415504077600217400ustar00rootroot00000000000000module.exports = { description: 'does not include the interop block', command: 'rollup -i main.js -f cjs --external test --no-interop' }; rollup-2.61.1/test/cli/samples/interop/_expected.js000066400000000000000000000000771415504077600223030ustar00rootroot00000000000000'use strict'; var data = require('test'); assert.ok( data ); rollup-2.61.1/test/cli/samples/interop/main.js000066400000000000000000000000551415504077600212630ustar00rootroot00000000000000import data from 'test'; assert.ok( data ); rollup-2.61.1/test/cli/samples/merge-deprecations/000077500000000000000000000000001415504077600220765ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/merge-deprecations/_config.js000066400000000000000000000001731415504077600240410ustar00rootroot00000000000000module.exports = { description: 'merges deprecated with current options', command: 'rollup --config rollup.config.js' }; rollup-2.61.1/test/cli/samples/merge-deprecations/_expected/000077500000000000000000000000001415504077600240365ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/merge-deprecations/_expected/bundle2.js000066400000000000000000000000301415504077600257200ustar00rootroot00000000000000assert.equal( 42, 42 ); rollup-2.61.1/test/cli/samples/merge-deprecations/main.js000066400000000000000000000000341415504077600233550ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-2.61.1/test/cli/samples/merge-deprecations/rollup.config.js000066400000000000000000000004361415504077600252200ustar00rootroot00000000000000var 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-2.61.1/test/cli/samples/merge-treeshake-false/000077500000000000000000000000001415504077600224615ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/merge-treeshake-false/_config.js000066400000000000000000000003761415504077600244310ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/cli/samples/merge-treeshake-false/_expected.js000066400000000000000000000001671415504077600247630ustar00rootroot00000000000000import 'external'; console.log('included internal side-effect'); const unusedGlobal = someGlobal; console.log( 42 );rollup-2.61.1/test/cli/samples/merge-treeshake-false/lib.js000066400000000000000000000000561415504077600235660ustar00rootroot00000000000000console.log('included internal side-effect'); rollup-2.61.1/test/cli/samples/merge-treeshake-false/main.js000066400000000000000000000001311415504077600237360ustar00rootroot00000000000000import 'external'; import './lib'; const unusedGlobal = someGlobal; console.log( 42 ); rollup-2.61.1/test/cli/samples/merge-treeshake/000077500000000000000000000000001415504077600213715ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/merge-treeshake/_config.js000066400000000000000000000003331415504077600233320ustar00rootroot00000000000000module.exports = { description: 'merges treeshake options', command: 'rollup main.js --format es --external external --treeshake.moduleSideEffects no-external --treeshake --no-treeshake.unknownGlobalSideEffects' }; rollup-2.61.1/test/cli/samples/merge-treeshake/_expected.js000066400000000000000000000001011415504077600236570ustar00rootroot00000000000000console.log('included internal side-effect'); console.log( 42 );rollup-2.61.1/test/cli/samples/merge-treeshake/lib.js000066400000000000000000000000561415504077600224760ustar00rootroot00000000000000console.log('included internal side-effect'); rollup-2.61.1/test/cli/samples/merge-treeshake/main.js000066400000000000000000000001311415504077600226460ustar00rootroot00000000000000import 'external'; import './lib'; const unusedGlobal = someGlobal; console.log( 42 ); rollup-2.61.1/test/cli/samples/module-name/000077500000000000000000000000001415504077600205245ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/module-name/_config.js000066400000000000000000000002171415504077600224660ustar00rootroot00000000000000module.exports = { description: 'generates UMD export with correct name', command: 'rollup main.js --format umd --name myBundle --indent' }; rollup-2.61.1/test/cli/samples/module-name/_expected.js000066400000000000000000000005611415504077600230240ustar00rootroot00000000000000(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-2.61.1/test/cli/samples/module-name/main.js000066400000000000000000000000231415504077600220010ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/cli/samples/multiple-configs/000077500000000000000000000000001415504077600216025ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/multiple-configs/_config.js000066400000000000000000000004221415504077600235420ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'generates output file when multiple configurations are specified and one build fails', command: 'rollup -c', error: err => { assert.ok(/Unexpected Exception/.test(err.message)); return true; } }; rollup-2.61.1/test/cli/samples/multiple-configs/_expected/000077500000000000000000000000001415504077600235425ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/multiple-configs/_expected/bundle1.js000066400000000000000000000000651415504077600254330ustar00rootroot00000000000000'use strict'; var main = 0; module.exports = main; rollup-2.61.1/test/cli/samples/multiple-configs/main.js000066400000000000000000000000221415504077600230560ustar00rootroot00000000000000export default 0; rollup-2.61.1/test/cli/samples/multiple-configs/rollup.config.js000066400000000000000000000004631415504077600247240ustar00rootroot00000000000000export 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-2.61.1/test/cli/samples/multiple-targets-different-plugins/000077500000000000000000000000001415504077600252465ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/multiple-targets-different-plugins/_config.js000066400000000000000000000001741415504077600272120ustar00rootroot00000000000000module.exports = { description: 'generates multiple output files, only one of which is minified', command: 'rollup -c' }; rollup-2.61.1/test/cli/samples/multiple-targets-different-plugins/_expected/000077500000000000000000000000001415504077600272065ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/multiple-targets-different-plugins/_expected/main.js000066400000000000000000000001321415504077600304640ustar00rootroot00000000000000'use strict'; const Hello = 1; console.log(Hello); var main = 0; module.exports = main; rollup-2.61.1/test/cli/samples/multiple-targets-different-plugins/_expected/minified.js000066400000000000000000000000561415504077600313310ustar00rootroot00000000000000"use strict";console.log(1);module.exports=0; rollup-2.61.1/test/cli/samples/multiple-targets-different-plugins/main.js000066400000000000000000000000671415504077600265330ustar00rootroot00000000000000const Hello = 1; console.log(Hello); export default 0; rollup-2.61.1/test/cli/samples/multiple-targets-different-plugins/rollup.config.js000066400000000000000000000004241415504077600303650ustar00rootroot00000000000000import { 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-2.61.1/test/cli/samples/multiple-targets-shared-config/000077500000000000000000000000001415504077600243325ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/multiple-targets-shared-config/_config.js000066400000000000000000000001401415504077600262670ustar00rootroot00000000000000module.exports = { description: 'uses shared config for each target', command: 'rollup -c' }; rollup-2.61.1/test/cli/samples/multiple-targets-shared-config/_expected/000077500000000000000000000000001415504077600262725ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/multiple-targets-shared-config/_expected/cjs.js000066400000000000000000000001251415504077600274050ustar00rootroot00000000000000'use strict'; var main = 0; module.exports = main; //# sourceMappingURL=cjs.js.map rollup-2.61.1/test/cli/samples/multiple-targets-shared-config/_expected/cjs.js.map000066400000000000000000000002141415504077600301600ustar00rootroot00000000000000{"version":3,"file":"cjs.js","sources":["../main.js"],"sourcesContent":["export default 0;\n"],"names":[],"mappings":";;AAAA,WAAe,CAAC;;;;"}rollup-2.61.1/test/cli/samples/multiple-targets-shared-config/_expected/es.js000066400000000000000000000001121415504077600272310ustar00rootroot00000000000000var main = 0; export { main as default }; //# sourceMappingURL=es.js.map rollup-2.61.1/test/cli/samples/multiple-targets-shared-config/_expected/es.js.map000066400000000000000000000002111415504077600300050ustar00rootroot00000000000000{"version":3,"file":"es.js","sources":["../main.js"],"sourcesContent":["export default 0;\n"],"names":[],"mappings":"AAAA,WAAe,CAAC;;;;"}rollup-2.61.1/test/cli/samples/multiple-targets-shared-config/main.js000066400000000000000000000000221415504077600256060ustar00rootroot00000000000000export default 0; rollup-2.61.1/test/cli/samples/multiple-targets-shared-config/rollup.config.js000066400000000000000000000003301415504077600274450ustar00rootroot00000000000000export default { input: 'main.js', output: [ { format: 'cjs', file: '_actual/cjs.js', exports: 'auto', sourcemap: true }, { format: 'es', file: '_actual/es.js', sourcemap: true } ] }; rollup-2.61.1/test/cli/samples/multiple-targets/000077500000000000000000000000001415504077600216235ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/multiple-targets/_config.js000066400000000000000000000002011415504077600235560ustar00rootroot00000000000000module.exports = { description: 'generates multiple output files when multiple targets are specified', command: 'rollup -c' }; rollup-2.61.1/test/cli/samples/multiple-targets/_expected/000077500000000000000000000000001415504077600235635ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/multiple-targets/_expected/cjs.js000066400000000000000000000000651415504077600247010ustar00rootroot00000000000000'use strict'; var main = 0; module.exports = main; rollup-2.61.1/test/cli/samples/multiple-targets/_expected/es.js000066400000000000000000000000531415504077600245260ustar00rootroot00000000000000var main = 0; export { main as default }; rollup-2.61.1/test/cli/samples/multiple-targets/main.js000066400000000000000000000000221415504077600230770ustar00rootroot00000000000000export default 0; rollup-2.61.1/test/cli/samples/multiple-targets/rollup.config.js000066400000000000000000000002601415504077600247400ustar00rootroot00000000000000export default { input: 'main.js', output: [ { format: 'cjs', file: '_actual/cjs.js', exports: 'auto' }, { format: 'es', file: '_actual/es.js' } ] }; rollup-2.61.1/test/cli/samples/no-color/000077500000000000000000000000001415504077600200515ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/no-color/_config.js000066400000000000000000000006211415504077600220120ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/cli/samples/no-color/main1.js000066400000000000000000000000261415504077600214120ustar00rootroot00000000000000console.log('main1'); rollup-2.61.1/test/cli/samples/no-color/main2.js000066400000000000000000000000261415504077600214130ustar00rootroot00000000000000console.log('main2'); rollup-2.61.1/test/cli/samples/no-conflict/000077500000000000000000000000001415504077600205345ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/no-conflict/_config.js000066400000000000000000000001571415504077600225010ustar00rootroot00000000000000module.exports = { description: 'respects noConflict option', command: 'rollup --config rollup.config.js' }; rollup-2.61.1/test/cli/samples/no-conflict/_expected.js000066400000000000000000000010311415504077600230250ustar00rootroot00000000000000(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-2.61.1/test/cli/samples/no-conflict/main.js000066400000000000000000000000231415504077600220110ustar00rootroot00000000000000export default {}; rollup-2.61.1/test/cli/samples/no-conflict/rollup.config.js000066400000000000000000000001641415504077600236540ustar00rootroot00000000000000module.exports = { input: 'main.js', output: { format: 'umd', noConflict: true, name: 'conflictyName' } }; rollup-2.61.1/test/cli/samples/no-strict/000077500000000000000000000000001415504077600202435ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/no-strict/_config.js000066400000000000000000000001671415504077600222110ustar00rootroot00000000000000module.exports = { description: 'use no strict option', command: 'rollup -i main.js -f iife --no-strict --indent' }; rollup-2.61.1/test/cli/samples/no-strict/_expected.js000066400000000000000000000000531415504077600225370ustar00rootroot00000000000000(function () { console.log( 42 ); })(); rollup-2.61.1/test/cli/samples/no-strict/main.js000066400000000000000000000000231415504077600215200ustar00rootroot00000000000000console.log( 42 ); rollup-2.61.1/test/cli/samples/no-treeshake/000077500000000000000000000000001415504077600207065ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/no-treeshake/_config.js000066400000000000000000000002051415504077600226450ustar00rootroot00000000000000module.exports = { description: 'generates IIFE export with all code and overrides config', command: 'rollup -c --no-treeshake' }; rollup-2.61.1/test/cli/samples/no-treeshake/_expected.js000066400000000000000000000001771415504077600232110ustar00rootroot00000000000000var shakeless = (function () { 'use strict'; const version = '1.2.0'; var main = ( x, y ) => x + y; return main; })(); rollup-2.61.1/test/cli/samples/no-treeshake/main.js000066400000000000000000000000741415504077600221710ustar00rootroot00000000000000const version = '1.2.0'; export default ( x, y ) => x + y; rollup-2.61.1/test/cli/samples/no-treeshake/rollup.config.js000066400000000000000000000002201415504077600240170ustar00rootroot00000000000000module.exports = { input: 'main.js', treeshake: { propertyReadSideEffects: false }, output: { format: 'iife', name: 'shakeless' } }; rollup-2.61.1/test/cli/samples/node-config-auto-prefix/000077500000000000000000000000001415504077600227525ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/node-config-auto-prefix/_config.js000066400000000000000000000002561415504077600247170ustar00rootroot00000000000000module.exports = { description: 'uses config file installed from npm, automatically adding a rollup-config- prefix', command: 'rollup --config node:foo', execute: true }; rollup-2.61.1/test/cli/samples/node-config-auto-prefix/_expected.js000066400000000000000000000004431415504077600252510ustar00rootroot00000000000000(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-2.61.1/test/cli/samples/node-config-auto-prefix/main.js000066400000000000000000000000341415504077600242310ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-2.61.1/test/cli/samples/node-config-not-found/000077500000000000000000000000001415504077600224205ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/node-config-not-found/_config.js000066400000000000000000000004551415504077600243660ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { 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-2.61.1/test/cli/samples/node-config-not-found/main.js000066400000000000000000000000341415504077600236770ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-2.61.1/test/cli/samples/node-config/000077500000000000000000000000001415504077600205115ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/node-config/_config.js000066400000000000000000000002211415504077600224460ustar00rootroot00000000000000module.exports = { description: 'uses config file installed from npm', command: 'rollup --config node:bar', cwd: __dirname, execute: true }; rollup-2.61.1/test/cli/samples/node-config/_expected.js000066400000000000000000000004431415504077600230100ustar00rootroot00000000000000(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-2.61.1/test/cli/samples/node-config/main.js000066400000000000000000000000341415504077600217700ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-2.61.1/test/cli/samples/paths-output-option/000077500000000000000000000000001415504077600223045ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/paths-output-option/_config.js000066400000000000000000000001771415504077600242530ustar00rootroot00000000000000module.exports = { description: 'allows paths to be set as an output option', command: 'rollup --config rollup.config.js' }; rollup-2.61.1/test/cli/samples/paths-output-option/_expected.js000066400000000000000000000000731415504077600246020ustar00rootroot00000000000000'use strict'; var foo = require('bar'); console.log(foo);rollup-2.61.1/test/cli/samples/paths-output-option/main.js000066400000000000000000000000501415504077600235610ustar00rootroot00000000000000import foo from 'foo'; console.log(foo);rollup-2.61.1/test/cli/samples/paths-output-option/rollup.config.js000066400000000000000000000002151415504077600254210ustar00rootroot00000000000000module.exports = { input: 'main.js', external: ['foo'], output: { format: 'cjs', paths: { 'foo': 'bar' }, interop: false } }; rollup-2.61.1/test/cli/samples/plugin/000077500000000000000000000000001415504077600176175ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/absolute-esm/000077500000000000000000000000001415504077600222175ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/absolute-esm/_config.js000066400000000000000000000003371415504077600241640ustar00rootroot00000000000000module.exports = { description: 'ESM CLI --plugin /absolute/path', minNodeVersion: 12, skipIfWindows: true, command: `echo 'console.log(1 ? 2 : 3);' | rollup -p "\`pwd\`/my-esm-plugin.mjs={comment: 'Absolute ESM'}"` }; rollup-2.61.1/test/cli/samples/plugin/absolute-esm/_expected.js000066400000000000000000000000471415504077600245160ustar00rootroot00000000000000// Hello Absolute ESM console.log(2 ); rollup-2.61.1/test/cli/samples/plugin/absolute-esm/my-esm-plugin.mjs000066400000000000000000000002271415504077600254360ustar00rootroot00000000000000export default function(options = {}) { const {comment} = options; return { transform(code) { return `// Hello ${comment}\n${code}`; } }; }; rollup-2.61.1/test/cli/samples/plugin/absolute/000077500000000000000000000000001415504077600214355ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/absolute/_config.js000066400000000000000000000002741415504077600234020ustar00rootroot00000000000000module.exports = { description: 'CLI --plugin /absolute/path', skipIfWindows: true, command: `echo 'console.log(VALUE);' | rollup -p "\`pwd\`/my-plugin={VALUE: 'absolute', ZZZ: 1}"` }; rollup-2.61.1/test/cli/samples/plugin/absolute/_expected.js000066400000000000000000000000311415504077600237250ustar00rootroot00000000000000console.log("absolute"); rollup-2.61.1/test/cli/samples/plugin/absolute/my-plugin.js000066400000000000000000000005211415504077600237120ustar00rootroot00000000000000module.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-2.61.1/test/cli/samples/plugin/advanced-esm/000077500000000000000000000000001415504077600221465ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/advanced-esm/_config.js000066400000000000000000000011071415504077600241070ustar00rootroot00000000000000module.exports = { description: 'load an ESM-only rollup plugin from node_modules as well as CJS plugins', minNodeVersion: 12, 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/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-2.61.1/test/cli/samples/plugin/advanced-esm/_expected/000077500000000000000000000000001415504077600241065ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/advanced-esm/_expected/cjs.js000066400000000000000000000007101415504077600252210ustar00rootroot00000000000000"use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), 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-2.61.1/test/cli/samples/plugin/advanced-esm/_expected/es.js000066400000000000000000000005771415504077600250640ustar00rootroot00000000000000console.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-2.61.1/test/cli/samples/plugin/advanced-esm/main.js000066400000000000000000000001241415504077600234250ustar00rootroot00000000000000import {Foo} from "foo"; var foo = new Foo(123); foo.output(); export {Foo as Bar}; rollup-2.61.1/test/cli/samples/plugin/advanced-esm/node_modules/000077500000000000000000000000001415504077600246235ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/advanced-esm/node_modules/foo/000077500000000000000000000000001415504077600254065ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/advanced-esm/node_modules/foo/index.js000066400000000000000000000001731415504077600270540ustar00rootroot00000000000000var print = require('print'); exports.Foo = class { constructor(x) { this.x = x; } output() { print(this.x); } }; rollup-2.61.1/test/cli/samples/plugin/advanced-esm/node_modules/print/000077500000000000000000000000001415504077600257575ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/advanced-esm/node_modules/print/index.js000066400000000000000000000000731415504077600274240ustar00rootroot00000000000000module.exports = function(value) { console.log(value); }; rollup-2.61.1/test/cli/samples/plugin/advanced-esm/node_modules/rollup-plugin-esm-test/000077500000000000000000000000001415504077600311735ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/advanced-esm/node_modules/rollup-plugin-esm-test/index.mjs000066400000000000000000000003541415504077600330170ustar00rootroot00000000000000export 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-2.61.1/test/cli/samples/plugin/advanced-esm/node_modules/rollup-plugin-esm-test/package.json000066400000000000000000000000601415504077600334550ustar00rootroot00000000000000{ "type": "module", "main": "./index.mjs" } rollup-2.61.1/test/cli/samples/plugin/advanced-esm/rollup.config.js000066400000000000000000000003471415504077600252710ustar00rootroot00000000000000const buble = require('@rollup/plugin-buble'); export default { input: 'main.js', plugins: [ buble() ], output: [ { file: '_actual/cjs.js', format: 'cjs' }, { file: '_actual/es.js', format: 'esm' } ] }; rollup-2.61.1/test/cli/samples/plugin/advanced/000077500000000000000000000000001415504077600213645ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/advanced/_config.js000066400000000000000000000003331415504077600233250ustar00rootroot00000000000000module.exports = { description: 'advanced CLI --plugin functionality with rollup config', skipIfWindows: true, command: `rollup -c -p node-resolve,commonjs -p "terser={output: {beautify: true, indent_level: 2}}"` }; rollup-2.61.1/test/cli/samples/plugin/advanced/_expected/000077500000000000000000000000001415504077600233245ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/advanced/_expected/cjs.js000066400000000000000000000004371415504077600244450ustar00rootroot00000000000000"use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }); 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-2.61.1/test/cli/samples/plugin/advanced/_expected/es.js000066400000000000000000000003251415504077600242710ustar00rootroot00000000000000var 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-2.61.1/test/cli/samples/plugin/advanced/main.js000066400000000000000000000001241415504077600226430ustar00rootroot00000000000000import {Foo} from "foo"; var foo = new Foo(123); foo.output(); export {Foo as Bar}; rollup-2.61.1/test/cli/samples/plugin/advanced/node_modules/000077500000000000000000000000001415504077600240415ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/advanced/node_modules/foo/000077500000000000000000000000001415504077600246245ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/advanced/node_modules/foo/index.js000066400000000000000000000001731415504077600262720ustar00rootroot00000000000000var print = require('print'); exports.Foo = class { constructor(x) { this.x = x; } output() { print(this.x); } }; rollup-2.61.1/test/cli/samples/plugin/advanced/node_modules/print/000077500000000000000000000000001415504077600251755ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/advanced/node_modules/print/index.js000066400000000000000000000000731415504077600266420ustar00rootroot00000000000000module.exports = function(value) { console.log(value); }; rollup-2.61.1/test/cli/samples/plugin/advanced/rollup.config.js000066400000000000000000000003471415504077600245070ustar00rootroot00000000000000const buble = require('@rollup/plugin-buble'); export default { input: 'main.js', plugins: [ buble() ], output: [ { file: '_actual/cjs.js', format: 'cjs' }, { file: '_actual/es.js', format: 'esm' } ] }; rollup-2.61.1/test/cli/samples/plugin/basic/000077500000000000000000000000001415504077600207005ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/basic/_config.js000066400000000000000000000002101415504077600226330ustar00rootroot00000000000000module.exports = { description: 'basic CLI --plugin functionality', command: `rollup main.js -f cjs --plugin @rollup/plugin-buble` }; rollup-2.61.1/test/cli/samples/plugin/basic/_expected.js000066400000000000000000000004021415504077600231720ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var Bar = function Bar(x) { this.x = value; }; Bar.prototype.value = function value () { return this.x; }; var bar = new Bar(123); console.log(bar.value()); exports.Bar = Bar; rollup-2.61.1/test/cli/samples/plugin/basic/main.js000066400000000000000000000002151415504077600221600ustar00rootroot00000000000000export class Bar { constructor(x) { this.x = value; } value() { return this.x; } } var bar = new Bar(123); console.log(bar.value()); rollup-2.61.1/test/cli/samples/plugin/cannot-load/000077500000000000000000000000001415504077600220165ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/cannot-load/_config.js000066400000000000000000000004741415504077600237650ustar00rootroot00000000000000const { assertIncludes } = require('../../../../utils.js'); module.exports = { description: 'unknown CLI --plugin results in an error', skipIfWindows: true, command: `echo "console.log(123);" | rollup --plugin foobar`, error(err) { assertIncludes(err.message, '[!] Error: Cannot load plugin "foobar"'); } }; rollup-2.61.1/test/cli/samples/plugin/default-export/000077500000000000000000000000001415504077600225625ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/default-export/_config.js000066400000000000000000000002721415504077600245250ustar00rootroot00000000000000module.exports = { description: 'CLI --plugin with default export', skipIfWindows: true, command: `echo 'console.log(VALUE);' | rollup -p "./my-plugin={VALUE: 'default', ZZZ: 1}"` }; rollup-2.61.1/test/cli/samples/plugin/default-export/_expected.js000066400000000000000000000000301415504077600250510ustar00rootroot00000000000000console.log("default"); rollup-2.61.1/test/cli/samples/plugin/default-export/my-plugin.js000066400000000000000000000005221415504077600250400ustar00rootroot00000000000000exports.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-2.61.1/test/cli/samples/plugin/export-not-found/000077500000000000000000000000001415504077600230475ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/export-not-found/_config.js000066400000000000000000000010411415504077600250050ustar00rootroot00000000000000const path = require('path'); const { assertIncludes } = require('../../../../utils.js'); module.exports = { description: 'Throws when the plugin export cannot be found', skipIfWindows: true, command: `echo 'console.log("ignored");' | rollup -p "./my-missing-plugin"`, error(err) { assertIncludes( err.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-2.61.1/test/cli/samples/plugin/export-not-found/_expected.js000066400000000000000000000000341415504077600253420ustar00rootroot00000000000000console.log('transformed'); rollup-2.61.1/test/cli/samples/plugin/export-not-found/my-missing-plugin.js000066400000000000000000000000001415504077600267630ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/invalid-argument/000077500000000000000000000000001415504077600230655ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/invalid-argument/_config.js000066400000000000000000000005131415504077600250260ustar00rootroot00000000000000const { assertIncludes } = require('../../../../utils.js'); module.exports = { description: 'invalid CLI --plugin argument format', skipIfWindows: true, command: `echo "console.log(123);" | rollup --plugin 'foo bar'`, error(err) { assertIncludes(err.message, '[!] Error: Invalid --plugin argument format: "foo bar"'); } }; rollup-2.61.1/test/cli/samples/plugin/named-export/000077500000000000000000000000001415504077600222225ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/named-export/_config.js000066400000000000000000000002611415504077600241630ustar00rootroot00000000000000module.exports = { description: 'supports stripping "rollup-config" prefix to find named plugin export', skipIfWindows: true, command: `rollup -c -p rollup-plugin-terser` }; rollup-2.61.1/test/cli/samples/plugin/named-export/_expected/000077500000000000000000000000001415504077600241625ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/named-export/_expected/cjs.js000066400000000000000000000002661415504077600253030ustar00rootroot00000000000000"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(t){this.x=t};t.prototype.output=function(){console.log(this.x)},new t(123).output(),exports.Bar=t; rollup-2.61.1/test/cli/samples/plugin/named-export/_expected/es.js000066400000000000000000000001651415504077600251310ustar00rootroot00000000000000var t=function(t){this.x=t};t.prototype.output=function(){console.log(this.x)},new t(123).output();export{t as Bar}; rollup-2.61.1/test/cli/samples/plugin/named-export/main.js000066400000000000000000000002271415504077600235050ustar00rootroot00000000000000class Foo { constructor(x) { this.x = x; } output() { console.log(this.x); } } const foo = new Foo(123); foo.output(); export { Foo as Bar }; rollup-2.61.1/test/cli/samples/plugin/named-export/rollup.config.js000066400000000000000000000003471415504077600253450ustar00rootroot00000000000000const buble = require('@rollup/plugin-buble'); export default { input: 'main.js', plugins: [ buble() ], output: [ { file: '_actual/cjs.js', format: 'cjs' }, { file: '_actual/es.js', format: 'esm' } ] }; rollup-2.61.1/test/cli/samples/plugin/object/000077500000000000000000000000001415504077600210655ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/object/_config.js000066400000000000000000000002741415504077600230320ustar00rootroot00000000000000module.exports = { description: 'CLI --plugin object', skipIfWindows: true, command: `echo 'console.log(42);' | rollup -f cjs -p '{transform: c => c + String.fromCharCode(10) + c}'` }; rollup-2.61.1/test/cli/samples/plugin/object/_expected.js000066400000000000000000000000621415504077600233610ustar00rootroot00000000000000'use strict'; console.log(42); console.log(42); rollup-2.61.1/test/cli/samples/plugin/relative-camelized/000077500000000000000000000000001415504077600233655ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/relative-camelized/_config.js000066400000000000000000000005501415504077600253270ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/cli/samples/plugin/relative-camelized/_expected.js000066400000000000000000000001671415504077600256670ustar00rootroot00000000000000console.log("initial"); console.log("plugin1"); console.log("plugin2"); console.log("plugin3"); console.log("plugin4");rollup-2.61.1/test/cli/samples/plugin/relative-camelized/plugins/000077500000000000000000000000001415504077600250465ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/relative-camelized/plugins/@rollup/000077500000000000000000000000001415504077600264635ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/relative-camelized/plugins/@rollup/plugin-supreme.js000066400000000000000000000001421415504077600317720ustar00rootroot00000000000000exports.supreme = () => ({ transform(code) { return `${code}console.log("plugin4");\n`; } }); rollup-2.61.1/test/cli/samples/plugin/relative-camelized/plugins/my-super-plugin1.js000066400000000000000000000001511415504077600305370ustar00rootroot00000000000000exports.mySuperPlugin1 = () => ({ transform(code) { return `${code}console.log("plugin1");\n`; } }); rollup-2.61.1/test/cli/samples/plugin/relative-camelized/plugins/rollup-plugin-000066400000000000000000000001471415504077600276610ustar00rootroot00000000000000exports.rollupPlugin = () => ({ transform(code) { return `${code}console.log("plugin3");\n`; } }); rollup-2.61.1/test/cli/samples/plugin/relative-camelized/plugins/rollup-plugin-my-super-plugin2.js000066400000000000000000000001511415504077600333470ustar00rootroot00000000000000exports.mySuperPlugin2 = () => ({ transform(code) { return `${code}console.log("plugin2");\n`; } }); rollup-2.61.1/test/cli/samples/plugin/relative-esm/000077500000000000000000000000001415504077600222145ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/relative-esm/_config.js000066400000000000000000000003511415504077600241550ustar00rootroot00000000000000module.exports = { description: 'ESM CLI --plugin ../relative/path', minNodeVersion: 12, skipIfWindows: true, command: `echo 'console.log(1 ? 2 : 3);' | rollup -p "../absolute-esm/my-esm-plugin.mjs={comment: 'Relative ESM'}"` }; rollup-2.61.1/test/cli/samples/plugin/relative-esm/_expected.js000066400000000000000000000000471415504077600245130ustar00rootroot00000000000000// Hello Relative ESM console.log(2 ); rollup-2.61.1/test/cli/samples/plugin/relative/000077500000000000000000000000001415504077600214325ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/plugin/relative/_config.js000066400000000000000000000003021415504077600233670ustar00rootroot00000000000000module.exports = { description: 'CLI --plugin ../relative/path', skipIfWindows: true, command: `echo 'console.log(VALUE);' | rollup -p "../absolute/my-plugin={VALUE: 'relative', ZZZ: 1}"` }; rollup-2.61.1/test/cli/samples/plugin/relative/_expected.js000066400000000000000000000000311415504077600237220ustar00rootroot00000000000000console.log("relative"); rollup-2.61.1/test/cli/samples/property-read-side-effects/000077500000000000000000000000001415504077600234555ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/property-read-side-effects/_config.js000066400000000000000000000002551415504077600254210ustar00rootroot00000000000000module.exports = { description: 'allows disabling side-effects when accessing properties', command: 'rollup main.js --format es --no-treeshake.propertyReadSideEffects' }; rollup-2.61.1/test/cli/samples/property-read-side-effects/_expected.js000066400000000000000000000000231415504077600257460ustar00rootroot00000000000000console.log( 42 ); rollup-2.61.1/test/cli/samples/property-read-side-effects/main.js000066400000000000000000000001411415504077600247330ustar00rootroot00000000000000function deepAccess ( foo ) { const x = foo.bar.baz; } deepAccess( null ); console.log( 42 ); rollup-2.61.1/test/cli/samples/propertyReadSideEffects-always/000077500000000000000000000000001415504077600244045ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/propertyReadSideEffects-always/_config.js000066400000000000000000000002741415504077600263510ustar00rootroot00000000000000module.exports = { description: 'verify property accesses are retained for getters with side effects', command: `rollup main.js --validate --treeshake.propertyReadSideEffects=always` }; rollup-2.61.1/test/cli/samples/propertyReadSideEffects-always/_expected.js000066400000000000000000000003551415504077600267050ustar00rootroot00000000000000class 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-2.61.1/test/cli/samples/propertyReadSideEffects-always/main.js000066400000000000000000000004651415504077600256730ustar00rootroot00000000000000class 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-2.61.1/test/cli/samples/silent-onwarn/000077500000000000000000000000001415504077600211215ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/silent-onwarn/_config.js000066400000000000000000000003131415504077600230600ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'triggers onwarn with --silent', command: 'rollup -c --silent', stderr: stderr => { assert.equal(stderr, ''); return true; } }; rollup-2.61.1/test/cli/samples/silent-onwarn/_expected.js000066400000000000000000000001141415504077600234130ustar00rootroot00000000000000var doIt = () => console.log('main'); doIt(); export { doIt as default }; rollup-2.61.1/test/cli/samples/silent-onwarn/main.js000066400000000000000000000001221415504077600223760ustar00rootroot00000000000000import doIt from './main.js'; export default () => console.log('main'); doIt(); rollup-2.61.1/test/cli/samples/silent-onwarn/rollup.config.js000066400000000000000000000005031415504077600242360ustar00rootroot00000000000000import 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-2.61.1/test/cli/samples/silent/000077500000000000000000000000001415504077600176175ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/silent/_config.js000066400000000000000000000003421415504077600215600ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'does not print warnings with --silent', command: 'rollup -i main.js -f cjs --silent', stderr: stderr => { assert.equal(stderr, ''); return true; } }; rollup-2.61.1/test/cli/samples/silent/_expected.js000066400000000000000000000000671415504077600221200ustar00rootroot00000000000000'use strict'; var foo = 42; assert.equal( foo, 42 ); rollup-2.61.1/test/cli/samples/silent/foo.js000066400000000000000000000000251415504077600207350ustar00rootroot00000000000000export var foo = 42; rollup-2.61.1/test/cli/samples/silent/main.js000066400000000000000000000000771415504077600211050ustar00rootroot00000000000000import { foo, bar } from './foo.js'; assert.equal( foo, 42 ); rollup-2.61.1/test/cli/samples/sourcemap-hidden/000077500000000000000000000000001415504077600215505ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/sourcemap-hidden/_config.js000066400000000000000000000011061415504077600235100ustar00rootroot00000000000000const assert = require('assert'); const fs = require('fs'); module.exports = { description: 'omits sourcemap comments', command: 'rollup -i main.js -f es -m hidden -o output.js', test() { assert.equal(fs.readFileSync('output.js', 'utf-8').trim(), 'console.log( 42 );'); fs.unlinkSync('output.js'); assert.equal( fs.readFileSync('output.js.map', 'utf-8').trim(), '{"version":3,"file":"output.js","sources":["main.js"],"sourcesContent":["console.log( 42 );\\n"],"names":[],"mappings":"AAAA,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE"}' ); fs.unlinkSync('output.js.map'); } }; rollup-2.61.1/test/cli/samples/sourcemap-hidden/main.js000066400000000000000000000000231415504077600230250ustar00rootroot00000000000000console.log( 42 ); rollup-2.61.1/test/cli/samples/sourcemap-newline/000077500000000000000000000000001415504077600217565ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/sourcemap-newline/_config.js000066400000000000000000000003561415504077600237240ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/cli/samples/sourcemap-newline/main.js000066400000000000000000000000231415504077600232330ustar00rootroot00000000000000console.log( 42 ); rollup-2.61.1/test/cli/samples/stdin/000077500000000000000000000000001415504077600174425ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/stdin/commonjs/000077500000000000000000000000001415504077600212675ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/stdin/commonjs/_config.js000066400000000000000000000003171415504077600232320ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/cli/samples/stdin/commonjs/_expected.js000066400000000000000000000001451415504077600235650ustar00rootroot00000000000000'use strict'; var _ = {}; var add = (x, y) => x + y; console.log(add(2, 1)); module.exports = _; rollup-2.61.1/test/cli/samples/stdin/commonjs/add.js000066400000000000000000000000421415504077600223510ustar00rootroot00000000000000module.exports = (x, y) => x + y; rollup-2.61.1/test/cli/samples/stdin/config-file/000077500000000000000000000000001415504077600216245ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/stdin/config-file/_config.js000066400000000000000000000004361415504077600235710ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/cli/samples/stdin/config-file/_expected/000077500000000000000000000000001415504077600235645ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/stdin/config-file/_expected/cjs.js000066400000000000000000000002661415504077600247050ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const PRINT = x => console.log(x); var C = 123; PRINT(C); exports.print = PRINT; exports.value = C; rollup-2.61.1/test/cli/samples/stdin/config-file/_expected/es.js000066400000000000000000000001441415504077600245300ustar00rootroot00000000000000const PRINT = x => console.log(x); var C = 123; PRINT(C); export { PRINT as print, C as value }; rollup-2.61.1/test/cli/samples/stdin/config-file/_expected/no-stdin.js000066400000000000000000000000661415504077600256570ustar00rootroot00000000000000const PRINT = x => console.log(x); export { PRINT }; rollup-2.61.1/test/cli/samples/stdin/config-file/a.mjs000066400000000000000000000000521415504077600225540ustar00rootroot00000000000000export const PRINT = x => console.log(x); rollup-2.61.1/test/cli/samples/stdin/config-file/b.mjs000066400000000000000000000000241415504077600225540ustar00rootroot00000000000000export default 123; rollup-2.61.1/test/cli/samples/stdin/config-file/rollup.config.js000066400000000000000000000004141415504077600247420ustar00rootroot00000000000000export 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-2.61.1/test/cli/samples/stdin/force-stdin-tty/000077500000000000000000000000001415504077600224755ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/stdin/force-stdin-tty/_config.js000066400000000000000000000002721415504077600244400ustar00rootroot00000000000000module.exports = { description: 'allows forcing stdin input on TTY interfaces via option', skipIfWindows: true, command: `echo "console.log('PASS');" | ./wrapper.js -f es --stdin` }; rollup-2.61.1/test/cli/samples/stdin/force-stdin-tty/_expected.js000077500000000000000000000000251415504077600247730ustar00rootroot00000000000000console.log('PASS'); rollup-2.61.1/test/cli/samples/stdin/force-stdin-tty/wrapper.js000077500000000000000000000001341415504077600245140ustar00rootroot00000000000000#!/usr/bin/env node process.stdin.isTTY = true; require('../../../../../dist/bin/rollup'); rollup-2.61.1/test/cli/samples/stdin/json/000077500000000000000000000000001415504077600204135ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/stdin/json/_config.js000066400000000000000000000002571415504077600223610ustar00rootroot00000000000000module.exports = { description: 'pipe JSON over stdin to create a module', skipIfWindows: true, command: `echo '{"foo": 42, "bar": "ok"}' | rollup --stdin=json -p json` }; rollup-2.61.1/test/cli/samples/stdin/json/_expected.js000066400000000000000000000001441415504077600227100ustar00rootroot00000000000000var foo = 42; var bar = "ok"; var _ = { foo: foo, bar: bar }; export { bar, _ as default, foo }; rollup-2.61.1/test/cli/samples/stdin/no-dash/000077500000000000000000000000001415504077600207735ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/stdin/no-dash/_config.js000066400000000000000000000002671415504077600227420ustar00rootroot00000000000000module.exports = { description: 'uses stdin input when piping into Rollup without an input', skipIfWindows: true, command: `echo "0 && fail() || console.log('PASS');" | rollup` }; rollup-2.61.1/test/cli/samples/stdin/no-dash/_expected.js000066400000000000000000000000251415504077600232660ustar00rootroot00000000000000console.log('PASS'); rollup-2.61.1/test/cli/samples/stdin/no-stdin-config-file/000077500000000000000000000000001415504077600233555ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/stdin/no-stdin-config-file/-.mjs000066400000000000000000000000521415504077600242210ustar00rootroot00000000000000export const PRINT = x => console.log(x); rollup-2.61.1/test/cli/samples/stdin/no-stdin-config-file/_config.js000066400000000000000000000002601415504077600253150ustar00rootroot00000000000000module.exports = { description: 'allows using "-" as a regular file name via flag', skipIfWindows: true, command: `echo "console.log('IGNORED');" | rollup -c --no-stdin` }; rollup-2.61.1/test/cli/samples/stdin/no-stdin-config-file/_expected/000077500000000000000000000000001415504077600253155ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/stdin/no-stdin-config-file/_expected/cjs.js000066400000000000000000000002121415504077600264250ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const PRINT = x => console.log(x); exports.PRINT = PRINT; rollup-2.61.1/test/cli/samples/stdin/no-stdin-config-file/_expected/es.js000066400000000000000000000000601415504077600262560ustar00rootroot00000000000000const PRINT = x => console.log(x); PRINT('a'); rollup-2.61.1/test/cli/samples/stdin/no-stdin-config-file/a.mjs000066400000000000000000000000561415504077600243110ustar00rootroot00000000000000import { PRINT } from './-.mjs'; PRINT('a'); rollup-2.61.1/test/cli/samples/stdin/no-stdin-config-file/rollup.config.js000066400000000000000000000002671415504077600265010ustar00rootroot00000000000000export default [ { input: '-', output: { file: '_actual/cjs.js', format: 'cjs' } }, { input: 'a.mjs', output: { file: '_actual/es.js', format: 'es' } } ]; rollup-2.61.1/test/cli/samples/stdin/no-stdin-tty/000077500000000000000000000000001415504077600220135ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/stdin/no-stdin-tty/_config.js000066400000000000000000000005011415504077600237510ustar00rootroot00000000000000const { assertIncludes } = require('../../../../utils.js'); module.exports = { description: 'does not use input as stdin on TTY interfaces', skipIfWindows: true, command: `echo "console.log('PASS');" | ./wrapper.js -f es`, error(err) { assertIncludes(err.message, 'You must supply options.input to rollup'); } }; rollup-2.61.1/test/cli/samples/stdin/no-stdin-tty/wrapper.js000077500000000000000000000001341415504077600240320ustar00rootroot00000000000000#!/usr/bin/env node process.stdin.isTTY = true; require('../../../../../dist/bin/rollup'); rollup-2.61.1/test/cli/samples/stdin/self-import/000077500000000000000000000000001415504077600217035ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/stdin/self-import/_config.js000066400000000000000000000002421415504077600236430ustar00rootroot00000000000000module.exports = { description: 'stdin input of code that imports a copy of itself', skipIfWindows: true, command: `cat input.txt | rollup -f cjs --silent` }; rollup-2.61.1/test/cli/samples/stdin/self-import/_expected.js000066400000000000000000000002411415504077600241760ustar00rootroot00000000000000'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-2.61.1/test/cli/samples/stdin/self-import/input.txt000066400000000000000000000002151415504077600236010ustar00rootroot00000000000000import 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-2.61.1/test/cli/samples/stdin/stdin-error/000077500000000000000000000000001415504077600217125ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/stdin/stdin-error/_config.js000066400000000000000000000003551415504077600236570ustar00rootroot00000000000000const { assertIncludes } = require('../../../../utils.js'); module.exports = { description: 'handles stdin errors', command: `node wrapper.js`, error(err) { assertIncludes(err.message, 'Could not load -: Stream is broken.'); } }; rollup-2.61.1/test/cli/samples/stdin/stdin-error/wrapper.js000077500000000000000000000004731415504077600237370ustar00rootroot00000000000000#!/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-2.61.1/test/cli/samples/stdin/with-dash/000077500000000000000000000000001415504077600213325ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/stdin/with-dash/_config.js000066400000000000000000000002341415504077600232730ustar00rootroot00000000000000module.exports = { description: 'stdin input with dash on CLI', skipIfWindows: true, command: `echo "0 && fail() || console.log('PASS');" | rollup -` }; rollup-2.61.1/test/cli/samples/stdin/with-dash/_expected.js000066400000000000000000000000251415504077600236250ustar00rootroot00000000000000console.log('PASS'); rollup-2.61.1/test/cli/samples/stdout-code-splitting/000077500000000000000000000000001415504077600225665ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/stdout-code-splitting/_config.js000066400000000000000000000013131415504077600245260ustar00rootroot00000000000000const assert = require('assert'); const COLOR = '\u001b[36m\u001b[1m'; const STANDARD = '\u001b[22m\u001b[39m'; module.exports = { 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-74b448a5:${STANDARD}\n` + 'Hello' ); } }; rollup-2.61.1/test/cli/samples/stdout-code-splitting/main1.js000066400000000000000000000000261415504077600241270ustar00rootroot00000000000000console.log('main1'); rollup-2.61.1/test/cli/samples/stdout-code-splitting/main2.js000066400000000000000000000000261415504077600241300ustar00rootroot00000000000000console.log('main2'); rollup-2.61.1/test/cli/samples/stdout-code-splitting/wrapper.js000077500000000000000000000001321415504077600246030ustar00rootroot00000000000000#!/usr/bin/env node process.stdout.isTTY = true; require('../../../../dist/bin/rollup'); rollup-2.61.1/test/cli/samples/stdout-only-inline-sourcemaps/000077500000000000000000000000001415504077600242555ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/stdout-only-inline-sourcemaps/_config.js000066400000000000000000000005251415504077600262210ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { 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-2.61.1/test/cli/samples/stdout-only-inline-sourcemaps/main.js000066400000000000000000000000231415504077600255320ustar00rootroot00000000000000console.log( 42 ); rollup-2.61.1/test/cli/samples/stdout-single-input/000077500000000000000000000000001415504077600222575ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/stdout-single-input/_config.js000066400000000000000000000002141415504077600242160ustar00rootroot00000000000000module.exports = { description: 'bundles a single input to stdout without modifications', command: 'rollup -i main.js -f es -m inline' }; rollup-2.61.1/test/cli/samples/stdout-single-input/_expected.js000066400000000000000000000004411415504077600245540ustar00rootroot00000000000000console.log( 42 ); //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNvdXJjZXMiOlsibWFpbi5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJjb25zb2xlLmxvZyggNDIgKTtcbiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLENBQUMsR0FBRyxFQUFFLEVBQUUsRUFBRSJ9 rollup-2.61.1/test/cli/samples/stdout-single-input/main.js000066400000000000000000000000231415504077600235340ustar00rootroot00000000000000console.log( 42 ); rollup-2.61.1/test/cli/samples/symlinked-config/000077500000000000000000000000001415504077600215635ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/symlinked-config/_config.js000066400000000000000000000001531415504077600235240ustar00rootroot00000000000000module.exports = { description: 'loads a symlinked config file', command: 'rollup -c', execute: true }; rollup-2.61.1/test/cli/samples/symlinked-config/main.js000066400000000000000000000000321415504077600230400ustar00rootroot00000000000000assert.equal(ANSWER, 42); rollup-2.61.1/test/cli/samples/symlinked-config/rollup.config.js000077700000000000000000000000001415504077600313772rollup.config.symlinkedustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/symlinked-config/rollup.config.symlinked000066400000000000000000000002711415504077600262650ustar00rootroot00000000000000import replace from '@rollup/plugin-replace'; export default { input: 'main.js', output: { format: 'cjs' }, plugins: [ replace({ preventAssignment: true, 'ANSWER': 42 }) ] }; rollup-2.61.1/test/cli/samples/symlinked-named-config/000077500000000000000000000000001415504077600226455ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/symlinked-named-config/_config.js000066400000000000000000000002311415504077600246030ustar00rootroot00000000000000module.exports = { description: 'loads a symlinked config file with the given name', command: 'rollup --config my.rollup.config.js', execute: true }; rollup-2.61.1/test/cli/samples/symlinked-named-config/main.js000066400000000000000000000000321415504077600241220ustar00rootroot00000000000000assert.equal(ANSWER, 42); rollup-2.61.1/test/cli/samples/symlinked-named-config/my.rollup.config.js000077700000000000000000000000001415504077600331052rollup.config.symlinkedustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/symlinked-named-config/rollup.config.symlinked000066400000000000000000000002711415504077600273470ustar00rootroot00000000000000import replace from '@rollup/plugin-replace'; export default { input: 'main.js', output: { format: 'cjs' }, plugins: [ replace({ preventAssignment: true, 'ANSWER': 42 }) ] }; rollup-2.61.1/test/cli/samples/treeshake-preset-override/000077500000000000000000000000001415504077600234115ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/treeshake-preset-override/_config.js000066400000000000000000000003251415504077600253530ustar00rootroot00000000000000module.exports = { description: 'overrides the treeshake option when using presets', command: 'rollup --config --treeshake recommended --treeshake.unknownGlobalSideEffects --no-treeshake.moduleSideEffects' }; rollup-2.61.1/test/cli/samples/treeshake-preset-override/_expected.js000066400000000000000000000004171415504077600257110ustar00rootroot00000000000000console.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-2.61.1/test/cli/samples/treeshake-preset-override/dep.js000066400000000000000000000000241415504077600245130ustar00rootroot00000000000000console.log('dep'); rollup-2.61.1/test/cli/samples/treeshake-preset-override/main.js000066400000000000000000000004421415504077600246730ustar00rootroot00000000000000import './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-2.61.1/test/cli/samples/treeshake-preset-override/rollup.config.js000066400000000000000000000002271415504077600265310ustar00rootroot00000000000000export default { input: 'main.js', treeshake: { unknownGlobalSideEffects: false, tryCatchDeoptimization: false }, output: { format: 'es' } }rollup-2.61.1/test/cli/samples/treeshake-unknown-preset/000077500000000000000000000000001415504077600232715ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/treeshake-unknown-preset/_config.js000066400000000000000000000010241415504077600252300ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { description: 'overrides the treeshake option when using presets', command: 'rollup main.js --format es --treeshake unknown', error: () => true, stderr: stderr => { assertIncludes( stderr, '[!] Error: 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/guide/en/#treeshake' ); } }; rollup-2.61.1/test/cli/samples/treeshake-unknown-preset/main.js000066400000000000000000000000251415504077600245500ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/cli/samples/validate/000077500000000000000000000000001415504077600201125ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/validate/_config.js000066400000000000000000000010021415504077600220450ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { description: 'use CLI --validate to test whether output is well formed', skipIfWindows: true, command: `rollup main.js --silent --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-2.61.1/test/cli/samples/validate/main.js000066400000000000000000000000301415504077600213650ustar00rootroot00000000000000console.log(1 ? 2 : 3); rollup-2.61.1/test/cli/samples/wait-for-bundle-input-object/000077500000000000000000000000001415504077600237215ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/wait-for-bundle-input-object/_config.js000066400000000000000000000011631415504077600256640ustar00rootroot00000000000000const fs = require('fs'); const path = require('path'); let second; let third; module.exports = { 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() { fs.unlinkSync(second); fs.unlinkSync(third); }, abortOnStderr(data) { if (data.includes('waiting for input second')) { fs.writeFileSync(second, "export default 'second'"); } else if (data.includes('waiting for input third')) { fs.writeFileSync(third, "export default 'third'"); } } }; rollup-2.61.1/test/cli/samples/wait-for-bundle-input-object/_expected/000077500000000000000000000000001415504077600256615ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/wait-for-bundle-input-object/_expected/first.js000066400000000000000000000000631415504077600273450ustar00rootroot00000000000000var first = 'first'; export { first as default }; rollup-2.61.1/test/cli/samples/wait-for-bundle-input-object/_expected/second.js000066400000000000000000000000661415504077600274740ustar00rootroot00000000000000var second = 'second'; export { second as default }; rollup-2.61.1/test/cli/samples/wait-for-bundle-input-object/_expected/third.js000066400000000000000000000000631415504077600273300ustar00rootroot00000000000000var third = 'third'; export { third as default }; rollup-2.61.1/test/cli/samples/wait-for-bundle-input-object/first.js000066400000000000000000000000301415504077600253770ustar00rootroot00000000000000export default 'first'; rollup-2.61.1/test/cli/samples/wait-for-bundle-input-object/rollup.config.js000066400000000000000000000002121415504077600270330ustar00rootroot00000000000000module.exports = { input: { first: 'first', second: 'second', third: 'third' }, output: { format: 'es', dir: '_actual' } }; rollup-2.61.1/test/cli/samples/wait-for-bundle-input/000077500000000000000000000000001415504077600224555ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/wait-for-bundle-input/_config.js000066400000000000000000000007471415504077600244270ustar00rootroot00000000000000const fs = require('fs'); const path = require('path'); let mainFile; module.exports = { description: 'waits for bundle input', command: 'rollup -c --waitForBundleInput', before() { mainFile = path.resolve(__dirname, 'main.js'); }, after() { fs.unlinkSync(mainFile); }, abortOnStderr(data) { if (data.includes('waiting for input main.js')) { // wait longer than one polling interval setTimeout(() => fs.writeFileSync(mainFile, 'export default 42;'), 600); } } }; rollup-2.61.1/test/cli/samples/wait-for-bundle-input/_expected.js000066400000000000000000000000541415504077600247520ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-2.61.1/test/cli/samples/wait-for-bundle-input/rollup.config.js000066400000000000000000000001061415504077600255710ustar00rootroot00000000000000module.exports = { input: 'main.js', output: { format: 'es' } }; rollup-2.61.1/test/cli/samples/warn-broken-sourcemap/000077500000000000000000000000001415504077600225425ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/warn-broken-sourcemap/_config.js000066400000000000000000000011261415504077600245040ustar00rootroot00000000000000const fs = require('fs'); const path = require('path'); const { assertIncludes } = require('../../../utils.js'); module.exports = { description: 'displays warnings for broken sourcemaps', command: 'rollup -c', stderr: stderr => { fs.unlinkSync(path.resolve(__dirname, 'bundle')); fs.unlinkSync(path.resolve(__dirname, 'bundle.map')); assertIncludes( stderr, '(!) Broken sourcemap\n' + 'https://rollupjs.org/guide/en/#warning-sourcemap-is-likely-to-be-incorrect\n' + 'Plugins that transform code (such as "test-plugin1") should generate accompanying sourcemaps\n' ); } }; rollup-2.61.1/test/cli/samples/warn-broken-sourcemap/main.js000066400000000000000000000000251415504077600240210ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/cli/samples/warn-broken-sourcemap/rollup.config.js000066400000000000000000000003211415504077600256550ustar00rootroot00000000000000module.exports = { input: 'main.js', plugins: [ { name: 'test-plugin1', transform(code) { return code + '/*1*/'; } } ], output: { format: 'es', file: 'bundle', sourcemap: true } }; rollup-2.61.1/test/cli/samples/warn-broken-sourcemaps/000077500000000000000000000000001415504077600227255ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/warn-broken-sourcemaps/_config.js000066400000000000000000000011671415504077600246740ustar00rootroot00000000000000const fs = require('fs'); const path = require('path'); const { assertIncludes } = require('../../../utils.js'); module.exports = { description: 'displays warnings for broken sourcemaps', command: 'rollup -c', stderr: stderr => { fs.unlinkSync(path.resolve(__dirname, 'bundle')); fs.unlinkSync(path.resolve(__dirname, 'bundle.map')); assertIncludes( stderr, '(!) Broken sourcemap\n' + 'https://rollupjs.org/guide/en/#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-2.61.1/test/cli/samples/warn-broken-sourcemaps/main.js000066400000000000000000000000251415504077600242040ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/cli/samples/warn-broken-sourcemaps/rollup.config.js000066400000000000000000000005771415504077600260550ustar00rootroot00000000000000module.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-2.61.1/test/cli/samples/warn-circular-multiple/000077500000000000000000000000001415504077600227235ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/warn-circular-multiple/_config.js000066400000000000000000000006171415504077600246710ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { 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-2.61.1/test/cli/samples/warn-circular-multiple/dep1.js000066400000000000000000000000511415504077600241060ustar00rootroot00000000000000import './main.js'; console.log('dep1'); rollup-2.61.1/test/cli/samples/warn-circular-multiple/dep2.js000066400000000000000000000000511415504077600241070ustar00rootroot00000000000000import './main.js'; console.log('dep2'); rollup-2.61.1/test/cli/samples/warn-circular-multiple/dep3.js000066400000000000000000000000511415504077600241100ustar00rootroot00000000000000import './main.js'; console.log('dep3'); rollup-2.61.1/test/cli/samples/warn-circular-multiple/dep4.js000066400000000000000000000000511415504077600241110ustar00rootroot00000000000000import './main.js'; console.log('dep5'); rollup-2.61.1/test/cli/samples/warn-circular-multiple/dep5.js000066400000000000000000000000511415504077600241120ustar00rootroot00000000000000import './main.js'; console.log('dep5'); rollup-2.61.1/test/cli/samples/warn-circular-multiple/dep6.js000066400000000000000000000000511415504077600241130ustar00rootroot00000000000000import './main.js'; console.log('dep6'); rollup-2.61.1/test/cli/samples/warn-circular-multiple/main.js000066400000000000000000000002151415504077600242030ustar00rootroot00000000000000import './dep1.js'; import './dep2.js'; import './dep3.js'; import './dep4.js'; import './dep5.js'; import './dep6.js'; console.log('main'); rollup-2.61.1/test/cli/samples/warn-circular-multiple/rollup.config.js000066400000000000000000000001061415504077600260370ustar00rootroot00000000000000module.exports = { input: 'main.js', output: { format: 'es' } }; rollup-2.61.1/test/cli/samples/warn-circular/000077500000000000000000000000001415504077600210725ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/warn-circular/_config.js000066400000000000000000000004021415504077600230300ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { description: 'warns for circular dependencies', command: 'rollup -c', stderr(stderr) { assertIncludes(stderr, '(!) Circular dependency\nmain.js -> dep.js -> main.js\n'); } }; rollup-2.61.1/test/cli/samples/warn-circular/dep.js000066400000000000000000000000501415504077600221730ustar00rootroot00000000000000import './main.js'; console.log('dep'); rollup-2.61.1/test/cli/samples/warn-circular/main.js000066400000000000000000000000501415504077600223470ustar00rootroot00000000000000import './dep.js'; console.log('main'); rollup-2.61.1/test/cli/samples/warn-circular/rollup.config.js000066400000000000000000000001061415504077600242060ustar00rootroot00000000000000module.exports = { input: 'main.js', output: { format: 'es' } }; rollup-2.61.1/test/cli/samples/warn-eval-multiple/000077500000000000000000000000001415504077600220465ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/warn-eval-multiple/_config.js000066400000000000000000000014751415504077600240170ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { 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/guide/en/#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-2.61.1/test/cli/samples/warn-eval-multiple/dep1.js000066400000000000000000000000371415504077600232350ustar00rootroot00000000000000eval('console.log("Hello");'); rollup-2.61.1/test/cli/samples/warn-eval-multiple/dep2.js000066400000000000000000000001041415504077600232310ustar00rootroot00000000000000eval('console.log("Hello");'); eval('console.log("Hello again");'); rollup-2.61.1/test/cli/samples/warn-eval-multiple/dep3.js000066400000000000000000000001631415504077600232370ustar00rootroot00000000000000eval('console.log("Hello");'); eval('console.log("Hello again");'); eval('console.log("Hello again and again");'); rollup-2.61.1/test/cli/samples/warn-eval-multiple/dep4.js000066400000000000000000000000371415504077600232400ustar00rootroot00000000000000eval('console.log("Hello");'); rollup-2.61.1/test/cli/samples/warn-eval-multiple/dep5.js000066400000000000000000000000371415504077600232410ustar00rootroot00000000000000eval('console.log("Hello");'); rollup-2.61.1/test/cli/samples/warn-eval-multiple/main.js000066400000000000000000000001621415504077600233270ustar00rootroot00000000000000import './dep1.js'; import './dep2.js'; import './dep3.js'; import './dep4.js'; import './dep5.js'; eval('foo'); rollup-2.61.1/test/cli/samples/warn-eval-multiple/rollup.config.js000066400000000000000000000001061415504077600251620ustar00rootroot00000000000000module.exports = { input: 'main.js', output: { format: 'es' } }; rollup-2.61.1/test/cli/samples/warn-eval/000077500000000000000000000000001415504077600202155ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/warn-eval/_config.js000066400000000000000000000005431415504077600221610ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { description: 'warns when eval is used', command: 'rollup -c', stderr: stderr => assertIncludes( stderr, '(!) Use of eval is strongly discouraged\n' + 'https://rollupjs.org/guide/en/#avoiding-eval\n' + 'main.js\n' + "1: eval('foo');\n" + ' ^' ) }; rollup-2.61.1/test/cli/samples/warn-eval/main.js000066400000000000000000000000151415504077600214730ustar00rootroot00000000000000eval('foo'); rollup-2.61.1/test/cli/samples/warn-eval/rollup.config.js000066400000000000000000000001061415504077600233310ustar00rootroot00000000000000module.exports = { input: 'main.js', output: { format: 'es' } }; rollup-2.61.1/test/cli/samples/warn-import-export/000077500000000000000000000000001415504077600221175ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/warn-import-export/_config.js000066400000000000000000000036601415504077600240660ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { description: 'warns about import and export related issues', command: 'rollup -c', stderr: stderr => { assertIncludes( stderr, '(!) Mixing named and default exports\n' + 'https://rollupjs.org/guide/en/#outputexports\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, '(!) Import of non-existent export\n' + 'main.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, '(!) Missing exports\n' + 'https://rollupjs.org/guide/en/#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' ); 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/guide/en/#warning-treating-module-as-external-dependency\n' + 'unresolvedExternal (imported by main.js, dep.js)\n' + 'otherUnresolvedExternal (imported by dep.js)\n' ); } }; rollup-2.61.1/test/cli/samples/warn-import-export/dep.js000066400000000000000000000002021415504077600232170ustar00rootroot00000000000000import 'unresolvedExternal'; import 'otherUnresolvedExternal'; export const foo = 1; export const bar = 2; export const baz = 3; rollup-2.61.1/test/cli/samples/warn-import-export/dep2.js000066400000000000000000000001031415504077600233010ustar00rootroot00000000000000export const foo = 4; export const bar = 5; export const quux = 6; rollup-2.61.1/test/cli/samples/warn-import-export/main.js000066400000000000000000000003561415504077600234050ustar00rootroot00000000000000import 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-2.61.1/test/cli/samples/warn-import-export/rollup.config.js000066400000000000000000000001401415504077600252310ustar00rootroot00000000000000module.exports = { input: 'main.js', external: ['external'], output: { format: 'cjs' } }; rollup-2.61.1/test/cli/samples/warn-missing-global-multiple/000077500000000000000000000000001415504077600240265ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/warn-missing-global-multiple/_config.js000066400000000000000000000007331415504077600257730ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { description: 'warns when there are multiple missing globals', command: 'rollup -c', stderr: stderr => assertIncludes( stderr, '(!) Missing global variable names\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-2.61.1/test/cli/samples/warn-missing-global-multiple/main.js000066400000000000000000000001721415504077600253100ustar00rootroot00000000000000import foo1 from 'external1'; import foo2 from 'external2'; import foo3 from 'external3'; console.log(foo1, foo2, foo3); rollup-2.61.1/test/cli/samples/warn-missing-global-multiple/rollup.config.js000066400000000000000000000002161415504077600271440ustar00rootroot00000000000000module.exports = { input: 'main.js', external: ['external1', 'external2', 'external3'], output: { format: 'iife', name: 'bundle' } }; rollup-2.61.1/test/cli/samples/warn-missing-global/000077500000000000000000000000001415504077600221755ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/warn-missing-global/_config.js000066400000000000000000000006211415504077600241360ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { description: 'warns when there is a missing global variable name', command: 'rollup -c', stderr: stderr => assertIncludes( stderr, '(!) Missing global variable name\n' + 'Use output.globals to specify browser global variable names corresponding to external modules\n' + "external (guessing 'foo')" ) }; rollup-2.61.1/test/cli/samples/warn-missing-global/main.js000066400000000000000000000000561415504077600234600ustar00rootroot00000000000000import foo from 'external'; console.log(foo); rollup-2.61.1/test/cli/samples/warn-missing-global/rollup.config.js000066400000000000000000000001631415504077600253140ustar00rootroot00000000000000module.exports = { input: 'main.js', external: ['external'], output: { format: 'iife', name: 'bundle' } }; rollup-2.61.1/test/cli/samples/warn-mixed-exports-multiple/000077500000000000000000000000001415504077600237275ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/warn-mixed-exports-multiple/_config.js000066400000000000000000000012561415504077600256750ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { description: 'warns when mixed exports are used', command: 'rollup -c', stderr: stderr => { assertIncludes( stderr, '(!) Mixing named and default exports\n' + 'https://rollupjs.org/guide/en/#outputexports\n' + 'The following entry modules are using named and default exports together:\n' + 'main.js\n' + 'lib1.js\n' + 'lib2.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-2.61.1/test/cli/samples/warn-mixed-exports-multiple/lib1.js000066400000000000000000000000551415504077600251140ustar00rootroot00000000000000export const value1 = 42; export default 42; rollup-2.61.1/test/cli/samples/warn-mixed-exports-multiple/lib2.js000066400000000000000000000000551415504077600251150ustar00rootroot00000000000000export const value2 = 42; export default 42; rollup-2.61.1/test/cli/samples/warn-mixed-exports-multiple/lib3.js000066400000000000000000000000551415504077600251160ustar00rootroot00000000000000export const value3 = 42; export default 42; rollup-2.61.1/test/cli/samples/warn-mixed-exports-multiple/lib4.js000066400000000000000000000000551415504077600251170ustar00rootroot00000000000000export const value4 = 42; export default 42; rollup-2.61.1/test/cli/samples/warn-mixed-exports-multiple/lib5.js000066400000000000000000000000551415504077600251200ustar00rootroot00000000000000export const value5 = 42; export default 42; rollup-2.61.1/test/cli/samples/warn-mixed-exports-multiple/main.js000066400000000000000000000006001415504077600252050ustar00rootroot00000000000000import 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-2.61.1/test/cli/samples/warn-mixed-exports-multiple/rollup.config.js000066400000000000000000000001371415504077600270470ustar00rootroot00000000000000module.exports = { input: 'main.js', preserveModules: true, output: { format: 'amd' } }; rollup-2.61.1/test/cli/samples/warn-multiple/000077500000000000000000000000001415504077600211215ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/warn-multiple/_config.js000066400000000000000000000017731415504077600230730ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { 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 "path". You might need to include https://github.com/snowpackjs/rollup-plugin-polyfill-node\n' ); assertIncludes( stderr, '(!) Import of non-existent exports\n' + 'main.js\n' + "4: import assert from 'assert';\n" + "5: import path from 'path';\n" + "6: import {doesNotExist, alsoNotFound} from './dep.js';\n" + ' ^\n' + '7: \n' + '8: export {url, assert, path};\n' + '...and 1 other occurrence\n' ); assertIncludes( stderr, "(!) Module level directives cause errors when bundled, 'use stuff' was ignored.\n" + 'main.js (1:0)\n' + "1: 'use stuff';\n" + ' ^\n' + '2: \n' + "3: import url from 'url';\n" ); } }; rollup-2.61.1/test/cli/samples/warn-multiple/dep.js000066400000000000000000000000001415504077600222150ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/warn-multiple/main.js000066400000000000000000000002551415504077600224050ustar00rootroot00000000000000'use stuff'; import url from 'url'; import assert from 'assert'; import path from 'path'; import {doesNotExist, alsoNotFound} from './dep.js'; export {url, assert, path}; rollup-2.61.1/test/cli/samples/warn-multiple/rollup.config.js000066400000000000000000000001771415504077600242450ustar00rootroot00000000000000module.exports = { input: 'main.js', external: ['url', 'assert', 'path'], output: { name: 'bundle', format: 'amd' } }; rollup-2.61.1/test/cli/samples/warn-plugin-loc/000077500000000000000000000000001415504077600213375ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/warn-plugin-loc/_config.js000066400000000000000000000006571415504077600233110ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { 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-2.61.1/test/cli/samples/warn-plugin-loc/main.js000066400000000000000000000000461415504077600226210ustar00rootroot00000000000000console.log("everyday I'm throwing"); rollup-2.61.1/test/cli/samples/warn-plugin-loc/rollup.config.js000066400000000000000000000011411415504077600244530ustar00rootroot00000000000000const path = require('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-2.61.1/test/cli/samples/warn-plugin/000077500000000000000000000000001415504077600205645ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/warn-plugin/_config.js000066400000000000000000000007161415504077600225320ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { description: 'displays warnings from plugins', command: 'rollup -c', stderr: stderr => 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-2.61.1/test/cli/samples/warn-plugin/main.js000066400000000000000000000000251415504077600220430ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/cli/samples/warn-plugin/rollup.config.js000066400000000000000000000012111415504077600236760ustar00rootroot00000000000000const path = require('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' }); } } ] } }; rollup-2.61.1/test/cli/samples/warn-this/000077500000000000000000000000001415504077600202355ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/warn-this/_config.js000066400000000000000000000006221415504077600221770ustar00rootroot00000000000000const { assertIncludes } = require('../../../utils.js'); module.exports = { 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/guide/en/#error-this-is-undefined\n' + 'main.js\n' + '1: console.log(this);\n' + ' ^' ) }; rollup-2.61.1/test/cli/samples/warn-this/main.js000066400000000000000000000000231415504077600215120ustar00rootroot00000000000000console.log(this); rollup-2.61.1/test/cli/samples/warn-this/rollup.config.js000066400000000000000000000001631415504077600233540ustar00rootroot00000000000000module.exports = { input: 'main.js', external: ['external'], output: { format: 'iife', name: 'bundle' } }; rollup-2.61.1/test/cli/samples/warn-unknown-options/000077500000000000000000000000001415504077600224565ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/warn-unknown-options/_config.js000066400000000000000000000002421415504077600244160ustar00rootroot00000000000000module.exports = { description: 'warns about unknown CLI options', command: 'rollup --config rollup.config.js --format es --configAnswer 42 --unknownOption' }; rollup-2.61.1/test/cli/samples/warn-unknown-options/_expected.js000066400000000000000000000000301415504077600247450ustar00rootroot00000000000000assert.equal( 42, 42 ); rollup-2.61.1/test/cli/samples/warn-unknown-options/main.js000066400000000000000000000000341415504077600237350ustar00rootroot00000000000000assert.equal( ANSWER, 42 ); rollup-2.61.1/test/cli/samples/warn-unknown-options/rollup.config.js000066400000000000000000000010461415504077600255760ustar00rootroot00000000000000var replace = require('@rollup/plugin-replace'); var assert = require('assert'); 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-2.61.1/test/cli/samples/watch/000077500000000000000000000000001415504077600174275ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/bundle-error/000077500000000000000000000000001415504077600220275ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/bundle-error/_config.js000066400000000000000000000012471415504077600237750ustar00rootroot00000000000000const fs = require('fs'); const path = require('path'); let mainFile; module.exports = { description: 'recovers from errors during bundling', command: 'rollup -cw', before() { mainFile = path.resolve(__dirname, 'main.js'); fs.writeFileSync(mainFile, '<=>'); }, after() { // synchronous sometimes does not seem to work, probably because the watch is not yet removed properly setTimeout(() => fs.unlinkSync(mainFile), 300); }, abortOnStderr(data) { if (data.includes('Error: Unexpected token')) { setTimeout(() => fs.writeFileSync(mainFile, 'export default 42;'), 500); return false; } if (data.includes('created _actual')) { return true; } } }; rollup-2.61.1/test/cli/samples/watch/bundle-error/_expected/000077500000000000000000000000001415504077600237675ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/bundle-error/_expected/main.js000066400000000000000000000000541415504077600252500ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-2.61.1/test/cli/samples/watch/bundle-error/rollup.config.js000066400000000000000000000001261415504077600251450ustar00rootroot00000000000000export default { input: 'main.js', output: { dir: "_actual", format: "es" } }; rollup-2.61.1/test/cli/samples/watch/clearScreen/000077500000000000000000000000001415504077600216555ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/clearScreen/_config.js000066400000000000000000000006721415504077600236240ustar00rootroot00000000000000const assert = require('assert'); const CLEAR_SCREEN = '\u001bc'; const UNDERLINE = '\u001b[4m'; module.exports = { 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-2.61.1/test/cli/samples/watch/clearScreen/main.js000066400000000000000000000000231415504077600231320ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/cli/samples/watch/clearScreen/rollup.config.js000066400000000000000000000001321415504077600247700ustar00rootroot00000000000000export default { input: 'main.js', output: { file: '_actual.js', format: 'es' } }; rollup-2.61.1/test/cli/samples/watch/clearScreen/wrapper.js000077500000000000000000000001721415504077600236760ustar00rootroot00000000000000#!/usr/bin/env node process.stdout.isTTY = true; process.stderr.isTTY = true; require('../../../../../dist/bin/rollup'); rollup-2.61.1/test/cli/samples/watch/close-error/000077500000000000000000000000001415504077600216635ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/close-error/_config.js000066400000000000000000000003451415504077600236270ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/cli/samples/watch/close-error/_expected/000077500000000000000000000000001415504077600236235ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/close-error/_expected/main.js000066400000000000000000000000541415504077600251040ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-2.61.1/test/cli/samples/watch/close-error/main.js000066400000000000000000000000231415504077600231400ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/cli/samples/watch/close-error/rollup.config.js000066400000000000000000000003131415504077600247770ustar00rootroot00000000000000export default { input: 'main.js', plugins: [ { name: 'faulty-close', closeBundle() { throw new Error('Close bundle failed'); } } ], output: { dir: "_actual", format: "es" } }; rollup-2.61.1/test/cli/samples/watch/close-on-generate-error/000077500000000000000000000000001415504077600240655ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/close-on-generate-error/_config.js000066400000000000000000000006701415504077600260320ustar00rootroot00000000000000const { assertIncludes } = require('../../../../utils.js'); module.exports = { description: 'closes the bundle on generate errors', command: 'rollup -cw', abortOnStderr(data) { if (data.includes('Bundle closed')) { return true; } }, stderr(stderr) { assertIncludes( stderr, '[!] Error: You must specify "output.file" or "output.dir" for the build.' ); assertIncludes(stderr, 'Bundle closed'); return false; } }; rollup-2.61.1/test/cli/samples/watch/close-on-generate-error/main.js000066400000000000000000000000231415504077600253420ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/cli/samples/watch/close-on-generate-error/rollup.config.js000066400000000000000000000002601415504077600272020ustar00rootroot00000000000000export default { input: 'main.js', plugins: [ { name: 'faulty-close', closeBundle() { console.error('Bundle closed') } } ], output: { format: "es" } }; rollup-2.61.1/test/cli/samples/watch/close-stdin/000077500000000000000000000000001415504077600216535ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/close-stdin/_config.js000066400000000000000000000002321415504077600236120ustar00rootroot00000000000000module.exports = { command: 'node wrapper.js main.js --watch --format es --file _actual/out.js', description: 'closes the watcher when stdin closes' }; rollup-2.61.1/test/cli/samples/watch/close-stdin/_expected/000077500000000000000000000000001415504077600236135ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/close-stdin/_expected/out.js000066400000000000000000000000541415504077600247570ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-2.61.1/test/cli/samples/watch/close-stdin/main.js000066400000000000000000000000231415504077600231300ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/cli/samples/watch/close-stdin/wrapper.js000077500000000000000000000013301415504077600236710ustar00rootroot00000000000000#!/usr/bin/env node const stream = require('stream'); const fs = require('fs'); const chokidar = require('chokidar'); const path = require('path'); delete process.stdin; process.stdin = new stream.Readable({ encoding: 'utf8', read() { return null; } }); const outputDir = path.resolve(__dirname, '_actual'); fs.mkdirSync(outputDir); const outputFile = path.resolve(outputDir, 'out.js'); const INITIAL_OUTPUT = 'NOT WRITTEN'; fs.writeFileSync(outputFile, INITIAL_OUTPUT); const watcher = chokidar.watch(outputFile).on('change', () => { if (fs.readFileSync(outputFile, 'utf8') !== INITIAL_OUTPUT) { watcher.close(); // This closes stdin process.stdin.push(null); } }); require('../../../../../dist/bin/rollup'); rollup-2.61.1/test/cli/samples/watch/no-clearScreen-command/000077500000000000000000000000001415504077600237035ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/no-clearScreen-command/_config.js000066400000000000000000000007451415504077600256530ustar00rootroot00000000000000const assert = require('assert'); const UNDERLINE = '\u001b[4m'; module.exports = { 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-2.61.1/test/cli/samples/watch/no-clearScreen-command/foo.js000066400000000000000000000000251415504077600250210ustar00rootroot00000000000000export var foo = 42; rollup-2.61.1/test/cli/samples/watch/no-clearScreen-command/main.js000066400000000000000000000000231415504077600251600ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/cli/samples/watch/no-clearScreen-command/wrapper.js000077500000000000000000000001721415504077600257240ustar00rootroot00000000000000#!/usr/bin/env node process.stdout.isTTY = true; process.stderr.isTTY = true; require('../../../../../dist/bin/rollup'); rollup-2.61.1/test/cli/samples/watch/no-clearScreen/000077500000000000000000000000001415504077600222675ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/no-clearScreen/_config.js000066400000000000000000000006161415504077600242340ustar00rootroot00000000000000const assert = require('assert'); const UNDERLINE = '\u001b[4m'; module.exports = { 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-2.61.1/test/cli/samples/watch/no-clearScreen/foo.js000066400000000000000000000000251415504077600234050ustar00rootroot00000000000000export var foo = 42; rollup-2.61.1/test/cli/samples/watch/no-clearScreen/main.js000066400000000000000000000000231415504077600235440ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/cli/samples/watch/no-clearScreen/rollup.config.js000066400000000000000000000004111415504077600254020ustar00rootroot00000000000000export 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-2.61.1/test/cli/samples/watch/no-clearScreen/wrapper.js000077500000000000000000000001721415504077600243100ustar00rootroot00000000000000#!/usr/bin/env node process.stdout.isTTY = true; process.stderr.isTTY = true; require('../../../../../dist/bin/rollup'); rollup-2.61.1/test/cli/samples/watch/no-config-file/000077500000000000000000000000001415504077600222235ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/no-config-file/_config.js000066400000000000000000000003541415504077600241670ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/cli/samples/watch/no-config-file/_expected/000077500000000000000000000000001415504077600241635ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/no-config-file/_expected/main.js000066400000000000000000000000411415504077600254400ustar00rootroot00000000000000const foo = 42; export { foo }; rollup-2.61.1/test/cli/samples/watch/no-config-file/main.js000066400000000000000000000000271415504077600235040ustar00rootroot00000000000000export const foo = 42; rollup-2.61.1/test/cli/samples/watch/no-watched-config/000077500000000000000000000000001415504077600227235ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/no-watched-config/_config.js000066400000000000000000000005401415504077600246640ustar00rootroot00000000000000const { assertIncludes } = require('../../../../utils.js'); module.exports = { description: 'throws if no config is watched', command: 'rollup -cw', error: () => true, stderr(stderr) { assertIncludes( stderr, '[!] Error: Invalid value for option "watch" - there must be at least one config where "watch" is not set to "false".' ); } }; rollup-2.61.1/test/cli/samples/watch/no-watched-config/main.js000066400000000000000000000000321415504077600242000ustar00rootroot00000000000000assert.equal( 1 + 1, 2 ); rollup-2.61.1/test/cli/samples/watch/no-watched-config/rollup.config.js000066400000000000000000000003271415504077600260440ustar00rootroot00000000000000export default [ { input: 'main.js', watch: false, output: { dir: '_actual/es', format: 'es' } }, { input: 'main.js', watch: false, output: { dir: '_actual/cjs', format: 'cjs' } } ]; rollup-2.61.1/test/cli/samples/watch/node-config-file/000077500000000000000000000000001415504077600225345ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/node-config-file/_config.js000066400000000000000000000003421415504077600244750ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/cli/samples/watch/node-config-file/_expected/000077500000000000000000000000001415504077600244745ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/node-config-file/_expected/main.js000066400000000000000000000000411415504077600257510ustar00rootroot00000000000000const foo = 42; export { foo }; rollup-2.61.1/test/cli/samples/watch/node-config-file/main.js000066400000000000000000000000271415504077600240150ustar00rootroot00000000000000export const foo = 42; rollup-2.61.1/test/cli/samples/watch/node-config-file/node_modules/000077500000000000000000000000001415504077600252115ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/node-config-file/node_modules/rollup-config-custom/000077500000000000000000000000001415504077600313015ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/node-config-file/node_modules/rollup-config-custom/index.js000066400000000000000000000001431415504077600327440ustar00rootroot00000000000000module.exports = { input: 'main.js', output: { file: '_actual/main.js', format: 'es', }, }; rollup-2.61.1/test/cli/samples/watch/node-config-file/node_modules/rollup-config-custom/package.json000066400000000000000000000001211415504077600335610ustar00rootroot00000000000000{ "name": "rollup-config-custom", "version": "1.0.0", "main": "index.js" } rollup-2.61.1/test/cli/samples/watch/watch-config-early-update/000077500000000000000000000000001415504077600243725ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/watch-config-early-update/_config.js000066400000000000000000000022361415504077600263370ustar00rootroot00000000000000const fs = require('fs'); const path = require('path'); let configFile; module.exports = { description: 'immediately reloads the config file if a change happens while it is parsed', command: 'rollup -cw', before() { fs.mkdirSync(path.resolve(__dirname, '_actual')); configFile = path.resolve(__dirname, 'rollup.config.js'); fs.writeFileSync( configFile, ` console.error('initial'); export default new Promise(resolve => { setTimeout( () => resolve({ input: { output1: 'main.js' }, output: { dir: '_actual', format: 'es' } }), 1000 ); }); ` ); }, after() { fs.unlinkSync(configFile); }, abortOnStderr(data) { if (data === 'initial\n') { fs.writeFileSync( configFile, ` console.error('updated'); export default { input: {output2: "main.js"}, output: { dir: "_actual", format: "es" } }; ` ); return false; } if (data === 'updated\n') { return new Promise(resolve => setTimeout(() => resolve(true), 500)); } } }; rollup-2.61.1/test/cli/samples/watch/watch-config-early-update/_expected/000077500000000000000000000000001415504077600263325ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/watch-config-early-update/_expected/output2.js000066400000000000000000000000411415504077600303050ustar00rootroot00000000000000const foo = 42; export { foo }; rollup-2.61.1/test/cli/samples/watch/watch-config-early-update/main.js000066400000000000000000000000271415504077600256530ustar00rootroot00000000000000export const foo = 42; rollup-2.61.1/test/cli/samples/watch/watch-config-error/000077500000000000000000000000001415504077600231275ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/watch-config-error/_config.js000066400000000000000000000023721415504077600250750ustar00rootroot00000000000000const fs = require('fs'); const path = require('path'); let configFile; module.exports = { 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.js'); fs.writeFileSync( configFile, 'export default {\n' + '\tinput: "main.js",\n' + '\toutput: {\n' + '\t\tfile: "_actual/main1.js",\n' + '\t\tformat: "es"\n' + '\t}\n' + '};' ); }, after() { // synchronous sometimes does not seem to work, probably because the watch is not yet removed properly setTimeout(() => fs.unlinkSync(configFile), 300); }, abortOnStderr(data) { if (data.includes(`created _actual${path.sep}main1.js`)) { fs.writeFileSync(configFile, 'throw new Error("Config contains errors");'); return false; } if (data.includes('Config contains errors')) { setTimeout(() => { fs.writeFileSync( configFile, 'export default {\n' + '\tinput: "main.js",\n' + '\toutput: {\n' + '\t\tfile: "_actual/main2.js",\n' + '\t\tformat: "es"\n' + '\t}\n' + '};' ); }, 400); return false; } if (data.includes(`created _actual${path.sep}main2.js`)) { return true; } } }; rollup-2.61.1/test/cli/samples/watch/watch-config-error/_expected/000077500000000000000000000000001415504077600250675ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/watch-config-error/_expected/main1.js000066400000000000000000000000411415504077600264250ustar00rootroot00000000000000const foo = 42; export { foo }; rollup-2.61.1/test/cli/samples/watch/watch-config-error/_expected/main2.js000066400000000000000000000000411415504077600264260ustar00rootroot00000000000000const foo = 42; export { foo }; rollup-2.61.1/test/cli/samples/watch/watch-config-error/main.js000066400000000000000000000000271415504077600244100ustar00rootroot00000000000000export const foo = 42; rollup-2.61.1/test/cli/samples/watch/watch-config-initial-error/000077500000000000000000000000001415504077600245565ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/watch-config-initial-error/_config.js000066400000000000000000000015251415504077600265230ustar00rootroot00000000000000const fs = require('fs'); const path = require('path'); let configFile; module.exports = { description: 'keeps watching the config file in case the initial file contains an error', command: 'rollup -cw', before() { configFile = path.join(__dirname, 'rollup.config.js'); fs.writeFileSync(configFile, 'throw new Error("Config contains initial errors");'); }, after() { fs.unlinkSync(configFile); }, async abortOnStderr(data) { if (data.includes('Config contains initial errors')) { await new Promise(resolve => setTimeout(resolve, 100)); fs.writeFileSync( 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-2.61.1/test/cli/samples/watch/watch-config-initial-error/_expected/000077500000000000000000000000001415504077600265165ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/watch-config-initial-error/_expected/main.js000066400000000000000000000000411415504077600277730ustar00rootroot00000000000000const foo = 42; export { foo }; rollup-2.61.1/test/cli/samples/watch/watch-config-initial-error/main.js000066400000000000000000000000271415504077600260370ustar00rootroot00000000000000export const foo = 42; rollup-2.61.1/test/cli/samples/watch/watch-config-no-update/000077500000000000000000000000001415504077600236725ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/watch-config-no-update/_config.js000066400000000000000000000017451415504077600256430ustar00rootroot00000000000000const fs = require('fs'); const path = require('path'); 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 = { description: 'does not rebuild if the config file is updated without change', command: 'rollup -cw', before() { configFile = path.resolve(__dirname, 'rollup.config.js'); fs.writeFileSync(configFile, configContent); }, after() { fs.unlinkSync(configFile); }, abortOnStderr(data) { if (data.includes('created _actual/main.js')) { fs.writeFileSync(configFile, configContent); return new Promise(resolve => setTimeout(() => resolve(true), 500)); } }, 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-2.61.1/test/cli/samples/watch/watch-config-no-update/_expected/000077500000000000000000000000001415504077600256325ustar00rootroot00000000000000rollup-2.61.1/test/cli/samples/watch/watch-config-no-update/_expected/main.js000066400000000000000000000000411415504077600271070ustar00rootroot00000000000000const foo = 42; export { foo }; rollup-2.61.1/test/cli/samples/watch/watch-config-no-update/main.js000066400000000000000000000000271415504077600251530ustar00rootroot00000000000000export const foo = 42; rollup-2.61.1/test/file-hashes/000077500000000000000000000000001415504077600162765ustar00rootroot00000000000000rollup-2.61.1/test/file-hashes/index.js000066400000000000000000000034561415504077600177530ustar00rootroot00000000000000const path = require('path'); const rollup = require('../../dist/rollup'); const { runTestSuiteWithSamples } = require('../utils.js'); runTestSuiteWithSamples('file hashes', path.resolve(__dirname, 'samples'), (dir, config) => { (config.skip ? describe.skip : config.solo ? describe.only : describe)( path.basename(dir) + ': ' + config.description, () => { it(`generates correct hashes`, () => { process.chdir(dir); 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: ${Array.from( contents ) .map(JSON.stringify) .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-2.61.1/test/file-hashes/samples/000077500000000000000000000000001415504077600177425ustar00rootroot00000000000000rollup-2.61.1/test/file-hashes/samples/augment-chunk-hash/000077500000000000000000000000001415504077600234315ustar00rootroot00000000000000rollup-2.61.1/test/file-hashes/samples/augment-chunk-hash/_config.js000066400000000000000000000016441415504077600254000ustar00rootroot00000000000000const augment1 = '/*foo*/'; const augment2 = '/*bar*/'; module.exports = { 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-2.61.1/test/file-hashes/samples/augment-chunk-hash/main.js000066400000000000000000000000251415504077600247100ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/file-hashes/samples/banner/000077500000000000000000000000001415504077600212075ustar00rootroot00000000000000rollup-2.61.1/test/file-hashes/samples/banner/_config.js000066400000000000000000000003631415504077600231530ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/file-hashes/samples/banner/main.js000066400000000000000000000000251415504077600224660ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/file-hashes/samples/chunk-name/000077500000000000000000000000001415504077600217705ustar00rootroot00000000000000rollup-2.61.1/test/file-hashes/samples/chunk-name/_config.js000066400000000000000000000005131415504077600237310ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/file-hashes/samples/chunk-name/main.js000066400000000000000000000000471415504077600232530ustar00rootroot00000000000000import './main2'; console.log('main'); rollup-2.61.1/test/file-hashes/samples/chunk-name/main2.js000066400000000000000000000000261415504077600233320ustar00rootroot00000000000000console.log('main2'); rollup-2.61.1/test/file-hashes/samples/content/000077500000000000000000000000001415504077600214145ustar00rootroot00000000000000rollup-2.61.1/test/file-hashes/samples/content/_config.js000066400000000000000000000003101415504077600233500ustar00rootroot00000000000000module.exports = { description: 'creates different hashes if the content differs', options1: { input: { main: 'main1', dep: 'dep1' } }, options2: { input: { main: 'main2', dep: 'dep2' } } }; rollup-2.61.1/test/file-hashes/samples/content/dep1.js000066400000000000000000000000241415504077600225770ustar00rootroot00000000000000console.log('dep'); rollup-2.61.1/test/file-hashes/samples/content/dep2.js000066400000000000000000000000241415504077600226000ustar00rootroot00000000000000console.log('dep'); rollup-2.61.1/test/file-hashes/samples/content/main1.js000066400000000000000000000000501415504077600227520ustar00rootroot00000000000000import './dep1'; console.log('main1'); rollup-2.61.1/test/file-hashes/samples/content/main2.js000066400000000000000000000000501415504077600227530ustar00rootroot00000000000000import './dep2'; console.log('main2'); rollup-2.61.1/test/file-hashes/samples/dependency-content/000077500000000000000000000000001415504077600235305ustar00rootroot00000000000000rollup-2.61.1/test/file-hashes/samples/dependency-content/_config.js000066400000000000000000000003301415504077600254660ustar00rootroot00000000000000module.exports = { description: 'creates different hashes if the content of dependencies differs', options1: { input: { main: 'main1', dep: 'dep1' } }, options2: { input: { main: 'main2', dep: 'dep2' } } }; rollup-2.61.1/test/file-hashes/samples/dependency-content/dep1.js000066400000000000000000000000251415504077600247140ustar00rootroot00000000000000console.log('dep1'); rollup-2.61.1/test/file-hashes/samples/dependency-content/dep2.js000066400000000000000000000000251415504077600247150ustar00rootroot00000000000000console.log('dep2'); rollup-2.61.1/test/file-hashes/samples/dependency-content/main1.js000066400000000000000000000000471415504077600250740ustar00rootroot00000000000000import './dep1'; console.log('main'); rollup-2.61.1/test/file-hashes/samples/dependency-content/main2.js000066400000000000000000000000471415504077600250750ustar00rootroot00000000000000import './dep2'; console.log('main'); rollup-2.61.1/test/file-hashes/samples/export-order-2/000077500000000000000000000000001415504077600225335ustar00rootroot00000000000000rollup-2.61.1/test/file-hashes/samples/export-order-2/_config.js000066400000000000000000000003151415504077600244740ustar00rootroot00000000000000module.exports = { description: 'creates different hashes if different variables are exported under the same name', options1: { input: ['main1', 'dep'] }, options2: { input: ['main2', 'dep'] } }; rollup-2.61.1/test/file-hashes/samples/export-order-2/dep.js000066400000000000000000000000241415504077600236350ustar00rootroot00000000000000export const a = 3; rollup-2.61.1/test/file-hashes/samples/export-order-2/main1.js000066400000000000000000000001241415504077600240730ustar00rootroot00000000000000import { a as b } from './dep.js'; const a = 1; console.log(a, b); export { a }; rollup-2.61.1/test/file-hashes/samples/export-order-2/main2.js000066400000000000000000000001311415504077600240720ustar00rootroot00000000000000import { a as b } from './dep.js'; const a = 1; console.log(a, b); export { b as a }; rollup-2.61.1/test/file-hashes/samples/export-order/000077500000000000000000000000001415504077600223745ustar00rootroot00000000000000rollup-2.61.1/test/file-hashes/samples/export-order/_config.js000066400000000000000000000002771415504077600243440ustar00rootroot00000000000000module.exports = { description: 'creates different hashes if different variables are exported under the same name', options1: { input: ['main1'] }, options2: { input: ['main2'] } }; rollup-2.61.1/test/file-hashes/samples/export-order/main1.js000066400000000000000000000000751415504077600237410ustar00rootroot00000000000000const a = 1; const b = 2; console.log(a, b); export { a }; rollup-2.61.1/test/file-hashes/samples/export-order/main2.js000066400000000000000000000001021415504077600237310ustar00rootroot00000000000000const a = 1; const b = 2; console.log(a, b); export { b as a }; rollup-2.61.1/test/file-hashes/samples/exports/000077500000000000000000000000001415504077600214465ustar00rootroot00000000000000rollup-2.61.1/test/file-hashes/samples/exports/_config.js000066400000000000000000000002711415504077600234100ustar00rootroot00000000000000module.exports = { description: 'creates different hashes if the generated exports differ', options1: { input: ['main1', 'other'] }, options2: { input: ['main2', 'other'] } }; rollup-2.61.1/test/file-hashes/samples/exports/dep.js000066400000000000000000000001071415504077600225520ustar00rootroot00000000000000export const mightNotBeImported = 42; console.log(mightNotBeImported); rollup-2.61.1/test/file-hashes/samples/exports/main1.js000066400000000000000000000001251415504077600230070ustar00rootroot00000000000000import {mightNotBeImported} from './dep'; console.log('main1', mightNotBeImported); rollup-2.61.1/test/file-hashes/samples/exports/main2.js000066400000000000000000000000471415504077600230130ustar00rootroot00000000000000import './dep'; console.log('main2'); rollup-2.61.1/test/file-hashes/samples/exports/other.js000066400000000000000000000000471415504077600231260ustar00rootroot00000000000000import './dep'; console.log('other'); rollup-2.61.1/test/file-hashes/samples/external-dependency-names/000077500000000000000000000000001415504077600250015ustar00rootroot00000000000000rollup-2.61.1/test/file-hashes/samples/external-dependency-names/_config.js000066400000000000000000000004701415504077600267440ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/file-hashes/samples/external-dependency-names/main1a.js000066400000000000000000000000511415504077600265010ustar00rootroot00000000000000import 'external'; console.log('main'); rollup-2.61.1/test/file-hashes/samples/external-dependency-names/main1b.js000066400000000000000000000000521415504077600265030ustar00rootroot00000000000000import 'external1'; console.log('main'); rollup-2.61.1/test/file-hashes/samples/external-dependency-names/main2a.js000066400000000000000000000000511415504077600265020ustar00rootroot00000000000000import 'external'; console.log('main'); rollup-2.61.1/test/file-hashes/samples/external-dependency-names/main2b.js000066400000000000000000000000521415504077600265040ustar00rootroot00000000000000import 'external2'; console.log('main'); rollup-2.61.1/test/file-hashes/samples/footer/000077500000000000000000000000001415504077600212405ustar00rootroot00000000000000rollup-2.61.1/test/file-hashes/samples/footer/_config.js000066400000000000000000000003631415504077600232040ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/file-hashes/samples/footer/main.js000066400000000000000000000000251415504077600225170ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/file-hashes/samples/format/000077500000000000000000000000001415504077600212325ustar00rootroot00000000000000rollup-2.61.1/test/file-hashes/samples/format/_config.js000066400000000000000000000003321415504077600231720ustar00rootroot00000000000000module.exports = { description: 'creates different hashes if the format differs', options1: { input: 'main', output: { format: 'es' } }, options2: { input: 'main', output: { format: 'cjs' } } }; rollup-2.61.1/test/file-hashes/samples/format/main.js000066400000000000000000000000241415504077600225100ustar00rootroot00000000000000export const x = 1; rollup-2.61.1/test/file-hashes/samples/internal-exports/000077500000000000000000000000001415504077600232605ustar00rootroot00000000000000rollup-2.61.1/test/file-hashes/samples/internal-exports/_config.js000066400000000000000000000002761415504077600252270ustar00rootroot00000000000000module.exports = { description: 'creates different hashes if generated internal exports differ', options1: { input: ['main1', 'other'] }, options2: { input: ['main2', 'other'] } }; rollup-2.61.1/test/file-hashes/samples/internal-exports/dep.js000066400000000000000000000000501415504077600243610ustar00rootroot00000000000000export const a = 1; export const b = 2; rollup-2.61.1/test/file-hashes/samples/internal-exports/main1.js000066400000000000000000000000571415504077600246250ustar00rootroot00000000000000import { b } from './dep.js'; console.log(b); rollup-2.61.1/test/file-hashes/samples/internal-exports/main2.js000066400000000000000000000000571415504077600246260ustar00rootroot00000000000000import { a } from './dep.js'; console.log(a); rollup-2.61.1/test/file-hashes/samples/internal-exports/other.js000066400000000000000000000000651415504077600247400ustar00rootroot00000000000000import { a, b } from './dep.js'; console.log(a, b); rollup-2.61.1/test/file-hashes/samples/intro/000077500000000000000000000000001415504077600210755ustar00rootroot00000000000000rollup-2.61.1/test/file-hashes/samples/intro/_config.js000066400000000000000000000003601415504077600230360ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/file-hashes/samples/intro/main.js000066400000000000000000000000251415504077600223540ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/file-hashes/samples/name-pattern/000077500000000000000000000000001415504077600223355ustar00rootroot00000000000000rollup-2.61.1/test/file-hashes/samples/name-pattern/_config.js000066400000000000000000000004051415504077600242760ustar00rootroot00000000000000module.exports = { description: 'creates different hashes if the name pattern differs', options1: { input: 'main', output: { chunkFileNames: '[hash]-[name]' } }, options2: { input: 'main', output: { chunkFileNames: '[name]-[hash]' } } }; rollup-2.61.1/test/file-hashes/samples/name-pattern/dep.js000066400000000000000000000000311415504077600234350ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/file-hashes/samples/name-pattern/main.js000066400000000000000000000000711415504077600236150ustar00rootroot00000000000000import('./dep').then(({ value }) => console.log(value)); rollup-2.61.1/test/file-hashes/samples/outro/000077500000000000000000000000001415504077600211125ustar00rootroot00000000000000rollup-2.61.1/test/file-hashes/samples/outro/_config.js000066400000000000000000000003601415504077600230530ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/file-hashes/samples/outro/main.js000066400000000000000000000000251415504077600223710ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/form/000077500000000000000000000000001415504077600150515ustar00rootroot00000000000000rollup-2.61.1/test/form/index.js000066400000000000000000000063651415504077600165300ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const sander = require('sander'); const rollup = require('../../dist/rollup'); const { normaliseOutput, runTestSuiteWithSamples } = require('../utils.js'); const FORMATS = ['amd', 'cjs', 'system', 'es', 'iife', 'umd']; runTestSuiteWithSamples('form', path.resolve(__dirname, 'samples'), (dir, config) => { const isSingleFormatTest = sander.existsSync(dir + '/_expected.js'); const itOrDescribe = isSingleFormatTest ? it : describe; (config.skip ? itOrDescribe.skip : config.solo ? itOrDescribe.only : itOrDescribe)( path.basename(dir) + ': ' + config.description, () => { let bundle; const runRollupTest = async (inputFile, bundleFile, defaultFormat) => { const warnings = []; if (config.before) config.before(); try { process.chdir(dir); bundle = bundle || (await rollup.rollup({ input: dir + '/main.js', onwarn: warning => { if ( !(config.expectedWarnings && config.expectedWarnings.indexOf(warning.code) >= 0) ) { warnings.push(warning); } }, strictDeprecations: true, ...(config.options || {}) })); await generateAndTestBundle( bundle, { exports: 'auto', file: inputFile, format: defaultFormat, validate: true, ...((config.options || {}).output || {}) }, bundleFile, config ); } finally { if (config.after) 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(dir + '/_actual.js', dir + '/_expected.js', 'es'); } (config.formats || FORMATS).forEach(format => it('generates ' + format, () => runRollupTest( dir + '/_actual/' + format + '.js', dir + '/_expected/' + format + '.js', format ) ) ); } ); }); async function generateAndTestBundle(bundle, outputOptions, expectedFile, { show }) { await bundle.write(outputOptions); const actualCode = normaliseOutput(sander.readFileSync(outputOptions.file)); let expectedCode; let actualMap; let expectedMap; try { expectedCode = normaliseOutput(sander.readFileSync(expectedFile)); } catch (err) { expectedCode = 'missing file'; } try { actualMap = JSON.parse(sander.readFileSync(outputOptions.file + '.map').toString()); actualMap.sourcesContent = actualMap.sourcesContent ? actualMap.sourcesContent.map(normaliseOutput) : null; } catch (err) { assert.strictEqual(err.code, 'ENOENT'); } try { expectedMap = JSON.parse(sander.readFileSync(expectedFile + '.map').toString()); expectedMap.sourcesContent = actualMap.sourcesContent ? expectedMap.sourcesContent.map(normaliseOutput) : null; } catch (err) { assert.equal(err.code, 'ENOENT'); } if (show) { console.log(actualCode + '\n\n\n'); } assert.strictEqual(actualCode, expectedCode); assert.deepStrictEqual(actualMap, expectedMap); } rollup-2.61.1/test/form/samples/000077500000000000000000000000001415504077600165155ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/absolute-path-resolver/000077500000000000000000000000001415504077600231245ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/absolute-path-resolver/_config.js000066400000000000000000000004431415504077600250670ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'normalizes absolute ids', options: { plugins: [ { transform(code, id) { if (/main/.test(id)) { return code.replace('"./a.js"', JSON.stringify(path.resolve(__dirname, 'a.js'))); } } } ] } }; rollup-2.61.1/test/form/samples/absolute-path-resolver/_expected.js000066400000000000000000000000701415504077600254170ustar00rootroot00000000000000var a = () => { console.log('props'); }; a(); a(); rollup-2.61.1/test/form/samples/absolute-path-resolver/a.js000066400000000000000000000000631415504077600237010ustar00rootroot00000000000000export var a = () => { console.log('props'); };rollup-2.61.1/test/form/samples/absolute-path-resolver/main.js000066400000000000000000000001071415504077600244040ustar00rootroot00000000000000import { a } from "./a.js"; import { a as b } from "./a.js"; a(); b(); rollup-2.61.1/test/form/samples/acorn-external-plugins/000077500000000000000000000000001415504077600231165ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/acorn-external-plugins/_config.js000066400000000000000000000003001415504077600250510ustar00rootroot00000000000000const jsx = require('acorn-jsx'); module.exports = { description: 'supports official acorn plugins that may rely on a shared acorn instance', options: { acornInjectPlugins: [jsx()] } }; rollup-2.61.1/test/form/samples/acorn-external-plugins/_expected.js000066400000000000000000000001131415504077600254070ustar00rootroot00000000000000var main =
This is not JavaScript
; export { main as default }; rollup-2.61.1/test/form/samples/acorn-external-plugins/main.js000066400000000000000000000000621415504077600243760ustar00rootroot00000000000000export default
This is not JavaScript
; rollup-2.61.1/test/form/samples/amd-id-auto/000077500000000000000000000000001415504077600206165ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/amd-id-auto/_config.js000066400000000000000000000001601415504077600225550ustar00rootroot00000000000000module.exports = { description: 'allows to use amd.autoId', options: { output: { amd: { autoId: true } } } }; rollup-2.61.1/test/form/samples/amd-id-auto/_expected/000077500000000000000000000000001415504077600225565ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/amd-id-auto/_expected/amd.js000066400000000000000000000001041415504077600236500ustar00rootroot00000000000000define('amd', (function () { 'use strict'; console.log(42); })); rollup-2.61.1/test/form/samples/amd-id-auto/_expected/cjs.js000066400000000000000000000000401415504077600236650ustar00rootroot00000000000000'use strict'; console.log(42); rollup-2.61.1/test/form/samples/amd-id-auto/_expected/es.js000066400000000000000000000000211415504077600235140ustar00rootroot00000000000000console.log(42); rollup-2.61.1/test/form/samples/amd-id-auto/_expected/iife.js000066400000000000000000000000701415504077600240250ustar00rootroot00000000000000(function () { 'use strict'; console.log(42); })(); rollup-2.61.1/test/form/samples/amd-id-auto/_expected/system.js000066400000000000000000000001721415504077600244400ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log(42); }) }; })); rollup-2.61.1/test/form/samples/amd-id-auto/_expected/umd.js000066400000000000000000000002421415504077600236770ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define('umd', factory) : factory(); })((function () { 'use strict'; console.log(42); })); rollup-2.61.1/test/form/samples/amd-id-auto/main.js000066400000000000000000000000211415504077600220710ustar00rootroot00000000000000console.log(42); rollup-2.61.1/test/form/samples/amd-id/000077500000000000000000000000001415504077600176505ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/amd-id/_config.js000066400000000000000000000001621415504077600216110ustar00rootroot00000000000000module.exports = { description: 'allows to declare an AMD id', options: { output: { amd: { id: 'my-id' } } } }; rollup-2.61.1/test/form/samples/amd-id/_expected/000077500000000000000000000000001415504077600216105ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/amd-id/_expected/amd.js000066400000000000000000000001061415504077600227040ustar00rootroot00000000000000define('my-id', (function () { 'use strict'; console.log(42); })); rollup-2.61.1/test/form/samples/amd-id/_expected/cjs.js000066400000000000000000000000401415504077600227170ustar00rootroot00000000000000'use strict'; console.log(42); rollup-2.61.1/test/form/samples/amd-id/_expected/es.js000066400000000000000000000000211415504077600225460ustar00rootroot00000000000000console.log(42); rollup-2.61.1/test/form/samples/amd-id/_expected/iife.js000066400000000000000000000000701415504077600230570ustar00rootroot00000000000000(function () { 'use strict'; console.log(42); })(); rollup-2.61.1/test/form/samples/amd-id/_expected/system.js000066400000000000000000000001721415504077600234720ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log(42); }) }; })); rollup-2.61.1/test/form/samples/amd-id/_expected/umd.js000066400000000000000000000002441415504077600227330ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define('my-id', factory) : factory(); })((function () { 'use strict'; console.log(42); })); rollup-2.61.1/test/form/samples/amd-id/main.js000066400000000000000000000000211415504077600211230ustar00rootroot00000000000000console.log(42); rollup-2.61.1/test/form/samples/array-element-tracking/000077500000000000000000000000001415504077600230625ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/array-element-tracking/array-elements/000077500000000000000000000000001415504077600260125ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/array-element-tracking/array-elements/_config.js000066400000000000000000000001001415504077600277430ustar00rootroot00000000000000module.exports = { description: 'tracks elements of arrays' }; rollup-2.61.1/test/form/samples/array-element-tracking/array-elements/_expected.js000066400000000000000000000001441415504077600303070ustar00rootroot00000000000000console.log('retained'); console.log('retained'); console.log('retained'); console.log('retained'); rollup-2.61.1/test/form/samples/array-element-tracking/array-elements/main.js000066400000000000000000000004671415504077600273030ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/array-element-tracking/array-mutation/000077500000000000000000000000001415504077600260365ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/array-element-tracking/array-mutation/_config.js000066400000000000000000000001111415504077600277710ustar00rootroot00000000000000module.exports = { description: 'tracks mutations of array elements' }; rollup-2.61.1/test/form/samples/array-element-tracking/array-mutation/_expected.js000066400000000000000000000003521415504077600303340ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/array-element-tracking/array-mutation/main.js000066400000000000000000000004251415504077600273210ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/array-element-tracking/array-spread/000077500000000000000000000000001415504077600254545ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/array-element-tracking/array-spread/_config.js000066400000000000000000000001251415504077600274140ustar00rootroot00000000000000module.exports = { description: 'tracks elements of arrays with spread elements' }; rollup-2.61.1/test/form/samples/array-element-tracking/array-spread/_expected.js000066400000000000000000000004111415504077600277460ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/array-element-tracking/array-spread/main.js000066400000000000000000000005371415504077600267430ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/array-element-tracking/spread-element-deoptimization/000077500000000000000000000000001415504077600310245ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/array-element-tracking/spread-element-deoptimization/_config.js000066400000000000000000000001101415504077600327560ustar00rootroot00000000000000module.exports = { description: 'deoptimizes array spread elements' }; rollup-2.61.1/test/form/samples/array-element-tracking/spread-element-deoptimization/_expected.js000066400000000000000000000001531415504077600333210ustar00rootroot00000000000000const spread = [{ effect() {} }]; [...spread][0].effect = () => console.log('effect'); spread[0].effect(); rollup-2.61.1/test/form/samples/array-element-tracking/spread-element-deoptimization/main.js000066400000000000000000000001531415504077600323050ustar00rootroot00000000000000const spread = [{ effect() {} }]; [...spread][0].effect = () => console.log('effect'); spread[0].effect(); rollup-2.61.1/test/form/samples/arrow-function-call-parameters/000077500000000000000000000000001415504077600245445ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/arrow-function-call-parameters/_config.js000066400000000000000000000002061415504077600265040ustar00rootroot00000000000000module.exports = { description: 'take actual parameters into account when determining side-effects of calls to arrow functions' }; rollup-2.61.1/test/form/samples/arrow-function-call-parameters/_expected.js000066400000000000000000000015351415504077600270460ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/arrow-function-call-parameters/main.js000066400000000000000000000015351415504077600260320ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/arrow-function-return-values/000077500000000000000000000000001415504077600243045ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/arrow-function-return-values/_config.js000066400000000000000000000001201415504077600262370ustar00rootroot00000000000000module.exports = { description: 'forwards return values of arrow functions' }; rollup-2.61.1/test/form/samples/arrow-function-return-values/_expected.js000066400000000000000000000005501415504077600266020ustar00rootroot00000000000000(() => () => 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-2.61.1/test/form/samples/arrow-function-return-values/main.js000066400000000000000000000011531415504077600255660ustar00rootroot00000000000000(() => () => {})()(); (() => () => 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-2.61.1/test/form/samples/assignment-to-array-buffer-view/000077500000000000000000000000001415504077600246405ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/assignment-to-array-buffer-view/_config.js000066400000000000000000000001761415504077600266060ustar00rootroot00000000000000module.exports = { description: 'assignment to views of buffers should be kept', options: { output: { name: 'bundle' } } }; rollup-2.61.1/test/form/samples/assignment-to-array-buffer-view/_expected/000077500000000000000000000000001415504077600266005ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/assignment-to-array-buffer-view/_expected/amd.js000066400000000000000000000004371415504077600277030ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/assignment-to-array-buffer-view/_expected/cjs.js000066400000000000000000000003511415504077600277140ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var buffer = new ArrayBuffer( 8 ); var view8 = new Int8Array( buffer ); var view16 = new Int16Array( buffer ); view16[ 0 ] = 3; exports.view8 = view8; rollup-2.61.1/test/form/samples/assignment-to-array-buffer-view/_expected/es.js000066400000000000000000000002251415504077600275440ustar00rootroot00000000000000var buffer = new ArrayBuffer( 8 ); var view8 = new Int8Array( buffer ); var view16 = new Int16Array( buffer ); view16[ 0 ] = 3; export { view8 }; rollup-2.61.1/test/form/samples/assignment-to-array-buffer-view/_expected/iife.js000066400000000000000000000004561415504077600300570ustar00rootroot00000000000000var 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; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/assignment-to-array-buffer-view/_expected/system.js000066400000000000000000000004271415504077600304650ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/assignment-to-array-buffer-view/_expected/umd.js000066400000000000000000000010741415504077600277250ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/assignment-to-array-buffer-view/main.js000066400000000000000000000002251415504077600261210ustar00rootroot00000000000000var buffer = new ArrayBuffer( 8 ); var view8 = new Int8Array( buffer ); var view16 = new Int16Array( buffer ); view16[ 0 ] = 3; export { view8 }; rollup-2.61.1/test/form/samples/assignment-to-exports-class-declaration/000077500000000000000000000000001415504077600263755ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/assignment-to-exports-class-declaration/_config.js000066400000000000000000000001701415504077600303350ustar00rootroot00000000000000module.exports = { description: 'does not rewrite class expression IDs', options: { output: { name: 'myModule' } } }; rollup-2.61.1/test/form/samples/assignment-to-exports-class-declaration/_expected/000077500000000000000000000000001415504077600303355ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/assignment-to-exports-class-declaration/_expected/amd.js000066400000000000000000000003001415504077600314250ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; exports.Foo = class Foo {}; exports.Foo = lol( exports.Foo ); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/assignment-to-exports-class-declaration/_expected/cjs.js000066400000000000000000000002151415504077600314500ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); exports.Foo = class Foo {}; exports.Foo = lol( exports.Foo ); rollup-2.61.1/test/form/samples/assignment-to-exports-class-declaration/_expected/es.js000066400000000000000000000000731415504077600313020ustar00rootroot00000000000000let Foo = class Foo {}; Foo = lol( Foo ); export { Foo }; rollup-2.61.1/test/form/samples/assignment-to-exports-class-declaration/_expected/iife.js000066400000000000000000000003211415504077600316030ustar00rootroot00000000000000var myModule = (function (exports) { 'use strict'; exports.Foo = class Foo {}; exports.Foo = lol( exports.Foo ); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/assignment-to-exports-class-declaration/_expected/system.js000066400000000000000000000003111415504077600322120ustar00rootroot00000000000000System.register('myModule', [], (function (exports) { 'use strict'; return { execute: (function () { let Foo = exports('Foo', class Foo {}); exports('Foo', Foo = lol( Foo )); }) }; })); rollup-2.61.1/test/form/samples/assignment-to-exports-class-declaration/_expected/umd.js000066400000000000000000000007371415504077600314670ustar00rootroot00000000000000(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 ); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/assignment-to-exports-class-declaration/main.js000066400000000000000000000000601415504077600276530ustar00rootroot00000000000000export let Foo = class Foo {} Foo = lol( Foo ); rollup-2.61.1/test/form/samples/assignment-to-exports/000077500000000000000000000000001415504077600230075ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/assignment-to-exports/_config.js000066400000000000000000000001761415504077600247550ustar00rootroot00000000000000module.exports = { description: 'declares updated variable in ES output (#755)', options: { output: { name: 'bundle' } } }; rollup-2.61.1/test/form/samples/assignment-to-exports/_expected/000077500000000000000000000000001415504077600247475ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/assignment-to-exports/_expected/amd.js000066400000000000000000000011731415504077600260500ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/assignment-to-exports/_expected/cjs.js000066400000000000000000000010671415504077600260700ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); // 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-2.61.1/test/form/samples/assignment-to-exports/_expected/es.js000066400000000000000000000006331415504077600257160ustar00rootroot00000000000000// 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-2.61.1/test/form/samples/assignment-to-exports/_expected/iife.js000066400000000000000000000012121415504077600262150ustar00rootroot00000000000000var 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; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/assignment-to-exports/_expected/system.js000066400000000000000000000013271415504077600266340ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/assignment-to-exports/_expected/umd.js000066400000000000000000000016301415504077600260720ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/assignment-to-exports/main.js000066400000000000000000000006361415504077600242760ustar00rootroot00000000000000// 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-2.61.1/test/form/samples/assignment-to-global/000077500000000000000000000000001415504077600225435ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/assignment-to-global/_config.js000066400000000000000000000001401415504077600245000ustar00rootroot00000000000000module.exports = { description: 'Assignments to global variables should be effects (#1587)' }; rollup-2.61.1/test/form/samples/assignment-to-global/_expected.js000066400000000000000000000000301415504077600250320ustar00rootroot00000000000000globalThis.unknown = 1; rollup-2.61.1/test/form/samples/assignment-to-global/main.js000066400000000000000000000000301415504077600240160ustar00rootroot00000000000000globalThis.unknown = 1; rollup-2.61.1/test/form/samples/async-function-effects/000077500000000000000000000000001415504077600230725ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/async-function-effects/_config.js000066400000000000000000000001151415504077600250310ustar00rootroot00000000000000module.exports = { description: 'tracks effects when awaiting thenables' }; rollup-2.61.1/test/form/samples/async-function-effects/_expected.js000066400000000000000000000024501415504077600253710ustar00rootroot00000000000000(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-2.61.1/test/form/samples/async-function-effects/main.js000066400000000000000000000030671415504077600243620ustar00rootroot00000000000000(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-2.61.1/test/form/samples/async-function-unused/000077500000000000000000000000001415504077600227565ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/async-function-unused/_config.js000066400000000000000000000001101415504077600247100ustar00rootroot00000000000000module.exports = { description: 'treeshakes async functions (#492)' }; rollup-2.61.1/test/form/samples/async-function-unused/_expected.js000066400000000000000000000001271415504077600252540ustar00rootroot00000000000000async function foo () { return 'foo'; } foo().then( value => console.log( value ) ); rollup-2.61.1/test/form/samples/async-function-unused/main.js000066400000000000000000000001201415504077600242310ustar00rootroot00000000000000import { foo } from './utils.js'; foo().then( value => console.log( value ) ); rollup-2.61.1/test/form/samples/async-function-unused/utils.js000066400000000000000000000001411415504077600244500ustar00rootroot00000000000000export async function foo () { return 'foo'; } export async function bar () { return 'bar'; } rollup-2.61.1/test/form/samples/automatic-semicolon-insertion-var/000077500000000000000000000000001415504077600252675ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/automatic-semicolon-insertion-var/_config.js000066400000000000000000000001131415504077600272240ustar00rootroot00000000000000module.exports = { description: 'Adds trailing semicolons for modules' }; rollup-2.61.1/test/form/samples/automatic-semicolon-insertion-var/_expected.js000066400000000000000000000000551415504077600275650ustar00rootroot00000000000000var c = 0; (()=>{ console.log(c); })(); rollup-2.61.1/test/form/samples/automatic-semicolon-insertion-var/c.js000066400000000000000000000000201415504077600260370ustar00rootroot00000000000000export default 0rollup-2.61.1/test/form/samples/automatic-semicolon-insertion-var/main.js000066400000000000000000000000661415504077600265530ustar00rootroot00000000000000import c from './c.js' ;(()=>{ console.log(c) })()rollup-2.61.1/test/form/samples/avoid-unnecessary-conditional-deopt/000077500000000000000000000000001415504077600255665ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/avoid-unnecessary-conditional-deopt/_config.js000066400000000000000000000001441415504077600275270ustar00rootroot00000000000000module.exports = { description: 'avoids unnecessary deoptimizations of conditional expressions' }; rollup-2.61.1/test/form/samples/avoid-unnecessary-conditional-deopt/_expected.js000066400000000000000000000006771415504077600300760ustar00rootroot00000000000000console.log('not modified'); let x2 = false; modifyX2(); const obj2 = {}; (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 = {}; (x4 && obj4).modified = true; if (obj4.modified) console.log('modified'); else console.log('not modified'); function modifyX4() { x4 = true; } rollup-2.61.1/test/form/samples/avoid-unnecessary-conditional-deopt/main.js000066400000000000000000000013651415504077600270550ustar00rootroot00000000000000let x1 = false; modifyX1(); const obj1 = {}; 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 = {}; (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 = {}; 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 = {}; (x4 && obj4).modified = true; if (obj4.modified) console.log('modified'); else console.log('not modified'); function modifyX4() { x4 = true; } rollup-2.61.1/test/form/samples/banner-and-footer/000077500000000000000000000000001415504077600220165ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/banner-and-footer/_config.js000066400000000000000000000010071415504077600237560ustar00rootroot00000000000000module.exports = { description: 'adds a banner/footer', options: { output: { banner: '/* this is a banner */', footer: () => Promise.resolve('/* this is a footer */') }, plugins: [ { banner: '/* first banner */', footer() { return '/* first footer */'; } }, { banner() { return '/* second banner */'; }, footer: '/* second footer */' }, { banner() { return Promise.resolve('/* 3rd banner */'); }, footer: '/* 3rd footer */' } ] } }; rollup-2.61.1/test/form/samples/banner-and-footer/_expected/000077500000000000000000000000001415504077600237565ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/banner-and-footer/_expected/amd.js000066400000000000000000000003501415504077600250530ustar00rootroot00000000000000/* 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-2.61.1/test/form/samples/banner-and-footer/_expected/cjs.js000066400000000000000000000003131415504077600250700ustar00rootroot00000000000000/* 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-2.61.1/test/form/samples/banner-and-footer/_expected/es.js000066400000000000000000000002741415504077600247260ustar00rootroot00000000000000/* 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-2.61.1/test/form/samples/banner-and-footer/_expected/iife.js000066400000000000000000000003431415504077600252300ustar00rootroot00000000000000/* 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-2.61.1/test/form/samples/banner-and-footer/_expected/system.js000066400000000000000000000004451415504077600256430ustar00rootroot00000000000000/* 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-2.61.1/test/form/samples/banner-and-footer/_expected/umd.js000066400000000000000000000005061415504077600251020ustar00rootroot00000000000000/* 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-2.61.1/test/form/samples/banner-and-footer/main.js000066400000000000000000000000361415504077600232770ustar00rootroot00000000000000console.log( 'hello world' ); rollup-2.61.1/test/form/samples/base64-deshadow/000077500000000000000000000000001415504077600213755ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/base64-deshadow/_config.js000066400000000000000000000001011415504077600233270ustar00rootroot00000000000000module.exports = { description: 'base64 deshadowing indices' }; rollup-2.61.1/test/form/samples/base64-deshadow/_expected.js000066400000000000000000000007101415504077600236710ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/base64-deshadow/dep1.js000066400000000000000000000000241415504077600225600ustar00rootroot00000000000000export var name = 5;rollup-2.61.1/test/form/samples/base64-deshadow/dep10.js000066400000000000000000000000241415504077600226400ustar00rootroot00000000000000export var name = 5;rollup-2.61.1/test/form/samples/base64-deshadow/dep11.js000066400000000000000000000000241415504077600226410ustar00rootroot00000000000000export var name = 5;rollup-2.61.1/test/form/samples/base64-deshadow/dep2.js000066400000000000000000000000241415504077600225610ustar00rootroot00000000000000export var name = 5;rollup-2.61.1/test/form/samples/base64-deshadow/dep3.js000066400000000000000000000000241415504077600225620ustar00rootroot00000000000000export var name = 5;rollup-2.61.1/test/form/samples/base64-deshadow/dep4.js000066400000000000000000000000241415504077600225630ustar00rootroot00000000000000export var name = 5;rollup-2.61.1/test/form/samples/base64-deshadow/dep5.js000066400000000000000000000000241415504077600225640ustar00rootroot00000000000000export var name = 5;rollup-2.61.1/test/form/samples/base64-deshadow/dep6.js000066400000000000000000000000241415504077600225650ustar00rootroot00000000000000export var name = 5;rollup-2.61.1/test/form/samples/base64-deshadow/dep7.js000066400000000000000000000000241415504077600225660ustar00rootroot00000000000000export var name = 5;rollup-2.61.1/test/form/samples/base64-deshadow/dep8.js000066400000000000000000000000241415504077600225670ustar00rootroot00000000000000export var name = 5;rollup-2.61.1/test/form/samples/base64-deshadow/dep9.js000066400000000000000000000000241415504077600225700ustar00rootroot00000000000000export var name = 5;rollup-2.61.1/test/form/samples/base64-deshadow/main.js000066400000000000000000000011721415504077600226600ustar00rootroot00000000000000import { 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-2.61.1/test/form/samples/big-int/000077500000000000000000000000001415504077600200465ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/big-int/_config.js000066400000000000000000000001251415504077600220060ustar00rootroot00000000000000module.exports = { description: 'supports bigint via acorn plugin', options: {} }; rollup-2.61.1/test/form/samples/big-int/_expected.js000066400000000000000000000003711415504077600223450ustar00rootroot00000000000000if (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-2.61.1/test/form/samples/big-int/main.js000066400000000000000000000003521415504077600213300ustar00rootroot00000000000000if (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-2.61.1/test/form/samples/binary-expressions/000077500000000000000000000000001415504077600223615ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/binary-expressions/_config.js000066400000000000000000000001151415504077600243200ustar00rootroot00000000000000module.exports = { description: 'handles binary expression side-effects' }; rollup-2.61.1/test/form/samples/binary-expressions/_expected.js000066400000000000000000000012351415504077600246600ustar00rootroot00000000000000if ((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-2.61.1/test/form/samples/binary-expressions/main.js000066400000000000000000000020111415504077600236350ustar00rootroot00000000000000if ((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-2.61.1/test/form/samples/block-comments/000077500000000000000000000000001415504077600214325ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/block-comments/_config.js000066400000000000000000000001131415504077600233670ustar00rootroot00000000000000module.exports = { description: 'block comments are printed correctly' }; rollup-2.61.1/test/form/samples/block-comments/_expected.js000066400000000000000000000004301415504077600237250ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/block-comments/foo.js000066400000000000000000000004261415504077600225550ustar00rootroot00000000000000export 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-2.61.1/test/form/samples/block-comments/main.js000066400000000000000000000000521415504077600227110ustar00rootroot00000000000000import foo from './foo'; alert( foo() ); rollup-2.61.1/test/form/samples/body-less-for-loops/000077500000000000000000000000001415504077600223345ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/body-less-for-loops/_config.js000066400000000000000000000001031415504077600242700ustar00rootroot00000000000000module.exports = { description: 'supports body-less for loops' }; rollup-2.61.1/test/form/samples/body-less-for-loops/_expected/000077500000000000000000000000001415504077600242745ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/body-less-for-loops/_expected/amd.js000066400000000000000000000005751415504077600254020ustar00rootroot00000000000000define((function () { 'use strict'; for ( 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-2.61.1/test/form/samples/body-less-for-loops/_expected/cjs.js000066400000000000000000000005301415504077600254070ustar00rootroot00000000000000'use strict'; for ( 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-2.61.1/test/form/samples/body-less-for-loops/_expected/es.js000066400000000000000000000005111415504077600252360ustar00rootroot00000000000000for ( 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-2.61.1/test/form/samples/body-less-for-loops/_expected/iife.js000066400000000000000000000005701415504077600255500ustar00rootroot00000000000000(function () { 'use strict'; for ( 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-2.61.1/test/form/samples/body-less-for-loops/_expected/system.js000066400000000000000000000007121415504077600261560ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { for ( 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-2.61.1/test/form/samples/body-less-for-loops/_expected/umd.js000066400000000000000000000007331415504077600254220ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; for ( 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-2.61.1/test/form/samples/body-less-for-loops/main.js000066400000000000000000000005111415504077600236130ustar00rootroot00000000000000for ( 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-2.61.1/test/form/samples/break-control-flow/000077500000000000000000000000001415504077600222245ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/break-control-flow/break-statement-labels-in-loops/000077500000000000000000000000001415504077600303105ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/break-control-flow/break-statement-labels-in-loops/_config.js000066400000000000000000000001321415504077600322460ustar00rootroot00000000000000module.exports = { description: 'handles breaking to loops inside labeled statements' }; rollup-2.61.1/test/form/samples/break-control-flow/break-statement-labels-in-loops/_expected.js000066400000000000000000000005461415504077600326130ustar00rootroot00000000000000while (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-2.61.1/test/form/samples/break-control-flow/break-statement-labels-in-loops/main.js000066400000000000000000000013011415504077600315650ustar00rootroot00000000000000while (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-2.61.1/test/form/samples/break-control-flow/break-statement-labels-switch/000077500000000000000000000000001415504077600300515ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/break-control-flow/break-statement-labels-switch/_config.js000066400000000000000000000001511415504077600320100ustar00rootroot00000000000000module.exports = { description: 'supports labels when breaking control flow from a switch statement' }; rollup-2.61.1/test/form/samples/break-control-flow/break-statement-labels-switch/_expected.js000066400000000000000000000017331415504077600323530ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/break-control-flow/break-statement-labels-switch/main.js000066400000000000000000000034631415504077600313410ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/break-control-flow/break-statement-labels/000077500000000000000000000000001415504077600265525ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/break-control-flow/break-statement-labels/_config.js000066400000000000000000000001211415504077600305060ustar00rootroot00000000000000module.exports = { description: 'supports labels when breaking control flow' }; rollup-2.61.1/test/form/samples/break-control-flow/break-statement-labels/_expected.js000066400000000000000000000013341415504077600310510ustar00rootroot00000000000000outer: { 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-2.61.1/test/form/samples/break-control-flow/break-statement-labels/main.js000066400000000000000000000022511415504077600300340ustar00rootroot00000000000000outer: { 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-2.61.1/test/form/samples/break-control-flow/break-statement-loops/000077500000000000000000000000001415504077600264445ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/break-control-flow/break-statement-loops/_config.js000066400000000000000000000001561415504077600304100ustar00rootroot00000000000000module.exports = { description: 'breaks control flow when a break statement is encountered inside a loop' }; rollup-2.61.1/test/form/samples/break-control-flow/break-statement-loops/_expected.js000066400000000000000000000012511415504077600307410ustar00rootroot00000000000000while (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-2.61.1/test/form/samples/break-control-flow/break-statement-loops/main.js000066400000000000000000000023711415504077600277310ustar00rootroot00000000000000while (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-2.61.1/test/form/samples/break-control-flow/caught-errors/000077500000000000000000000000001415504077600250115ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/break-control-flow/caught-errors/_config.js000066400000000000000000000002461415504077600267550ustar00rootroot00000000000000module.exports = { description: 'breaks control flow when an error is thrown inside a catch block', options: { treeshake: { tryCatchDeoptimization: false } } }; rollup-2.61.1/test/form/samples/break-control-flow/caught-errors/_expected.js000066400000000000000000000017101415504077600273060ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/break-control-flow/caught-errors/main.js000066400000000000000000000022611415504077600262740ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/break-control-flow/hoisted-declarations/000077500000000000000000000000001415504077600263315ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/break-control-flow/hoisted-declarations/_config.js000066400000000000000000000001401415504077600302660ustar00rootroot00000000000000module.exports = { description: 'includes hoisted declarations when control flow is broken' }; rollup-2.61.1/test/form/samples/break-control-flow/hoisted-declarations/_expected.js000066400000000000000000000003331415504077600306260ustar00rootroot00000000000000try { nested(); } catch {} function nested() { hoisted(); throw new Error(); function hoisted() { console.log('included'); } } hoisted(); throw new Error(); function hoisted() { console.log('included'); } rollup-2.61.1/test/form/samples/break-control-flow/hoisted-declarations/main.js000066400000000000000000000005011415504077600276070ustar00rootroot00000000000000try { 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-2.61.1/test/form/samples/break-control-flow/if-statement-breaks/000077500000000000000000000000001415504077600260715ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/break-control-flow/if-statement-breaks/_config.js000066400000000000000000000001151415504077600300300ustar00rootroot00000000000000module.exports = { description: 'handles conditionally broken execution' }; rollup-2.61.1/test/form/samples/break-control-flow/if-statement-breaks/_expected.js000066400000000000000000000026431415504077600303740ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/break-control-flow/if-statement-breaks/main.js000066400000000000000000000036411415504077600273570ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/break-control-flow/if-statement-errors/000077500000000000000000000000001415504077600261365ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/break-control-flow/if-statement-errors/_config.js000066400000000000000000000001121415504077600300720ustar00rootroot00000000000000module.exports = { description: 'handles conditionally thrown errors' }; rollup-2.61.1/test/form/samples/break-control-flow/if-statement-errors/_expected.js000066400000000000000000000002451415504077600304350ustar00rootroot00000000000000while (true) { if (globalThis.unknown) break; console.log('retained'); } while (true) { if (globalThis.unknown) ; else { break; } console.log('retained'); } rollup-2.61.1/test/form/samples/break-control-flow/if-statement-errors/main.js000066400000000000000000000003331415504077600274170ustar00rootroot00000000000000while (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-2.61.1/test/form/samples/break-control-flow/loop-errors/000077500000000000000000000000001415504077600245075ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/break-control-flow/loop-errors/_config.js000066400000000000000000000001471415504077600264530ustar00rootroot00000000000000module.exports = { description: 'does not break flow from inside loops that may not have executed' }; rollup-2.61.1/test/form/samples/break-control-flow/loop-errors/_expected.js000066400000000000000000000023721415504077600270110ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/break-control-flow/loop-errors/main.js000066400000000000000000000031731415504077600257750ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/break-control-flow/return-statements/000077500000000000000000000000001415504077600257305ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/break-control-flow/return-statements/_config.js000066400000000000000000000001411415504077600276660ustar00rootroot00000000000000module.exports = { description: 'breaks control flow when a return statement is encountered' }; rollup-2.61.1/test/form/samples/break-control-flow/return-statements/_expected.js000066400000000000000000000005441415504077600302310ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/break-control-flow/return-statements/main.js000066400000000000000000000013601415504077600272120ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/break-control-flow/switch-errors/000077500000000000000000000000001415504077600250375ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/break-control-flow/switch-errors/_config.js000066400000000000000000000001121415504077600267730ustar00rootroot00000000000000module.exports = { description: 'handles errors in switch statements' }; rollup-2.61.1/test/form/samples/break-control-flow/switch-errors/_expected.js000066400000000000000000000005621415504077600273400ustar00rootroot00000000000000switch (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-2.61.1/test/form/samples/break-control-flow/switch-errors/main.js000066400000000000000000000010461415504077600263220ustar00rootroot00000000000000switch (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-2.61.1/test/form/samples/break-control-flow/thrown-errors/000077500000000000000000000000001415504077600250575ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/break-control-flow/thrown-errors/_config.js000066400000000000000000000001221415504077600270140ustar00rootroot00000000000000module.exports = { description: 'breaks control flow when an error is thrown' }; rollup-2.61.1/test/form/samples/break-control-flow/thrown-errors/_expected.js000066400000000000000000000007541415504077600273630ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/break-control-flow/thrown-errors/main.js000066400000000000000000000013701415504077600263420ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/builtin-prototypes/000077500000000000000000000000001415504077600224115ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/builtin-prototypes/array-expression/000077500000000000000000000000001415504077600257245ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/builtin-prototypes/array-expression/_config.js000066400000000000000000000001211415504077600276600ustar00rootroot00000000000000module.exports = { description: 'Tree-shake known array prototype functions' }; rollup-2.61.1/test/form/samples/builtin-prototypes/array-expression/_expected.js000066400000000000000000000051241415504077600302240ustar00rootroot00000000000000[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].findIndex(() => console.log(1) || true); const _findIndexArray = [{ effect() {} }]; _findIndexArray.findIndex(element => (element.effect = () => console.log(1))); _findIndexArray[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-2.61.1/test/form/samples/builtin-prototypes/array-expression/main.js000066400000000000000000000112171415504077600272100ustar00rootroot00000000000000const 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 _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 _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 _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); // inherited const _hasOwnProperty = [1].hasOwnProperty('toString').valueOf(); const _isPrototypeOf = [1].isPrototypeOf([]).valueOf(); const _propertyIsEnumerable = [1].propertyIsEnumerable('toString').valueOf(); const _toLocaleString = [1].toLocaleString().trim(); const _toString = [1].toString().trim(); const _valueOf = [1].valueOf(); rollup-2.61.1/test/form/samples/builtin-prototypes/literal/000077500000000000000000000000001415504077600240455ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/builtin-prototypes/literal/_config.js000066400000000000000000000001231415504077600260030ustar00rootroot00000000000000module.exports = { description: 'Tree-shake known literal prototype functions' }; rollup-2.61.1/test/form/samples/builtin-prototypes/literal/_expected.js000066400000000000000000000006731415504077600263510ustar00rootroot00000000000000// retained true.valueOf().unknown.unknown(); true.valueOf()(); (1).valueOf().unknown.unknown(); (1).valueOf().unknown(); (1).valueOf()[globalThis.unknown](); (1).valueOf()(); 'ab'.charAt(1).unknown.unknown(); 'ab'.charAt(1)(); null.unknown; 'ab'.replace( '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-2.61.1/test/form/samples/builtin-prototypes/literal/main.js000066400000000000000000000061451415504077600253350ustar00rootroot00000000000000const boolean = true; const valueOf1 = boolean.valueOf(); const valueOf2 = true.valueOf(); const valueOf3 = true.valueOf().valueOf(); const valueOf4 = true.valueOf().valueOf().valueOf(); // retained true.valueOf().unknown.unknown(); true.valueOf()(); (1).valueOf().unknown.unknown(); (1).valueOf().unknown(); (1).valueOf()[globalThis.unknown](); (1).valueOf()(); 'ab'.charAt(1).unknown.unknown(); 'ab'.charAt(1)(); null.unknown; // number prototype const _toExponential = (1).toExponential( 2 ).trim(); const _toFixed = (1).toFixed( 2 ).trim(); const _toLocaleString = (1).toLocaleString().trim(); const _toPrecision = (1).toPrecision( 2 ).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(); const _numberToLocaleString = (1).toLocaleString().trim(); const _numberToString = (1).toString().trim(); // string prototype const _charAt = 'ab'.charAt( 1 ).trim(); const _charCodeAt = 'ab'.charCodeAt( 1 ).toExponential( 2 ); const _codePointAt = 'ab'.codePointAt( 1 ).toExponential( 2 ); const _concat = 'ab'.concat( 'c' ).trim(); const _includes = 'ab'.includes( 'a' ).valueOf(); const _endsWith = 'ab'.endsWith( 'a' ).valueOf(); const _indexOf = 'ab'.indexOf( 'a' ).toExponential( 2 ); const _lastIndexOf = 'ab'.lastIndexOf( 'a' ).toExponential( 2 ); const _localeCompare = 'ab'.localeCompare( 'a' ).toExponential( 2 ); const _match = 'ab'.match( /a/ ).valueOf(); const _normalize = 'ab'.normalize().trim(); const _padEnd = 'ab'.padEnd( 4, 'a' ).trim(); const _padStart = 'ab'.padStart( 4, 'a' ).trim(); const _repeat = 'ab'.repeat( 2 ).trim(); const _replace = 'ab'.replace( 'a', () => 'b' ).trim(); const _replaceEffect = 'ab'.replace( 'a', () => console.log( 1 ) || 'b' ); const _search = 'ab'.search( /a/ ).toExponential( 2 ); const _slice = 'ab'.slice( 0, 1 ).trim(); const _split = 'ab'.split( 'a' ); const _startsWith = 'ab'.startsWith( 'a' ).valueOf(); const _substr = 'ab'.substr( 0, 1 ).trim(); const _substring = 'ab'.substring( 0, 1 ).trim(); const _toLocaleLowerCase = 'ab'.toLocaleLowerCase().trim(); const _toLocaleUpperCase = 'ab'.toLocaleUpperCase().trim(); const _toLowerCase = 'ab'.toLowerCase().trim(); const _toUpperCase = 'ab'.toUpperCase().trim(); const _trim = 'ab'.trim().trim(); const _stringValueOf = 'ab'.valueOf().trim(); // inherited const _stringHasOwnProperty = 'ab'.hasOwnProperty( 'toString' ).valueOf(); const _stringIsPrototypeOf = 'ab'.isPrototypeOf( '' ).valueOf(); const _stringPropertyIsEnumerable = 'ab'.propertyIsEnumerable( 'toString' ).valueOf(); const _stringToLocaleString = 'ab'.toLocaleString().trim(); const _stringToString = 'ab'.toString().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-2.61.1/test/form/samples/builtin-prototypes/object-expression/000077500000000000000000000000001415504077600260545ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/builtin-prototypes/object-expression/_config.js000066400000000000000000000001671415504077600300220ustar00rootroot00000000000000module.exports = { description: 'Tree-shake known object prototype functions', expectedWarnings: ['EMPTY_BUNDLE'] }; rollup-2.61.1/test/form/samples/builtin-prototypes/object-expression/_expected.js000066400000000000000000000000011415504077600303410ustar00rootroot00000000000000 rollup-2.61.1/test/form/samples/builtin-prototypes/object-expression/main.js000066400000000000000000000010671415504077600273420ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/builtin-prototypes/side-effect-free-array-expression/000077500000000000000000000000001415504077600310175ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/builtin-prototypes/side-effect-free-array-expression/_config.js000066400000000000000000000001701415504077600327570ustar00rootroot00000000000000module.exports = { description: 'Tree-shakes side-effect-free array functions if only their return value is unused' }; rollup-2.61.1/test/form/samples/builtin-prototypes/side-effect-free-array-expression/_expected.js000066400000000000000000000012331415504077600333140ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/builtin-prototypes/side-effect-free-array-expression/main.js000066400000000000000000000017161415504077600323060ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/catch-parameter-shadowing/000077500000000000000000000000001415504077600235365ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/catch-parameter-shadowing/_config.js000066400000000000000000000002311415504077600254740ustar00rootroot00000000000000module.exports = { description: 'the parameter of a catch block should correctly shadow an import (#1391)', options: { output: { name: 'bundle' } } }; rollup-2.61.1/test/form/samples/catch-parameter-shadowing/_expected.js000066400000000000000000000002721415504077600260350ustar00rootroot00000000000000const e = 2.7182818284; function something () { try { console.log( e ); } catch ( e ) { // the catch identifier shadows the import console.error( e ); } } export { something }; rollup-2.61.1/test/form/samples/catch-parameter-shadowing/e.js000066400000000000000000000000371415504077600243200ustar00rootroot00000000000000export const e = 2.7182818284; rollup-2.61.1/test/form/samples/catch-parameter-shadowing/main.js000066400000000000000000000002531415504077600250200ustar00rootroot00000000000000import { e } from './e'; export function something () { try { console.log( e ); } catch ( e ) { // the catch identifier shadows the import console.error( e ); } } rollup-2.61.1/test/form/samples/chained-assignments/000077500000000000000000000000001415504077600224415ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/chained-assignments/_config.js000066400000000000000000000001051415504077600243770ustar00rootroot00000000000000module.exports = { description: 'treeshakes chained assignments' }; rollup-2.61.1/test/form/samples/chained-assignments/_expected.js000066400000000000000000000001561415504077600247410ustar00rootroot00000000000000let a, d; a = 1; d = 2; console.log(a, d); let e = 'first', f = 'second'; e += f += 'third'; console.log(e); rollup-2.61.1/test/form/samples/chained-assignments/main.js000066400000000000000000000001741415504077600237250ustar00rootroot00000000000000let 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-2.61.1/test/form/samples/circular-member-expression/000077500000000000000000000000001415504077600237635ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/circular-member-expression/_config.js000066400000000000000000000001011415504077600257150ustar00rootroot00000000000000module.exports = { description: 'circular member expression' }; rollup-2.61.1/test/form/samples/circular-member-expression/_expected/000077500000000000000000000000001415504077600257235ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/circular-member-expression/_expected/amd.js000066400000000000000000000002021415504077600270140ustar00rootroot00000000000000define((function () { 'use strict'; var foo = function() { foo.toString = null; }.toString(); console.log(foo); })); rollup-2.61.1/test/form/samples/circular-member-expression/_expected/cjs.js000066400000000000000000000001361415504077600270400ustar00rootroot00000000000000'use strict'; var foo = function() { foo.toString = null; }.toString(); console.log(foo); rollup-2.61.1/test/form/samples/circular-member-expression/_expected/es.js000066400000000000000000000001171415504077600266670ustar00rootroot00000000000000var foo = function() { foo.toString = null; }.toString(); console.log(foo); rollup-2.61.1/test/form/samples/circular-member-expression/_expected/iife.js000066400000000000000000000001761415504077600272010ustar00rootroot00000000000000(function () { 'use strict'; var foo = function() { foo.toString = null; }.toString(); console.log(foo); })(); rollup-2.61.1/test/form/samples/circular-member-expression/_expected/system.js000066400000000000000000000003241415504077600276040ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var foo = function() { foo.toString = null; }.toString(); console.log(foo); }) }; })); rollup-2.61.1/test/form/samples/circular-member-expression/_expected/umd.js000066400000000000000000000003421415504077600270450ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var foo = function() { foo.toString = null; }.toString(); console.log(foo); })); rollup-2.61.1/test/form/samples/circular-member-expression/main.js000066400000000000000000000001161415504077600252430ustar00rootroot00000000000000var foo = function() { foo.toString = null; }.toString(); console.log(foo);rollup-2.61.1/test/form/samples/class-constructor-side-effect/000077500000000000000000000000001415504077600243615ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/class-constructor-side-effect/_config.js000066400000000000000000000001341415504077600263210ustar00rootroot00000000000000module.exports = { description: 'preserves side-effects in a class constructor (#1233)' }; rollup-2.61.1/test/form/samples/class-constructor-side-effect/_expected.js000066400000000000000000000001701415504077600266550ustar00rootroot00000000000000class Effect { constructor () { console.log( 'Foo' ); } } new Effect(); class Empty {} new Empty.doesNotExist(); rollup-2.61.1/test/form/samples/class-constructor-side-effect/main.js000066400000000000000000000002621415504077600256430ustar00rootroot00000000000000class Effect { constructor () { console.log( 'Foo' ); } } new Effect(); class NoEffect { constructor () { } } new NoEffect(); class Empty {} new Empty.doesNotExist(); rollup-2.61.1/test/form/samples/class-fields/000077500000000000000000000000001415504077600210665ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/class-fields/_config.js000066400000000000000000000000741415504077600230310ustar00rootroot00000000000000module.exports = { description: 'supports class fields' }; rollup-2.61.1/test/form/samples/class-fields/_expected.js000066400000000000000000000011341415504077600233630ustar00rootroot00000000000000class 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-2.61.1/test/form/samples/class-fields/main.js000066400000000000000000000012631415504077600223520ustar00rootroot00000000000000class 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-2.61.1/test/form/samples/class-method-access/000077500000000000000000000000001415504077600223375ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/class-method-access/_config.js000066400000000000000000000001271415504077600243010ustar00rootroot00000000000000module.exports = { description: 'tracks side-effects when accessing class methods' }; rollup-2.61.1/test/form/samples/class-method-access/_expected.js000066400000000000000000000004751415504077600246430ustar00rootroot00000000000000console.log('retained'); class Used { static method() {} static get getter() { return { foo: {} }; } } 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-2.61.1/test/form/samples/class-method-access/main.js000066400000000000000000000011721415504077600236220ustar00rootroot00000000000000class 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: {} }; } } 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-2.61.1/test/form/samples/class-static-initialization-block/000077500000000000000000000000001415504077600252245ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/class-static-initialization-block/_config.js000066400000000000000000000001221415504077600271610ustar00rootroot00000000000000module.exports = { description: 'supports class static initialization blocks' }; rollup-2.61.1/test/form/samples/class-static-initialization-block/_expected.js000066400000000000000000000010431415504077600275200ustar00rootroot00000000000000class 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-2.61.1/test/form/samples/class-static-initialization-block/main.js000066400000000000000000000015631415504077600265130ustar00rootroot00000000000000export 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-2.61.1/test/form/samples/class-without-new/000077500000000000000000000000001415504077600221125ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/class-without-new/_config.js000066400000000000000000000001331415504077600240510ustar00rootroot00000000000000module.exports = { description: 'instantiating a class without "new" is a side-effect' }; rollup-2.61.1/test/form/samples/class-without-new/_expected.js000066400000000000000000000000251415504077600244050ustar00rootroot00000000000000class foo {} foo(); rollup-2.61.1/test/form/samples/class-without-new/main.js000066400000000000000000000000251415504077600233710ustar00rootroot00000000000000class foo {} foo(); rollup-2.61.1/test/form/samples/comment-before-import/000077500000000000000000000000001415504077600227275ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/comment-before-import/_config.js000066400000000000000000000001101415504077600246610ustar00rootroot00000000000000module.exports = { description: 'preserves comments before imports' }; rollup-2.61.1/test/form/samples/comment-before-import/_expected/000077500000000000000000000000001415504077600246675ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/comment-before-import/_expected/amd.js000066400000000000000000000002111415504077600257600ustar00rootroot00000000000000define((function () { 'use strict'; // bar.js var bar = 21; // foo.js var foo = bar * 2; // main.js console.log( foo ); })); rollup-2.61.1/test/form/samples/comment-before-import/_expected/cjs.js000066400000000000000000000001471415504077600260060ustar00rootroot00000000000000'use strict'; // bar.js var bar = 21; // foo.js var foo = bar * 2; // main.js console.log( foo ); rollup-2.61.1/test/form/samples/comment-before-import/_expected/es.js000066400000000000000000000001301415504077600256260ustar00rootroot00000000000000// bar.js var bar = 21; // foo.js var foo = bar * 2; // main.js console.log( foo ); rollup-2.61.1/test/form/samples/comment-before-import/_expected/iife.js000066400000000000000000000002041415504077600261350ustar00rootroot00000000000000(function () { 'use strict'; // bar.js var bar = 21; // foo.js var foo = bar * 2; // main.js console.log( foo ); })(); rollup-2.61.1/test/form/samples/comment-before-import/_expected/system.js000066400000000000000000000003201415504077600265440ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { // bar.js var bar = 21; // foo.js var foo = bar * 2; // main.js console.log( foo ); }) }; })); rollup-2.61.1/test/form/samples/comment-before-import/_expected/umd.js000066400000000000000000000003471415504077600260160ustar00rootroot00000000000000(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-2.61.1/test/form/samples/comment-before-import/bar.js000066400000000000000000000000351415504077600240270ustar00rootroot00000000000000// bar.js export default 21; rollup-2.61.1/test/form/samples/comment-before-import/foo.js000066400000000000000000000000771415504077600240540ustar00rootroot00000000000000// foo.js import bar from './bar.js'; export default bar * 2; rollup-2.61.1/test/form/samples/comment-before-import/main.js000066400000000000000000000000741415504077600242120ustar00rootroot00000000000000// main.js import foo from './foo.js'; console.log( foo ); rollup-2.61.1/test/form/samples/comment-start-inside-comment/000077500000000000000000000000001415504077600242235ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/comment-start-inside-comment/_config.js000066400000000000000000000001261415504077600261640ustar00rootroot00000000000000module.exports = { description: 'properly remove coments above import statements' }; rollup-2.61.1/test/form/samples/comment-start-inside-comment/_expected/000077500000000000000000000000001415504077600261635ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/comment-start-inside-comment/_expected/amd.js000066400000000000000000000001401415504077600272550ustar00rootroot00000000000000define((function () { 'use strict'; var foo = () => 'foo'; // /* console.log(foo()); })); rollup-2.61.1/test/form/samples/comment-start-inside-comment/_expected/cjs.js000066400000000000000000000001011415504077600272700ustar00rootroot00000000000000'use strict'; var foo = () => 'foo'; // /* console.log(foo()); rollup-2.61.1/test/form/samples/comment-start-inside-comment/_expected/es.js000066400000000000000000000000621415504077600271260ustar00rootroot00000000000000var foo = () => 'foo'; // /* console.log(foo()); rollup-2.61.1/test/form/samples/comment-start-inside-comment/_expected/iife.js000066400000000000000000000001331415504077600274320ustar00rootroot00000000000000(function () { 'use strict'; var foo = () => 'foo'; // /* console.log(foo()); })(); rollup-2.61.1/test/form/samples/comment-start-inside-comment/_expected/system.js000066400000000000000000000002411415504077600300420ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var foo = () => 'foo'; // /* console.log(foo()); }) }; })); rollup-2.61.1/test/form/samples/comment-start-inside-comment/_expected/umd.js000066400000000000000000000002761415504077600273130ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var foo = () => 'foo'; // /* console.log(foo()); })); rollup-2.61.1/test/form/samples/comment-start-inside-comment/foo.js000066400000000000000000000000341415504077600253410ustar00rootroot00000000000000export default () => 'foo'; rollup-2.61.1/test/form/samples/comment-start-inside-comment/main.js000066400000000000000000000001631415504077600255050ustar00rootroot00000000000000// /* import foo from './foo.js'; const bar = 'unused'; /*/ this comment is not closed yet */ console.log(foo()); rollup-2.61.1/test/form/samples/compact-empty-external/000077500000000000000000000000001415504077600231175ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/compact-empty-external/_config.js000066400000000000000000000002521415504077600250600ustar00rootroot00000000000000module.exports = { description: 'correctly handles empty external imports in compact mode', options: { external: ['external'], output: { compact: true } } }; rollup-2.61.1/test/form/samples/compact-empty-external/_expected/000077500000000000000000000000001415504077600250575ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/compact-empty-external/_expected/amd.js000066400000000000000000000000711415504077600261540ustar00rootroot00000000000000define(['external'],(function(external){'use strict';}));rollup-2.61.1/test/form/samples/compact-empty-external/_expected/cjs.js000066400000000000000000000000411415504077600261670ustar00rootroot00000000000000'use strict';require('external');rollup-2.61.1/test/form/samples/compact-empty-external/_expected/es.js000066400000000000000000000000211415504077600260150ustar00rootroot00000000000000import'external';rollup-2.61.1/test/form/samples/compact-empty-external/_expected/iife.js000066400000000000000000000000361415504077600263300ustar00rootroot00000000000000(function(){'use strict';})();rollup-2.61.1/test/form/samples/compact-empty-external/_expected/system.js000066400000000000000000000001571415504077600267440ustar00rootroot00000000000000System.register(['external'],(function(){'use strict';return{setters:[function(){}],execute:(function(){})}}));rollup-2.61.1/test/form/samples/compact-empty-external/_expected/umd.js000066400000000000000000000001571415504077600262050ustar00rootroot00000000000000(function(f){typeof define==='function'&&define.amd?define(['external'],f):f();})((function(){'use strict';}));rollup-2.61.1/test/form/samples/compact-empty-external/main.js000066400000000000000000000000231415504077600243740ustar00rootroot00000000000000import 'external'; rollup-2.61.1/test/form/samples/compact-multiple-imports/000077500000000000000000000000001415504077600234675ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/compact-multiple-imports/_config.js000066400000000000000000000004341415504077600254320ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/form/samples/compact-multiple-imports/_expected/000077500000000000000000000000001415504077600254275ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/compact-multiple-imports/_expected/amd.js000066400000000000000000000003371415504077600265310ustar00rootroot00000000000000define(['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-2.61.1/test/form/samples/compact-multiple-imports/_expected/cjs.js000066400000000000000000000003321415504077600265420ustar00rootroot00000000000000'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-2.61.1/test/form/samples/compact-multiple-imports/_expected/es.js000066400000000000000000000002671415504077600264010ustar00rootroot00000000000000import'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-2.61.1/test/form/samples/compact-multiple-imports/_expected/iife.js000066400000000000000000000002511415504077600266770ustar00rootroot00000000000000(function(external1,external2,external3,external4){'use strict';assert.equal(external3.value, '3'); assert.equal(external4.value, '4');})(null,null,external3,external4);rollup-2.61.1/test/form/samples/compact-multiple-imports/_expected/system.js000066400000000000000000000005241415504077600273120ustar00rootroot00000000000000System.register(['external-1','external-2','external-3','external-4','external-5'],(function(){'use strict';var value,value$1;return{setters:[function(){},function(){},function(module){value=module.value;},function(module){value$1=module.value;},function(){}],execute:(function(){assert.equal(value, '3'); assert.equal(value$1, '4');})}}));rollup-2.61.1/test/form/samples/compact-multiple-imports/_expected/umd.js000066400000000000000000000010321415504077600265460ustar00rootroot00000000000000(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-2.61.1/test/form/samples/compact-multiple-imports/main.js000066400000000000000000000002721415504077600247520ustar00rootroot00000000000000import '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-2.61.1/test/form/samples/compact-named-export/000077500000000000000000000000001415504077600225445ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/compact-named-export/_config.js000066400000000000000000000002431415504077600245050ustar00rootroot00000000000000module.exports = { description: 'properly handles named export live bindings in compact mode', options: { output: { name: 'foo', compact: true } } }; rollup-2.61.1/test/form/samples/compact-named-export/_expected/000077500000000000000000000000001415504077600245045ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/compact-named-export/_expected/amd.js000066400000000000000000000002761415504077600256100ustar00rootroot00000000000000define(['exports'],(function(exports){'use strict';exports.x = 42; exports.x+=1; exports.x=exports.x+1; exports.x++; ++exports.x;Object.defineProperty(exports,'__esModule',{value:true});}));rollup-2.61.1/test/form/samples/compact-named-export/_expected/cjs.js000066400000000000000000000002241415504077600256170ustar00rootroot00000000000000'use strict';Object.defineProperty(exports,'__esModule',{value:true});exports.x = 42; exports.x+=1; exports.x=exports.x+1; exports.x++; ++exports.x;rollup-2.61.1/test/form/samples/compact-named-export/_expected/es.js000066400000000000000000000000541415504077600254500ustar00rootroot00000000000000let x = 42; x+=1; x=x+1; x++; ++x;export{x};rollup-2.61.1/test/form/samples/compact-named-export/_expected/iife.js000066400000000000000000000003051415504077600257540ustar00rootroot00000000000000var foo=(function(exports){'use strict';exports.x = 42; exports.x+=1; exports.x=exports.x+1; exports.x++; ++exports.x;Object.defineProperty(exports,'__esModule',{value:true});return exports;})({});rollup-2.61.1/test/form/samples/compact-named-export/_expected/system.js000066400000000000000000000003021415504077600263610ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/compact-named-export/_expected/umd.js000066400000000000000000000006041415504077600256270ustar00rootroot00000000000000(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;Object.defineProperty(exports,'__esModule',{value:true});}));rollup-2.61.1/test/form/samples/compact-named-export/main.js000066400000000000000000000000521415504077600240230ustar00rootroot00000000000000export let x = 42; x+=1; x=x+1; x++; ++x; rollup-2.61.1/test/form/samples/compact/000077500000000000000000000000001415504077600201435ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/compact/_config.js000066400000000000000000000004351415504077600221070ustar00rootroot00000000000000module.exports = { description: 'supports compact output with compact: true', expectedWarnings: ['CIRCULAR_DEPENDENCY'], options: { external: ['external'], output: { name: 'foo', compact: true, namespaceToStringTag: true, globals: { external: 'x' } } } }; rollup-2.61.1/test/form/samples/compact/_expected/000077500000000000000000000000001415504077600221035ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/compact/_expected/amd.js000066400000000000000000000006411415504077600232030ustar00rootroot00000000000000define(['external'],(function(x){'use strict';function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e:{'default':e}}var x__default=/*#__PURE__*/_interopDefaultLegacy(x);var self=/*#__PURE__*/Object.freeze({__proto__:null,[Symbol.toStringTag]:'Module',get default(){return foo}});console.log(self); function foo () { console.log( x__default["default"] ); } // trailing comment return foo;}));rollup-2.61.1/test/form/samples/compact/_expected/cjs.js000066400000000000000000000006361415504077600232250ustar00rootroot00000000000000'use strict';var x=require('external');function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e:{'default':e}}var x__default=/*#__PURE__*/_interopDefaultLegacy(x);var self=/*#__PURE__*/Object.freeze({__proto__:null,[Symbol.toStringTag]:'Module',get default(){return foo}});console.log(self); function foo () { console.log( x__default["default"] ); } // trailing comment module.exports=foo;rollup-2.61.1/test/form/samples/compact/_expected/es.js000066400000000000000000000003531415504077600230510ustar00rootroot00000000000000import x from'external';var self=/*#__PURE__*/Object.freeze({__proto__:null,[Symbol.toStringTag]:'Module',get default(){return foo}});console.log(self); function foo () { console.log( x ); } // trailing comment export{foo as default};rollup-2.61.1/test/form/samples/compact/_expected/iife.js000066400000000000000000000006271415504077600233620ustar00rootroot00000000000000var foo=(function(x){'use strict';function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e:{'default':e}}var x__default=/*#__PURE__*/_interopDefaultLegacy(x);var self=/*#__PURE__*/Object.freeze({__proto__:null,[Symbol.toStringTag]:'Module',get default(){return foo}});console.log(self); function foo () { console.log( x__default["default"] ); } // trailing comment return foo;})(x);rollup-2.61.1/test/form/samples/compact/_expected/system.js000066400000000000000000000005571415504077600237740ustar00rootroot00000000000000System.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({__proto__:null,[Symbol.toStringTag]:'Module',get default(){return foo}});console.log(self); function foo () { console.log( x ); } // trailing comment })}}));rollup-2.61.1/test/form/samples/compact/_expected/umd.js000066400000000000000000000012031415504077600232220ustar00rootroot00000000000000(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';function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e:{'default':e}}var x__default=/*#__PURE__*/_interopDefaultLegacy(x);var self=/*#__PURE__*/Object.freeze({__proto__:null,[Symbol.toStringTag]:'Module',get default(){return foo}});console.log(self); function foo () { console.log( x__default["default"] ); } // trailing comment return foo;}));rollup-2.61.1/test/form/samples/compact/main.js000066400000000000000000000002321415504077600214220ustar00rootroot00000000000000import x from 'external'; import * as self from './main.js'; console.log(self); export default function foo () { console.log( x ); } // trailing comment rollup-2.61.1/test/form/samples/computed-member-expression-assignments/000077500000000000000000000000001415504077600263305ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/computed-member-expression-assignments/_config.js000066400000000000000000000001441415504077600302710ustar00rootroot00000000000000module.exports = { description: 'detect side-effects in assignments involving computed members' }; rollup-2.61.1/test/form/samples/computed-member-expression-assignments/_expected.js000066400000000000000000000006531415504077600306320ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/computed-member-expression-assignments/main.js000066400000000000000000000007521415504077600276160ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/computed-properties/000077500000000000000000000000001415504077600225275ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/computed-properties/_config.js000066400000000000000000000002421415504077600244670ustar00rootroot00000000000000module.exports = { description: 'computed property keys include declarations of referenced identifiers', options: { output: { name: 'computedProperties' } } }; rollup-2.61.1/test/form/samples/computed-properties/_expected/000077500000000000000000000000001415504077600244675ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/computed-properties/_expected/amd.js000066400000000000000000000005151415504077600255670ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/computed-properties/_expected/cjs.js000066400000000000000000000004201415504077600256000ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/form/samples/computed-properties/_expected/es.js000066400000000000000000000002641415504077600254360ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/computed-properties/_expected/iife.js000066400000000000000000000005501415504077600257410ustar00rootroot00000000000000var 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; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/computed-properties/_expected/system.js000066400000000000000000000005421415504077600263520ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/computed-properties/_expected/umd.js000066400000000000000000000011661415504077600256160ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/computed-properties/main.js000066400000000000000000000002601415504077600240070ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/conditional-expression-deopzimize-while-included/000077500000000000000000000000001415504077600302655ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/conditional-expression-deopzimize-while-included/_config.js000066400000000000000000000001641415504077600322300ustar00rootroot00000000000000module.exports = { description: 'handles deoptimizations of logical expression while they are inlcuded (#3324)' }; rollup-2.61.1/test/form/samples/conditional-expression-deopzimize-while-included/_expected.js000066400000000000000000000002561415504077600325660ustar00rootroot00000000000000let isReassigned = false; const result = (foo(), reassign() ? first() : second()); console.log(result); function reassign() { isReassigned = true; return isReassigned; } rollup-2.61.1/test/form/samples/conditional-expression-deopzimize-while-included/main.js000066400000000000000000000002561415504077600315520ustar00rootroot00000000000000let isReassigned = false; const result = (foo(), reassign() ? first() : second()); console.log(result); function reassign() { isReassigned = true; return isReassigned; } rollup-2.61.1/test/form/samples/conditional-expression-paths/000077500000000000000000000000001415504077600243325ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/conditional-expression-paths/_config.js000066400000000000000000000001151415504077600262710ustar00rootroot00000000000000module.exports = { description: 'only retain branches with side-effects' }; rollup-2.61.1/test/form/samples/conditional-expression-paths/_expected.js000066400000000000000000000005351415504077600266330ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/conditional-expression-paths/main.js000066400000000000000000000016451415504077600256220ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/conditional-expression/000077500000000000000000000000001415504077600232155ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/conditional-expression/_config.js000066400000000000000000000001151415504077600251540ustar00rootroot00000000000000module.exports = { description: 'only retain branches with side-effects' }; rollup-2.61.1/test/form/samples/conditional-expression/_expected.js000066400000000000000000000006341415504077600255160ustar00rootroot00000000000000// 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-2.61.1/test/form/samples/conditional-expression/main.js000066400000000000000000000022011415504077600244720ustar00rootroot00000000000000// 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-2.61.1/test/form/samples/conditional-put-parens-around-sequence/000077500000000000000000000000001415504077600262105ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/conditional-put-parens-around-sequence/_config.js000066400000000000000000000001441415504077600301510ustar00rootroot00000000000000module.exports = { description: 'put parens around sequences if conditional simplified (#1311)' }; rollup-2.61.1/test/form/samples/conditional-put-parens-around-sequence/_expected.js000066400000000000000000000001701415504077600305040ustar00rootroot00000000000000var a = ( foo(), 3 ) ; var b = ( bar(), 6 ); foo( a, b ); // verify works with no whitespace bar((foo(),2),(bar(),8)); rollup-2.61.1/test/form/samples/conditional-put-parens-around-sequence/main.js000066400000000000000000000003201415504077600274650ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/configure-file-url/000077500000000000000000000000001415504077600222135ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/configure-file-url/_config.js000066400000000000000000000017751415504077600241670ustar00rootroot00000000000000module.exports = { description: 'allows to configure file urls', options: { 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}` }); 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; } }, { resolveFileUrl({ moduleId }) { if (moduleId === 'resolved') { return `'resolved'`; } return null; } } ] } }; rollup-2.61.1/test/form/samples/configure-file-url/_expected/000077500000000000000000000000001415504077600241535ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/configure-file-url/_expected/amd.js000066400000000000000000000006211415504077600252510ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; var asset1 = 'chunkId=amd.js:moduleId=solved:fileName=assets/asset-solved-28a7ac89.txt:format=amd:relativePath=assets/asset-solved-28a7ac89.txt:referenceId=6296c678'; var asset2 = 'resolved'; var asset3 = new URL(require.toUrl('./assets/asset-unresolved-8dcd7fca.txt'), document.baseURI).href; console.log(asset1, asset2, asset3); })); rollup-2.61.1/test/form/samples/configure-file-url/_expected/assets/000077500000000000000000000000001415504077600254555ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/configure-file-url/_expected/assets/asset-resolved-8bd22e6e.txt000066400000000000000000000000231415504077600323700ustar00rootroot00000000000000Asset for: resolvedrollup-2.61.1/test/form/samples/configure-file-url/_expected/assets/asset-solved-28a7ac89.txt000066400000000000000000000000211415504077600317640ustar00rootroot00000000000000Asset for: solvedrollup-2.61.1/test/form/samples/configure-file-url/_expected/assets/asset-unresolved-8dcd7fca.txt000066400000000000000000000000251415504077600330770ustar00rootroot00000000000000Asset for: unresolvedrollup-2.61.1/test/form/samples/configure-file-url/_expected/cjs.js000066400000000000000000000010141415504077600252640ustar00rootroot00000000000000'use strict'; var asset1 = 'chunkId=cjs.js:moduleId=solved:fileName=assets/asset-solved-28a7ac89.txt:format=cjs:relativePath=assets/asset-solved-28a7ac89.txt:referenceId=6296c678'; var asset2 = 'resolved'; var asset3 = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/asset-unresolved-8dcd7fca.txt').href : new URL('assets/asset-unresolved-8dcd7fca.txt', document.currentScript && document.currentScript.src || document.baseURI).href); console.log(asset1, asset2, asset3); rollup-2.61.1/test/form/samples/configure-file-url/_expected/es.js000066400000000000000000000004721415504077600251230ustar00rootroot00000000000000var asset1 = 'chunkId=es.js:moduleId=solved:fileName=assets/asset-solved-28a7ac89.txt:format=es:relativePath=assets/asset-solved-28a7ac89.txt:referenceId=6296c678'; var asset2 = 'resolved'; var asset3 = new URL('assets/asset-unresolved-8dcd7fca.txt', import.meta.url).href; console.log(asset1, asset2, asset3); rollup-2.61.1/test/form/samples/configure-file-url/_expected/iife.js000066400000000000000000000006411415504077600254260ustar00rootroot00000000000000(function () { 'use strict'; var asset1 = 'chunkId=iife.js:moduleId=solved:fileName=assets/asset-solved-28a7ac89.txt:format=iife:relativePath=assets/asset-solved-28a7ac89.txt:referenceId=6296c678'; var asset2 = 'resolved'; var asset3 = new URL('assets/asset-unresolved-8dcd7fca.txt', document.currentScript && document.currentScript.src || document.baseURI).href; console.log(asset1, asset2, asset3); })(); rollup-2.61.1/test/form/samples/configure-file-url/_expected/system.js000066400000000000000000000007031415504077600260350ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { var asset1 = 'chunkId=system.js:moduleId=solved:fileName=assets/asset-solved-28a7ac89.txt:format=system:relativePath=assets/asset-solved-28a7ac89.txt:referenceId=6296c678'; var asset2 = 'resolved'; var asset3 = new URL('assets/asset-unresolved-8dcd7fca.txt', module.meta.url).href; console.log(asset1, asset2, asset3); }) }; })); rollup-2.61.1/test/form/samples/configure-file-url/_expected/umd.js000066400000000000000000000013371415504077600253020ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var asset1 = 'chunkId=umd.js:moduleId=solved:fileName=assets/asset-solved-28a7ac89.txt:format=umd:relativePath=assets/asset-solved-28a7ac89.txt:referenceId=6296c678'; var asset2 = 'resolved'; var asset3 = (typeof document === 'undefined' && typeof location === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/asset-unresolved-8dcd7fca.txt').href : new URL('assets/asset-unresolved-8dcd7fca.txt', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); console.log(asset1, asset2, asset3); })); rollup-2.61.1/test/form/samples/configure-file-url/main.js000066400000000000000000000002031415504077600234700ustar00rootroot00000000000000import asset1 from 'solved'; import asset2 from 'resolved'; import asset3 from 'unresolved'; console.log(asset1, asset2, asset3); rollup-2.61.1/test/form/samples/conflicting-imports/000077500000000000000000000000001415504077600225075ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/conflicting-imports/_config.js000066400000000000000000000003031415504077600244450ustar00rootroot00000000000000module.exports = { description: 'ensures bundle imports are deconflicted (#659)', options: { external: ['foo', 'bar'], output: { globals: { bar: 'bar', foo: 'foo' } } } }; rollup-2.61.1/test/form/samples/conflicting-imports/_expected/000077500000000000000000000000001415504077600244475ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/conflicting-imports/_expected/amd.js000066400000000000000000000001621415504077600255450ustar00rootroot00000000000000define(['foo', 'bar'], (function (foo, bar) { 'use strict'; console.log( bar.a ); console.log( foo.a ); })); rollup-2.61.1/test/form/samples/conflicting-imports/_expected/cjs.js000066400000000000000000000001611415504077600255620ustar00rootroot00000000000000'use strict'; var foo = require('foo'); var bar = require('bar'); console.log( bar.a ); console.log( foo.a ); rollup-2.61.1/test/form/samples/conflicting-imports/_expected/es.js000066400000000000000000000001411415504077600254100ustar00rootroot00000000000000import { a as a$1 } from 'foo'; import { a } from 'bar'; console.log( a ); console.log( a$1 ); rollup-2.61.1/test/form/samples/conflicting-imports/_expected/iife.js000066400000000000000000000001451415504077600257210ustar00rootroot00000000000000(function (foo, bar) { 'use strict'; console.log( bar.a ); console.log( foo.a ); })(foo, bar); rollup-2.61.1/test/form/samples/conflicting-imports/_expected/system.js000066400000000000000000000004171415504077600263330ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/conflicting-imports/_expected/umd.js000066400000000000000000000006521415504077600255750ustar00rootroot00000000000000(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-2.61.1/test/form/samples/conflicting-imports/main.js000066400000000000000000000001011415504077600237610ustar00rootroot00000000000000import { a } from 'foo'; import './other.js'; console.log( a ); rollup-2.61.1/test/form/samples/conflicting-imports/other.js000066400000000000000000000000541415504077600241650ustar00rootroot00000000000000import { a } from 'bar'; console.log( a ); rollup-2.61.1/test/form/samples/curried-function/000077500000000000000000000000001415504077600217755ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/curried-function/T.js000066400000000000000000000001101415504077600225260ustar00rootroot00000000000000import always from './always'; var T = always(true); export default T; rollup-2.61.1/test/form/samples/curried-function/_config.js000066400000000000000000000001121415504077600237310ustar00rootroot00000000000000module.exports = { description: 'properly handles a curried function' }; rollup-2.61.1/test/form/samples/curried-function/_expected.js000066400000000000000000000003151415504077600242720ustar00rootroot00000000000000function curry1 ( fn ) { return function f1 ( a ) { return fn.apply( this, arguments ); }; } var always = curry1( function always ( val ) { return function () { return val; }; } ); always(true); rollup-2.61.1/test/form/samples/curried-function/always.js000066400000000000000000000002231415504077600236300ustar00rootroot00000000000000import curry1 from './curry1'; var always = curry1( function always ( val ) { return function () { return val; }; } ); export default always; rollup-2.61.1/test/form/samples/curried-function/curry1.js000066400000000000000000000001601415504077600235550ustar00rootroot00000000000000export default function curry1 ( fn ) { return function f1 ( a ) { return fn.apply( this, arguments ); }; } rollup-2.61.1/test/form/samples/curried-function/main.js000066400000000000000000000000211415504077600232500ustar00rootroot00000000000000import './T.js'; rollup-2.61.1/test/form/samples/custom-context/000077500000000000000000000000001415504077600215115ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/custom-context/_config.js000066400000000000000000000001401415504077600234460ustar00rootroot00000000000000module.exports = { description: 'allows custom context', options: { context: `lolwut` } }; rollup-2.61.1/test/form/samples/custom-context/_expected/000077500000000000000000000000001415504077600234515ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/custom-context/_expected/amd.js000066400000000000000000000001011415504077600245400ustar00rootroot00000000000000define((function () { 'use strict'; lolwut.prop = '???'; })); rollup-2.61.1/test/form/samples/custom-context/_expected/cjs.js000066400000000000000000000000441415504077600245640ustar00rootroot00000000000000'use strict'; lolwut.prop = '???'; rollup-2.61.1/test/form/samples/custom-context/_expected/es.js000066400000000000000000000000251415504077600244130ustar00rootroot00000000000000lolwut.prop = '???'; rollup-2.61.1/test/form/samples/custom-context/_expected/iife.js000066400000000000000000000000741415504077600247240ustar00rootroot00000000000000(function () { 'use strict'; lolwut.prop = '???'; })(); rollup-2.61.1/test/form/samples/custom-context/_expected/system.js000066400000000000000000000001761415504077600253370ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { lolwut.prop = '???'; }) }; })); rollup-2.61.1/test/form/samples/custom-context/_expected/umd.js000066400000000000000000000002371415504077600245760ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; lolwut.prop = '???'; })); rollup-2.61.1/test/form/samples/custom-context/main.js000066400000000000000000000000231415504077600227660ustar00rootroot00000000000000this.prop = '???'; rollup-2.61.1/test/form/samples/custom-dynamic-import-no-interop/000077500000000000000000000000001415504077600250515ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/custom-dynamic-import-no-interop/_config.js000066400000000000000000000004221415504077600270110ustar00rootroot00000000000000module.exports = { description: 'does not add any interop when using a custom dynamic import handler', options: { external: 'external', output: { interop: 'auto' }, plugins: { renderDynamicImport() { return { left: 'getIt(', right: ')' }; } } } }; rollup-2.61.1/test/form/samples/custom-dynamic-import-no-interop/_expected/000077500000000000000000000000001415504077600270115ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/custom-dynamic-import-no-interop/_expected/amd.js000066400000000000000000000001451415504077600301100ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; getIt('external').then(console.log); })); rollup-2.61.1/test/form/samples/custom-dynamic-import-no-interop/_expected/cjs.js000066400000000000000000000000641415504077600301260ustar00rootroot00000000000000'use strict'; getIt('external').then(console.log); rollup-2.61.1/test/form/samples/custom-dynamic-import-no-interop/_expected/es.js000066400000000000000000000000451415504077600277550ustar00rootroot00000000000000getIt('external').then(console.log); rollup-2.61.1/test/form/samples/custom-dynamic-import-no-interop/_expected/iife.js000066400000000000000000000001141415504077600302570ustar00rootroot00000000000000(function () { 'use strict'; getIt('external').then(console.log); })(); rollup-2.61.1/test/form/samples/custom-dynamic-import-no-interop/_expected/system.js000066400000000000000000000002351415504077600306730ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { getIt('external').then(console.log); }) }; })); rollup-2.61.1/test/form/samples/custom-dynamic-import-no-interop/_expected/umd.js000066400000000000000000000002571415504077600301400ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; getIt('external').then(console.log); })); rollup-2.61.1/test/form/samples/custom-dynamic-import-no-interop/main.js000066400000000000000000000000461415504077600263330ustar00rootroot00000000000000import('external').then(console.log); rollup-2.61.1/test/form/samples/custom-module-context-function/000077500000000000000000000000001415504077600246175ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/custom-module-context-function/_config.js000066400000000000000000000004541415504077600265640ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/form/samples/custom-module-context-function/_expected.js000066400000000000000000000001051415504077600271110ustar00rootroot00000000000000global.prop = 'foo'; undefined.prop = 'bar'; window.prop = 'main'; rollup-2.61.1/test/form/samples/custom-module-context-function/bar.js000066400000000000000000000000231415504077600257140ustar00rootroot00000000000000this.prop = 'bar'; rollup-2.61.1/test/form/samples/custom-module-context-function/foo.js000066400000000000000000000000231415504077600257330ustar00rootroot00000000000000this.prop = 'foo'; rollup-2.61.1/test/form/samples/custom-module-context-function/main.js000066400000000000000000000000721415504077600261000ustar00rootroot00000000000000import './foo.js'; import './bar.js'; this.prop = 'main'; rollup-2.61.1/test/form/samples/custom-module-context/000077500000000000000000000000001415504077600227745ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/custom-module-context/_config.js000066400000000000000000000002641415504077600247400ustar00rootroot00000000000000module.exports = { description: 'allows custom module-specific context', expectedWarnings: ['THIS_IS_UNDEFINED'], options: { moduleContext: { 'main.js': 'lolwut' } } }; rollup-2.61.1/test/form/samples/custom-module-context/_expected/000077500000000000000000000000001415504077600247345ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/custom-module-context/_expected/amd.js000066400000000000000000000001341415504077600260310ustar00rootroot00000000000000define((function () { 'use strict'; undefined.prop = 'nope'; lolwut.prop = '???'; })); rollup-2.61.1/test/form/samples/custom-module-context/_expected/cjs.js000066400000000000000000000000761415504077600260540ustar00rootroot00000000000000'use strict'; undefined.prop = 'nope'; lolwut.prop = '???'; rollup-2.61.1/test/form/samples/custom-module-context/_expected/es.js000066400000000000000000000000571415504077600257030ustar00rootroot00000000000000undefined.prop = 'nope'; lolwut.prop = '???'; rollup-2.61.1/test/form/samples/custom-module-context/_expected/iife.js000066400000000000000000000001271415504077600262060ustar00rootroot00000000000000(function () { 'use strict'; undefined.prop = 'nope'; lolwut.prop = '???'; })(); rollup-2.61.1/test/form/samples/custom-module-context/_expected/system.js000066400000000000000000000002331415504077600266140ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { undefined.prop = 'nope'; lolwut.prop = '???'; }) }; })); rollup-2.61.1/test/form/samples/custom-module-context/_expected/umd.js000066400000000000000000000002721415504077600260600ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; undefined.prop = 'nope'; lolwut.prop = '???'; })); rollup-2.61.1/test/form/samples/custom-module-context/foo.js000066400000000000000000000000241415504077600241110ustar00rootroot00000000000000this.prop = 'nope'; rollup-2.61.1/test/form/samples/custom-module-context/main.js000066400000000000000000000000461415504077600242560ustar00rootroot00000000000000import './foo.js'; this.prop = '???'; rollup-2.61.1/test/form/samples/declarations-with-side-effects/000077500000000000000000000000001415504077600244755ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/declarations-with-side-effects/_config.js000066400000000000000000000001631415504077600264370ustar00rootroot00000000000000module.exports = { description: 'retains side-effects in declarations will tree-shaking the declared variable' }; rollup-2.61.1/test/form/samples/declarations-with-side-effects/_expected.js000066400000000000000000000002271415504077600267740ustar00rootroot00000000000000let foo1 = true; globalFunction(); console.log(foo1); ({[globalFunction()]: globalFunction()}); const baz2 = 3; console.log(baz2); globalFunction(); rollup-2.61.1/test/form/samples/declarations-with-side-effects/main.js000066400000000000000000000003371415504077600257620ustar00rootroot00000000000000let 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-2.61.1/test/form/samples/deconflict-format-specific-exports/000077500000000000000000000000001415504077600254025ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deconflict-format-specific-exports/_config.js000066400000000000000000000002141415504077600273410ustar00rootroot00000000000000module.exports = { description: 'only deconflict "exports" for formats where it is necessary', options: { output: { name: 'bundle' } } }; rollup-2.61.1/test/form/samples/deconflict-format-specific-exports/_expected/000077500000000000000000000000001415504077600273425ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deconflict-format-specific-exports/_expected/amd.js000066400000000000000000000006771415504077600304530ustar00rootroot00000000000000define(['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(); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/deconflict-format-specific-exports/_expected/cjs.js000066400000000000000000000005721415504077600304630ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/form/samples/deconflict-format-specific-exports/_expected/es.js000066400000000000000000000004461415504077600303130ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/deconflict-format-specific-exports/_expected/iife.js000066400000000000000000000007161415504077600306200ustar00rootroot00000000000000var 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(); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/deconflict-format-specific-exports/_expected/system.js000066400000000000000000000007651415504077600312340ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/deconflict-format-specific-exports/_expected/umd.js000066400000000000000000000013341415504077600304660ustar00rootroot00000000000000(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(); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/deconflict-format-specific-exports/main.js000066400000000000000000000004361415504077600266670ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/deconflict-format-specific-globals/000077500000000000000000000000001415504077600253215ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deconflict-format-specific-globals/_config.js000066400000000000000000000002721415504077600272640ustar00rootroot00000000000000module.exports = { description: 'deconflicts format specific globals', options: { external: 'external', output: { globals: { external: 'external' }, name: 'bundle' } } }; rollup-2.61.1/test/form/samples/deconflict-format-specific-globals/_expected/000077500000000000000000000000001415504077600272615ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deconflict-format-specific-globals/_expected/amd.js000066400000000000000000000041461415504077600303650ustar00rootroot00000000000000define(['module', 'require', 'external'], (function (module, require, external) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? 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__*/_interopDefaultLegacy(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-2.61.1/test/form/samples/deconflict-format-specific-globals/_expected/cjs.js000066400000000000000000000043441415504077600304030ustar00rootroot00000000000000'use strict'; var external = require('external'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? 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__*/_interopDefaultLegacy(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' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.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' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.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-2.61.1/test/form/samples/deconflict-format-specific-globals/_expected/es.js000066400000000000000000000020361415504077600302270ustar00rootroot00000000000000import 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-2.61.1/test/form/samples/deconflict-format-specific-globals/_expected/iife.js000066400000000000000000000030221415504077600305300ustar00rootroot00000000000000var bundle = (function (external) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external__default = /*#__PURE__*/_interopDefaultLegacy(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((document.currentScript && document.currentScript.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((document.currentScript && document.currentScript.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-2.61.1/test/form/samples/deconflict-format-specific-globals/_expected/system.js000066400000000000000000000025621415504077600311500ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/deconflict-format-specific-globals/_expected/umd.js000066400000000000000000000043051415504077600304060ustar00rootroot00000000000000(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'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external__default = /*#__PURE__*/_interopDefaultLegacy(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' ? new (require('u' + 'rl').URL)('file:' + __filename).href : typeof document === 'undefined' ? location.href : (document.currentScript && document.currentScript.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' ? new (require('u' + 'rl').URL)('file:' + __filename).href : typeof document === 'undefined' ? location.href : (document.currentScript && document.currentScript.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-2.61.1/test/form/samples/deconflict-format-specific-globals/main.js000066400000000000000000000020351415504077600266030ustar00rootroot00000000000000import 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-2.61.1/test/form/samples/deconflict-module-priority/000077500000000000000000000000001415504077600237715ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deconflict-module-priority/_config.js000066400000000000000000000001451415504077600257330ustar00rootroot00000000000000module.exports = { description: 'prioritizes entry modules over dependencies when deconflicting' }; rollup-2.61.1/test/form/samples/deconflict-module-priority/_expected.js000066400000000000000000000002051415504077600262640ustar00rootroot00000000000000const foo$1 = 'dep'; console.log(foo$1); const bar$1 = 'dep'; const foo = 'main'; const bar = 'main'; console.log(foo, bar, bar$1); rollup-2.61.1/test/form/samples/deconflict-module-priority/dep.js000066400000000000000000000000771415504077600251030ustar00rootroot00000000000000const foo = 'dep'; console.log(foo); export const bar = 'dep'; rollup-2.61.1/test/form/samples/deconflict-module-priority/main.js000066400000000000000000000001531415504077600252520ustar00rootroot00000000000000import { bar as baz } from './dep.js'; const foo = 'main'; const bar = 'main'; console.log(foo, bar, baz); rollup-2.61.1/test/form/samples/deconflict-nested-tree-shaking/000077500000000000000000000000001415504077600244665ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deconflict-nested-tree-shaking/_config.js000066400000000000000000000001501415504077600264240ustar00rootroot00000000000000module.exports = { description: 'does not consider nested tree-shaken variables when deconflicting' }; rollup-2.61.1/test/form/samples/deconflict-nested-tree-shaking/_expected.js000066400000000000000000000003041415504077600267610ustar00rootroot00000000000000const conflict = 'dep'; function getValue() { function nestedGetValue() { const conflict$1 = 'nested'; return conflict$1; } return conflict + nestedGetValue(); } console.log(getValue()); rollup-2.61.1/test/form/samples/deconflict-nested-tree-shaking/dep.js000066400000000000000000000000371415504077600255740ustar00rootroot00000000000000export const conflict = 'dep'; rollup-2.61.1/test/form/samples/deconflict-nested-tree-shaking/main.js000066400000000000000000000004311415504077600257460ustar00rootroot00000000000000import * 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-2.61.1/test/form/samples/deconflict-tree-shaken-globals/000077500000000000000000000000001415504077600244545ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deconflict-tree-shaken-globals/_config.js000066400000000000000000000001361415504077600264160ustar00rootroot00000000000000module.exports = { description: 'does not deconflict due to tree-shaken global variables' }; rollup-2.61.1/test/form/samples/deconflict-tree-shaken-globals/_expected.js000066400000000000000000000000621415504077600267500ustar00rootroot00000000000000const globalName = 42; console.log( globalName ); rollup-2.61.1/test/form/samples/deconflict-tree-shaken-globals/main.js000066400000000000000000000001101415504077600257260ustar00rootroot00000000000000import './other.js'; const globalName = 42; console.log( globalName ); rollup-2.61.1/test/form/samples/deconflict-tree-shaken-globals/other.js000066400000000000000000000000541415504077600261320ustar00rootroot00000000000000if (false) { console.log( globalName ); } rollup-2.61.1/test/form/samples/deconflict-tree-shaken/000077500000000000000000000000001415504077600230335ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deconflict-tree-shaken/_config.js000066400000000000000000000001411415504077600247710ustar00rootroot00000000000000module.exports = { description: 'does not consider tree-shaken variables when deconflicting' }; rollup-2.61.1/test/form/samples/deconflict-tree-shaken/_expected.js000066400000000000000000000000771415504077600253350ustar00rootroot00000000000000const x$1 = 1; console.log(x$1); const x = 0; console.log(x); rollup-2.61.1/test/form/samples/deconflict-tree-shaken/dep1.js000066400000000000000000000000351415504077600242200ustar00rootroot00000000000000const x = 1; console.log(x); rollup-2.61.1/test/form/samples/deconflict-tree-shaken/dep2.js000066400000000000000000000000151415504077600242170ustar00rootroot00000000000000const x = 2; rollup-2.61.1/test/form/samples/deconflict-tree-shaken/dep3.js000066400000000000000000000000151415504077600242200ustar00rootroot00000000000000const x = 3; rollup-2.61.1/test/form/samples/deconflict-tree-shaken/main.js000066400000000000000000000001321415504077600243110ustar00rootroot00000000000000import './dep1.js'; import './dep2.js'; import './dep3.js'; const x = 0; console.log(x); rollup-2.61.1/test/form/samples/dedupes-external-imports/000077500000000000000000000000001415504077600234615ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/dedupes-external-imports/_config.js000066400000000000000000000002631415504077600254240ustar00rootroot00000000000000module.exports = { description: 'dedupes external imports', options: { external: ['external'], output: { globals: { external: 'external' }, name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/dedupes-external-imports/_expected/000077500000000000000000000000001415504077600254215ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/dedupes-external-imports/_expected/amd.js000066400000000000000000000011121415504077600265130ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/dedupes-external-imports/_expected/cjs.js000066400000000000000000000010201415504077600265270ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/form/samples/dedupes-external-imports/_expected/es.js000066400000000000000000000006111415504077600263640ustar00rootroot00000000000000import { 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-2.61.1/test/form/samples/dedupes-external-imports/_expected/iife.js000066400000000000000000000011311415504077600266670ustar00rootroot00000000000000var 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; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, external); rollup-2.61.1/test/form/samples/dedupes-external-imports/_expected/system.js000066400000000000000000000012201415504077600272760ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/dedupes-external-imports/_expected/umd.js000066400000000000000000000016171415504077600265510ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/dedupes-external-imports/bar.js000066400000000000000000000002131415504077600245570ustar00rootroot00000000000000import { Component } from 'external'; export default class Bar extends Component { constructor () { super(); this.isBar = true; } } rollup-2.61.1/test/form/samples/dedupes-external-imports/baz.js000066400000000000000000000002161415504077600245720ustar00rootroot00000000000000import { Component as Comp } from 'external'; export default class Baz extends Comp { constructor () { super(); this.isBaz = true; } } rollup-2.61.1/test/form/samples/dedupes-external-imports/foo.js000066400000000000000000000002131415504077600245760ustar00rootroot00000000000000import { Component } from 'external'; export default class Foo extends Component { constructor () { super(); this.isFoo = true; } } rollup-2.61.1/test/form/samples/dedupes-external-imports/main.js000066400000000000000000000002461415504077600247450ustar00rootroot00000000000000import 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-2.61.1/test/form/samples/deep-properties-access/000077500000000000000000000000001415504077600230635ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deep-properties-access/_config.js000066400000000000000000000001161415504077600250230ustar00rootroot00000000000000module.exports = { description: 'handles deeply nested property accesses' }; rollup-2.61.1/test/form/samples/deep-properties-access/_expected.js000066400000000000000000000002131415504077600253550ustar00rootroot00000000000000var obj = { obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {}}}}}}}}}}}; console.log(obj.obj.obj.obj.obj.obj.obj.obj.obj.foo); rollup-2.61.1/test/form/samples/deep-properties-access/main.js000066400000000000000000000002131415504077600243410ustar00rootroot00000000000000var obj = { obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {obj: {}}}}}}}}}}}; console.log(obj.obj.obj.obj.obj.obj.obj.obj.obj.foo); rollup-2.61.1/test/form/samples/deep-properties/000077500000000000000000000000001415504077600216245ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deep-properties/_config.js000066400000000000000000000002071415504077600235650ustar00rootroot00000000000000module.exports = { description: 'handles deeply nested properties', options: { treeshake: { propertyReadSideEffects: false } } }; rollup-2.61.1/test/form/samples/deep-properties/_expected.js000066400000000000000000000007151415504077600241250ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/deep-properties/main.js000066400000000000000000000007151415504077600231110ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/deep-switch-declarations/000077500000000000000000000000001415504077600233775ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deep-switch-declarations/_config.js000066400000000000000000000001461415504077600253420ustar00rootroot00000000000000module.exports = { description: 'handles hoisted declarations in deeply nested switch statements' }; rollup-2.61.1/test/form/samples/deep-switch-declarations/_expected.js000066400000000000000000000025721415504077600257030ustar00rootroot00000000000000switch(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-2.61.1/test/form/samples/deep-switch-declarations/main.js000066400000000000000000000025711415504077600246660ustar00rootroot00000000000000switch(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-2.61.1/test/form/samples/default-export-class/000077500000000000000000000000001415504077600225635ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/default-export-class/_config.js000066400000000000000000000002471415504077600245300ustar00rootroot00000000000000module.exports = { description: 'puts the export after the declaration for default exported classes in SystemJS', options: { output: { name: 'bundle' } } }; rollup-2.61.1/test/form/samples/default-export-class/_expected/000077500000000000000000000000001415504077600245235ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/default-export-class/_expected/amd.js000066400000000000000000000001721415504077600256220ustar00rootroot00000000000000define((function () { 'use strict'; class main { constructor() { console.log('class'); } } return main; })); rollup-2.61.1/test/form/samples/default-export-class/_expected/cjs.js000066400000000000000000000001421415504077600256350ustar00rootroot00000000000000'use strict'; class main { constructor() { console.log('class'); } } module.exports = main; rollup-2.61.1/test/form/samples/default-export-class/_expected/es.js000066400000000000000000000001301415504077600254620ustar00rootroot00000000000000class main { constructor() { console.log('class'); } } export { main as default }; rollup-2.61.1/test/form/samples/default-export-class/_expected/iife.js000066400000000000000000000002021415504077600257670ustar00rootroot00000000000000var bundle = (function () { 'use strict'; class main { constructor() { console.log('class'); } } return main; })(); rollup-2.61.1/test/form/samples/default-export-class/_expected/system.js000066400000000000000000000003331415504077600264040ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { class main { constructor() { console.log('class'); } } exports('default', main); }) }; })); rollup-2.61.1/test/form/samples/default-export-class/_expected/umd.js000066400000000000000000000006371415504077600256540ustar00rootroot00000000000000(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-2.61.1/test/form/samples/default-export-class/main.js000066400000000000000000000001051415504077600240410ustar00rootroot00000000000000export default class { constructor() { console.log('class'); } } rollup-2.61.1/test/form/samples/default-export-live-binding/000077500000000000000000000000001415504077600240255ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/default-export-live-binding/_config.js000066400000000000000000000002161415504077600257660ustar00rootroot00000000000000module.exports = { description: 'allows live bindings for default exports', options: { output: { exports: 'named', name: 'bundle' } } }; rollup-2.61.1/test/form/samples/default-export-live-binding/_expected/000077500000000000000000000000001415504077600257655ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/default-export-live-binding/_expected/amd.js000066400000000000000000000003561415504077600270700ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; exports["default"] = null; const setFoo = value => (exports["default"] = value); exports.setFoo = setFoo; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/default-export-live-binding/_expected/cjs.js000066400000000000000000000002721415504077600271030ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); exports["default"] = null; const setFoo = value => (exports["default"] = value); exports.setFoo = setFoo; rollup-2.61.1/test/form/samples/default-export-live-binding/_expected/es.js000066400000000000000000000001331415504077600267270ustar00rootroot00000000000000let foo = null; const setFoo = value => (foo = value); export { foo as default, setFoo }; rollup-2.61.1/test/form/samples/default-export-live-binding/_expected/iife.js000066400000000000000000000003751415504077600272440ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/default-export-live-binding/_expected/system.js000066400000000000000000000003571415504077600276540ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { let foo = exports('default', null); const setFoo = exports('setFoo', value => (exports('default', foo = value))); }) }; })); rollup-2.61.1/test/form/samples/default-export-live-binding/_expected/umd.js000066400000000000000000000010131415504077600271030ustar00rootroot00000000000000(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-2.61.1/test/form/samples/default-export-live-binding/main.js000066400000000000000000000001321415504077600253030ustar00rootroot00000000000000let foo = null; const setFoo = value => (foo = value); export { foo as default, setFoo }; rollup-2.61.1/test/form/samples/default-export-mode/000077500000000000000000000000001415504077600224025ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/default-export-mode/_config.js000066400000000000000000000002411415504077600243410ustar00rootroot00000000000000module.exports = { description: 'allows specifying the export mode to be "default"', options: { output: { exports: 'default', name: 'bundle' } } }; rollup-2.61.1/test/form/samples/default-export-mode/_expected/000077500000000000000000000000001415504077600243425ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/default-export-mode/_expected/amd.js000066400000000000000000000001121415504077600254330ustar00rootroot00000000000000define((function () { 'use strict'; var main = 42; return main; })); rollup-2.61.1/test/form/samples/default-export-mode/_expected/cjs.js000066400000000000000000000000661415504077600254610ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-2.61.1/test/form/samples/default-export-mode/_expected/es.js000066400000000000000000000000541415504077600253060ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-2.61.1/test/form/samples/default-export-mode/_expected/iife.js000066400000000000000000000001221415504077600256070ustar00rootroot00000000000000var bundle = (function () { 'use strict'; var main = 42; return main; })(); rollup-2.61.1/test/form/samples/default-export-mode/_expected/system.js000066400000000000000000000002351415504077600262240ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', 42); }) }; })); rollup-2.61.1/test/form/samples/default-export-mode/_expected/umd.js000066400000000000000000000005571415504077600254740ustar00rootroot00000000000000(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-2.61.1/test/form/samples/default-export-mode/main.js000066400000000000000000000000231415504077600236570ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/form/samples/default-identifier-deshadowing/000077500000000000000000000000001415504077600245535ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/default-identifier-deshadowing/_config.js000066400000000000000000000001411415504077600265110ustar00rootroot00000000000000module.exports = { description: 'Handles export default identifier reassignment deshadowing' }; rollup-2.61.1/test/form/samples/default-identifier-deshadowing/_expected/000077500000000000000000000000001415504077600265135ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/default-identifier-deshadowing/_expected/amd.js000066400000000000000000000001541415504077600276120ustar00rootroot00000000000000define((function () { 'use strict'; function a() { a = someGlobal; return a(); } a(); })); rollup-2.61.1/test/form/samples/default-identifier-deshadowing/_expected/cjs.js000066400000000000000000000001061415504077600276250ustar00rootroot00000000000000'use strict'; function a() { a = someGlobal; return a(); } a(); rollup-2.61.1/test/form/samples/default-identifier-deshadowing/_expected/es.js000066400000000000000000000000671415504077600274630ustar00rootroot00000000000000function a() { a = someGlobal; return a(); } a(); rollup-2.61.1/test/form/samples/default-identifier-deshadowing/_expected/iife.js000066400000000000000000000001501415504077600277610ustar00rootroot00000000000000(function () { 'use strict'; function a() { a = someGlobal; return a(); } a(); })(); rollup-2.61.1/test/form/samples/default-identifier-deshadowing/_expected/system.js000066400000000000000000000003021415504077600303700ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function a() { a = someGlobal; return a(); } a(); }) }; })); rollup-2.61.1/test/form/samples/default-identifier-deshadowing/_expected/umd.js000066400000000000000000000003141415504077600276340ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function a() { a = someGlobal; return a(); } a(); })); rollup-2.61.1/test/form/samples/default-identifier-deshadowing/dep.js000066400000000000000000000001001415504077600256500ustar00rootroot00000000000000export default function a() { a = someGlobal; return a(); } rollup-2.61.1/test/form/samples/default-identifier-deshadowing/main.js000066400000000000000000000000421415504077600260310ustar00rootroot00000000000000import dep from './dep.js'; dep();rollup-2.61.1/test/form/samples/define-es-modules-false/000077500000000000000000000000001415504077600231125ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/define-es-modules-false/_config.js000066400000000000000000000002351415504077600250540ustar00rootroot00000000000000module.exports = { description: 'Not add __esModule property to exports with esModule: false', options: { output: { name: 'foo', esModule: false } } }; rollup-2.61.1/test/form/samples/define-es-modules-false/_expected/000077500000000000000000000000001415504077600250525ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/define-es-modules-false/_expected/amd.js000066400000000000000000000002431415504077600261500ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const make1 = () => {}; const make2 = () => {}; exports.make1 = make1; exports.make2 = make2; })); rollup-2.61.1/test/form/samples/define-es-modules-false/_expected/cjs.js000066400000000000000000000001571415504077600261720ustar00rootroot00000000000000'use strict'; const make1 = () => {}; const make2 = () => {}; exports.make1 = make1; exports.make2 = make2; rollup-2.61.1/test/form/samples/define-es-modules-false/_expected/es.js000066400000000000000000000001131415504077600260120ustar00rootroot00000000000000const make1 = () => {}; const make2 = () => {}; export { make1, make2 }; rollup-2.61.1/test/form/samples/define-es-modules-false/_expected/iife.js000066400000000000000000000002571415504077600263300ustar00rootroot00000000000000var foo = (function (exports) { 'use strict'; const make1 = () => {}; const make2 = () => {}; exports.make1 = make1; exports.make2 = make2; return exports; })({}); rollup-2.61.1/test/form/samples/define-es-modules-false/_expected/system.js000066400000000000000000000003171415504077600267350ustar00rootroot00000000000000System.register('foo', [], (function (exports) { 'use strict'; return { execute: (function () { const make1 = exports('make1', () => {}); const make2 = exports('make2', () => {}); }) }; })); rollup-2.61.1/test/form/samples/define-es-modules-false/_expected/umd.js000066400000000000000000000006751415504077600262050ustar00rootroot00000000000000(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-2.61.1/test/form/samples/define-es-modules-false/main.js000066400000000000000000000000771415504077600244000ustar00rootroot00000000000000export const make1 = () => {}; export const make2 = () => {}; rollup-2.61.1/test/form/samples/define-replacement/000077500000000000000000000000001415504077600222445ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/define-replacement/_config.js000066400000000000000000000001561415504077600242100ustar00rootroot00000000000000module.exports = { description: 'amd.define', options: { output: { amd: { define: 'enifed' } } } }; rollup-2.61.1/test/form/samples/define-replacement/_expected/000077500000000000000000000000001415504077600242045ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/define-replacement/_expected/amd.js000066400000000000000000000001671415504077600253070ustar00rootroot00000000000000enifed((function () { 'use strict'; var a = () => { console.log('props'); }; a(); a(); })); rollup-2.61.1/test/form/samples/define-replacement/_expected/cjs.js000066400000000000000000000001071415504077600253170ustar00rootroot00000000000000'use strict'; var a = () => { console.log('props'); }; a(); a(); rollup-2.61.1/test/form/samples/define-replacement/_expected/es.js000066400000000000000000000000701415504077600251460ustar00rootroot00000000000000var a = () => { console.log('props'); }; a(); a(); rollup-2.61.1/test/form/samples/define-replacement/_expected/iife.js000066400000000000000000000001651415504077600254600ustar00rootroot00000000000000(function () { 'use strict'; var a = () => { console.log('props'); }; a(); a(); })(); rollup-2.61.1/test/form/samples/define-replacement/_expected/system.js000066400000000000000000000003571415504077600260730ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var a = () => { console.log('props'); }; a(); a(); }) }; })); rollup-2.61.1/test/form/samples/define-replacement/_expected/umd.js000066400000000000000000000003331415504077600253260ustar00rootroot00000000000000(function (factory) { typeof enifed === 'function' && enifed.amd ? enifed(factory) : factory(); })((function () { 'use strict'; var a = () => { console.log('props'); }; a(); a(); })); rollup-2.61.1/test/form/samples/define-replacement/a.js000066400000000000000000000000631415504077600230210ustar00rootroot00000000000000export var a = () => { console.log('props'); };rollup-2.61.1/test/form/samples/define-replacement/main.js000066400000000000000000000001061415504077600235230ustar00rootroot00000000000000import { a } from "./a.js"; import { a as b } from "./a.js"; a(); b();rollup-2.61.1/test/form/samples/deopt-regexp-type/000077500000000000000000000000001415504077600220775ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deopt-regexp-type/_config.js000066400000000000000000000001531415504077600240400ustar00rootroot00000000000000module.exports = { description: 'deoptimizes typeof for regular expressions to better support es6-sim' }; rollup-2.61.1/test/form/samples/deopt-regexp-type/_expected.js000066400000000000000000000004161415504077600243760ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/deopt-regexp-type/main.js000066400000000000000000000004161415504077600233620ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/deopt-string-concatenation/000077500000000000000000000000001415504077600237575ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deopt-string-concatenation/_config.js000066400000000000000000000002011415504077600257120ustar00rootroot00000000000000module.exports = { description: 'deoptimize concatenation when used as an expression statement to better support es5-shim' }; rollup-2.61.1/test/form/samples/deopt-string-concatenation/_expected.js000066400000000000000000000004111415504077600262510ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/deopt-string-concatenation/main.js000066400000000000000000000004111415504077600252350ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/deoptimize-var-in-hoisted-scopes/000077500000000000000000000000001415504077600250075ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deoptimize-var-in-hoisted-scopes/_config.js000066400000000000000000000001221415504077600267440ustar00rootroot00000000000000module.exports = { description: 'deoptimizes var variables in hoisted scopes' }; rollup-2.61.1/test/form/samples/deoptimize-var-in-hoisted-scopes/_expected.js000066400000000000000000000003751415504077600273120ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/deoptimize-var-in-hoisted-scopes/main.js000066400000000000000000000003751415504077600262760ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/deprecated/000077500000000000000000000000001415504077600206155ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/configure-asset-url/000077500000000000000000000000001415504077600245135ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/configure-asset-url/_config.js000066400000000000000000000016511415504077600264600ustar00rootroot00000000000000module.exports = { description: 'allows to configure asset urls', expectedWarnings: ['DEPRECATED_FEATURE'], options: { strictDeprecations: false, plugins: [ { resolveId(id) { if (id.endsWith('solved')) { return id; } }, load(id) { if (id.endsWith('solved')) { const assetId = this.emitAsset(`asset-${id}.txt`, `Asset for: ${id}`); return `export default import.meta.ROLLUP_ASSET_URL_${assetId};`; } }, resolveAssetUrl({ chunkId, moduleId, assetFileName, relativeAssetPath }) { if (!moduleId.endsWith('resolved')) { return `'${chunkId}:${moduleId .replace(/\\/g, '/') .split('/') .slice(-2) .join('/')}:${assetFileName}:${relativeAssetPath}'`; } return null; } }, { resolveAssetUrl({ moduleId }) { if (moduleId === 'resolved') { return `'resolved'`; } return null; } } ] } }; rollup-2.61.1/test/form/samples/deprecated/configure-asset-url/_expected/000077500000000000000000000000001415504077600264535ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/configure-asset-url/_expected/amd.js000066400000000000000000000005121415504077600275500ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; var asset1 = 'amd.js:solved:assets/asset-solved-28a7ac89.txt:assets/asset-solved-28a7ac89.txt'; var asset2 = 'resolved'; var asset3 = new URL(require.toUrl('./assets/asset-unresolved-8dcd7fca.txt'), document.baseURI).href; console.log(asset1, asset2, asset3); })); rollup-2.61.1/test/form/samples/deprecated/configure-asset-url/_expected/assets/000077500000000000000000000000001415504077600277555ustar00rootroot00000000000000asset-resolved-8bd22e6e.txt000066400000000000000000000000231415504077600346110ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/configure-asset-url/_expected/assetsAsset for: resolvedasset-solved-28a7ac89.txt000066400000000000000000000000211415504077600342050ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/configure-asset-url/_expected/assetsAsset for: solvedasset-unresolved-8dcd7fca.txt000066400000000000000000000000251415504077600353200ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/configure-asset-url/_expected/assetsAsset for: unresolvedrollup-2.61.1/test/form/samples/deprecated/configure-asset-url/_expected/cjs.js000066400000000000000000000007051415504077600275720ustar00rootroot00000000000000'use strict'; var asset1 = 'cjs.js:solved:assets/asset-solved-28a7ac89.txt:assets/asset-solved-28a7ac89.txt'; var asset2 = 'resolved'; var asset3 = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/asset-unresolved-8dcd7fca.txt').href : new URL('assets/asset-unresolved-8dcd7fca.txt', document.currentScript && document.currentScript.src || document.baseURI).href); console.log(asset1, asset2, asset3); rollup-2.61.1/test/form/samples/deprecated/configure-asset-url/_expected/es.js000066400000000000000000000003641415504077600274230ustar00rootroot00000000000000var asset1 = 'es.js:solved:assets/asset-solved-28a7ac89.txt:assets/asset-solved-28a7ac89.txt'; var asset2 = 'resolved'; var asset3 = new URL('assets/asset-unresolved-8dcd7fca.txt', import.meta.url).href; console.log(asset1, asset2, asset3); rollup-2.61.1/test/form/samples/deprecated/configure-asset-url/_expected/iife.js000066400000000000000000000005311415504077600277240ustar00rootroot00000000000000(function () { 'use strict'; var asset1 = 'iife.js:solved:assets/asset-solved-28a7ac89.txt:assets/asset-solved-28a7ac89.txt'; var asset2 = 'resolved'; var asset3 = new URL('assets/asset-unresolved-8dcd7fca.txt', document.currentScript && document.currentScript.src || document.baseURI).href; console.log(asset1, asset2, asset3); })(); rollup-2.61.1/test/form/samples/deprecated/configure-asset-url/_expected/system.js000066400000000000000000000005711415504077600303400ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { var asset1 = 'system.js:solved:assets/asset-solved-28a7ac89.txt:assets/asset-solved-28a7ac89.txt'; var asset2 = 'resolved'; var asset3 = new URL('assets/asset-unresolved-8dcd7fca.txt', module.meta.url).href; console.log(asset1, asset2, asset3); }) }; })); rollup-2.61.1/test/form/samples/deprecated/configure-asset-url/_expected/umd.js000066400000000000000000000012301415504077600275720ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var asset1 = 'umd.js:solved:assets/asset-solved-28a7ac89.txt:assets/asset-solved-28a7ac89.txt'; var asset2 = 'resolved'; var asset3 = (typeof document === 'undefined' && typeof location === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/asset-unresolved-8dcd7fca.txt').href : new URL('assets/asset-unresolved-8dcd7fca.txt', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); console.log(asset1, asset2, asset3); })); rollup-2.61.1/test/form/samples/deprecated/configure-asset-url/main.js000066400000000000000000000002031415504077600257700ustar00rootroot00000000000000import asset1 from 'solved'; import asset2 from 'resolved'; import asset3 from 'unresolved'; console.log(asset1, asset2, asset3); rollup-2.61.1/test/form/samples/deprecated/dynamic-import-inlining-array/000077500000000000000000000000001415504077600264725ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/dynamic-import-inlining-array/_config.js000066400000000000000000000003071415504077600304340ustar00rootroot00000000000000module.exports = { description: 'supports an array with a single entry when inlining dynamic imports', options: { strictDeprecations: false, inlineDynamicImports: true, input: ['main'] } }; rollup-2.61.1/test/form/samples/deprecated/dynamic-import-inlining-array/_expected.js000066400000000000000000000002611415504077600307670ustar00rootroot00000000000000const bar = 2; Promise.resolve().then(function () { return foo$1; }); const foo = 1; var foo$1 = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo }); export { bar }; rollup-2.61.1/test/form/samples/deprecated/dynamic-import-inlining-array/foo.js000066400000000000000000000000251415504077600276100ustar00rootroot00000000000000export const foo = 1;rollup-2.61.1/test/form/samples/deprecated/dynamic-import-inlining-array/main.js000066400000000000000000000000521415504077600277510ustar00rootroot00000000000000export const bar = 2; import('./foo.js'); rollup-2.61.1/test/form/samples/deprecated/dynamic-import-inlining/000077500000000000000000000000001415504077600253565ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/dynamic-import-inlining/_config.js000066400000000000000000000002101415504077600273110ustar00rootroot00000000000000module.exports = { description: 'dynamic import inlining', options: { strictDeprecations: false, inlineDynamicImports: true } }; rollup-2.61.1/test/form/samples/deprecated/dynamic-import-inlining/_expected.js000066400000000000000000000002611415504077600276530ustar00rootroot00000000000000const bar = 2; Promise.resolve().then(function () { return foo$1; }); const foo = 1; var foo$1 = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo }); export { bar }; rollup-2.61.1/test/form/samples/deprecated/dynamic-import-inlining/foo.js000066400000000000000000000000251415504077600264740ustar00rootroot00000000000000export const foo = 1;rollup-2.61.1/test/form/samples/deprecated/dynamic-import-inlining/main.js000066400000000000000000000000521415504077600266350ustar00rootroot00000000000000export const bar = 2; import('./foo.js'); rollup-2.61.1/test/form/samples/deprecated/emit-asset-hacky/000077500000000000000000000000001415504077600237655ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/emit-asset-hacky/_config.js000066400000000000000000000006361415504077600257340ustar00rootroot00000000000000module.exports = { description: 'supports emitting assets in a hacky way by editing the bundle object', expectedWarnings: ['DEPRECATED_FEATURE'], options: { strictDeprecations: false, plugins: { generateBundle(options, outputBundle) { const file = { fileName: 'my-hacky-asset.txt', isAsset: true, source: 'My Hacky Source' }; outputBundle[file.fileName] = file; } } } }; rollup-2.61.1/test/form/samples/deprecated/emit-asset-hacky/_expected/000077500000000000000000000000001415504077600257255ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/emit-asset-hacky/_expected/amd.js000066400000000000000000000001011415504077600270140ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main'); })); rollup-2.61.1/test/form/samples/deprecated/emit-asset-hacky/_expected/cjs.js000066400000000000000000000000441415504077600270400ustar00rootroot00000000000000'use strict'; console.log('main'); rollup-2.61.1/test/form/samples/deprecated/emit-asset-hacky/_expected/es.js000066400000000000000000000000251415504077600266670ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/form/samples/deprecated/emit-asset-hacky/_expected/iife.js000066400000000000000000000000741415504077600272000ustar00rootroot00000000000000(function () { 'use strict'; console.log('main'); })(); rollup-2.61.1/test/form/samples/deprecated/emit-asset-hacky/_expected/my-hacky-asset.txt000066400000000000000000000000171415504077600313230ustar00rootroot00000000000000My Hacky Sourcerollup-2.61.1/test/form/samples/deprecated/emit-asset-hacky/_expected/system.js000066400000000000000000000001761415504077600276130ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-2.61.1/test/form/samples/deprecated/emit-asset-hacky/_expected/umd.js000066400000000000000000000002371415504077600270520ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log('main'); })); rollup-2.61.1/test/form/samples/deprecated/emit-asset-hacky/main.js000066400000000000000000000000251415504077600252440ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/form/samples/deprecated/emit-asset/000077500000000000000000000000001415504077600226705ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/emit-asset/_config.js000066400000000000000000000022511415504077600246320ustar00rootroot00000000000000const assert = require('assert'); const fs = require('fs'); const path = require('path'); module.exports = { description: 'supports emitting assets from plugin hooks', expectedWarnings: ['DEPRECATED_FEATURE'], options: { strictDeprecations: false, plugins: { 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_ASSET_URL_${this.emitAsset( path.basename(id), fs.readFileSync(id) )};`; } }, generateBundle(options, outputBundle) { const keys = Object.keys(outputBundle); assert.strictEqual(keys.length, 2); assert.strictEqual(keys[0], 'assets/logo-25585ac1.svg'); const asset = outputBundle[keys[0]]; assert.strictEqual(asset.fileName, 'assets/logo-25585ac1.svg'); assert.strictEqual(asset.isAsset, true); assert.strictEqual(asset.type, 'asset'); assert.ok( asset.source.equals(fs.readFileSync(path.resolve(__dirname, 'logo.svg'))), 'asset has correct source' ); assert.ok(keys[1].endsWith('.js'), `${keys[1]} ends with ".js"`); } } } }; rollup-2.61.1/test/form/samples/deprecated/emit-asset/_expected/000077500000000000000000000000001415504077600246305ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/emit-asset/_expected/amd.js000066400000000000000000000005641415504077600257340ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; var logo = new URL(require.toUrl('./assets/logo-25585ac1.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-2.61.1/test/form/samples/deprecated/emit-asset/_expected/assets/000077500000000000000000000000001415504077600261325ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/emit-asset/_expected/assets/logo-25585ac1.svg000066400000000000000000000064331415504077600306740ustar00rootroot00000000000000 rollup-2.61.1/test/form/samples/deprecated/emit-asset/_expected/cjs.js000066400000000000000000000007351415504077600257520ustar00rootroot00000000000000'use strict'; var logo = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/logo-25585ac1.svg').href : new URL('assets/logo-25585ac1.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-2.61.1/test/form/samples/deprecated/emit-asset/_expected/es.js000066400000000000000000000004311415504077600255730ustar00rootroot00000000000000var logo = new URL('assets/logo-25585ac1.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-2.61.1/test/form/samples/deprecated/emit-asset/_expected/iife.js000066400000000000000000000006021415504077600261000ustar00rootroot00000000000000(function () { 'use strict'; var logo = new URL('assets/logo-25585ac1.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-2.61.1/test/form/samples/deprecated/emit-asset/_expected/system.js000066400000000000000000000006541415504077600265170ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { var logo = new URL('assets/logo-25585ac1.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-2.61.1/test/form/samples/deprecated/emit-asset/_expected/umd.js000066400000000000000000000012661415504077600257600ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var logo = (typeof document === 'undefined' && typeof location === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/logo-25585ac1.svg').href : new URL('assets/logo-25585ac1.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-2.61.1/test/form/samples/deprecated/emit-asset/index-amd.html000066400000000000000000000003411415504077600254220ustar00rootroot00000000000000 AMD rollup-2.61.1/test/form/samples/deprecated/emit-asset/index-cjs.html000066400000000000000000000002511415504077600254400ustar00rootroot00000000000000 CommonJS rollup-2.61.1/test/form/samples/deprecated/emit-asset/index-es.html000066400000000000000000000002671415504077600252770ustar00rootroot00000000000000 ES Module rollup-2.61.1/test/form/samples/deprecated/emit-asset/index-iife.html000066400000000000000000000002461415504077600256010ustar00rootroot00000000000000 IIFE rollup-2.61.1/test/form/samples/deprecated/emit-asset/index-system.html000066400000000000000000000004041415504077600262050ustar00rootroot00000000000000 SystemJS rollup-2.61.1/test/form/samples/deprecated/emit-asset/index-umd-amd.html000066400000000000000000000003471415504077600262130ustar00rootroot00000000000000 UMD (AMD) rollup-2.61.1/test/form/samples/deprecated/emit-asset/index-umd-iife-queryparam.html000066400000000000000000000003041415504077600305430ustar00rootroot00000000000000 UMD (IIFE) + query parameter rollup-2.61.1/test/form/samples/deprecated/emit-asset/index-umd-iife.html000066400000000000000000000002531415504077600263620ustar00rootroot00000000000000 UMD (IIFE) rollup-2.61.1/test/form/samples/deprecated/emit-asset/logo.svg000066400000000000000000000064331415504077600243570ustar00rootroot00000000000000 rollup-2.61.1/test/form/samples/deprecated/emit-asset/main.js000066400000000000000000000003621415504077600241530ustar00rootroot00000000000000import 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-2.61.1/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/000077500000000000000000000000001415504077600273205ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_config.js000066400000000000000000000002401415504077600312560ustar00rootroot00000000000000module.exports = { description: 'completely removes tree-shaken dynamic imports ', options: { strictDeprecations: false, inlineDynamicImports: true } }; rollup-2.61.1/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/000077500000000000000000000000001415504077600312605ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/amd.js000066400000000000000000000001011415504077600323470ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main'); })); rollup-2.61.1/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/cjs.js000066400000000000000000000000441415504077600323730ustar00rootroot00000000000000'use strict'; console.log('main'); rollup-2.61.1/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/es.js000066400000000000000000000000251415504077600322220ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/iife.js000066400000000000000000000000741415504077600325330ustar00rootroot00000000000000(function () { 'use strict'; console.log('main'); })(); rollup-2.61.1/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/system.js000066400000000000000000000001761415504077600331460ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-2.61.1/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_expected/umd.js000066400000000000000000000002371415504077600324050ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log('main'); })); rollup-2.61.1/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/dynamic.js000066400000000000000000000000611415504077600312770ustar00rootroot00000000000000console.log('dynamic'); export var dynamic = 42; rollup-2.61.1/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/main.js000066400000000000000000000001021415504077600305730ustar00rootroot00000000000000console.log('main'); const getFoo = () => import('./dynamic.js'); rollup-2.61.1/test/form/samples/deprecated/interop-boolean-per-dependency/000077500000000000000000000000001415504077600266125ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/interop-boolean-per-dependency/_config.js000066400000000000000000000005261415504077600305570ustar00rootroot00000000000000module.exports = { description: 'allows to configure the interop type per external dependency for boolean values', options: { strictDeprecations: false, external: id => id.startsWith('external'), output: { interop(id) { return JSON.parse(id.split('-')[1]); }, globals(id) { return id.replace('-', ''); } } } }; rollup-2.61.1/test/form/samples/deprecated/interop-boolean-per-dependency/_expected/000077500000000000000000000000001415504077600305525ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/interop-boolean-per-dependency/_expected/amd.js000066400000000000000000000022531415504077600316530ustar00rootroot00000000000000define(['require', 'external-false', 'external-true'], (function (require, fooFalse, fooTrue) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? 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 fooTrue__default = /*#__PURE__*/_interopDefaultLegacy(fooTrue); var fooTrue__namespace = /*#__PURE__*/_interopNamespace(fooTrue); console.log(fooFalse, fooFalse.barFalse, fooFalse); console.log(fooTrue__default["default"], fooTrue.barTrue, fooTrue__namespace); new Promise(function (resolve, reject) { require(['external-false'], resolve, reject); }).then(console.log); new Promise(function (resolve, reject) { require(['external-true'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }).then(console.log); })); rollup-2.61.1/test/form/samples/deprecated/interop-boolean-per-dependency/_expected/cjs.js000066400000000000000000000021131415504077600316640ustar00rootroot00000000000000'use strict'; var fooFalse = require('external-false'); var fooTrue = require('external-true'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? 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 fooTrue__default = /*#__PURE__*/_interopDefaultLegacy(fooTrue); var fooTrue__namespace = /*#__PURE__*/_interopNamespace(fooTrue); console.log(fooFalse, fooFalse.barFalse, fooFalse); console.log(fooTrue__default["default"], fooTrue.barTrue, fooTrue__namespace); Promise.resolve().then(function () { return require('external-false'); }).then(console.log); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('external-true')); }).then(console.log); rollup-2.61.1/test/form/samples/deprecated/interop-boolean-per-dependency/_expected/es.js000066400000000000000000000006151415504077600315210ustar00rootroot00000000000000import * as fooFalse from 'external-false'; import fooFalse__default, { barFalse } from 'external-false'; import * as fooTrue from 'external-true'; import fooTrue__default, { barTrue } from 'external-true'; console.log(fooFalse__default, barFalse, fooFalse); console.log(fooTrue__default, barTrue, fooTrue); import('external-false').then(console.log); import('external-true').then(console.log); rollup-2.61.1/test/form/samples/deprecated/interop-boolean-per-dependency/_expected/iife.js000066400000000000000000000017211415504077600320250ustar00rootroot00000000000000(function (fooFalse, fooTrue) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? 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 fooTrue__default = /*#__PURE__*/_interopDefaultLegacy(fooTrue); var fooTrue__namespace = /*#__PURE__*/_interopNamespace(fooTrue); console.log(fooFalse, fooFalse.barFalse, fooFalse); console.log(fooTrue__default["default"], fooTrue.barTrue, fooTrue__namespace); import('external-false').then(console.log); import('external-true').then(console.log); })(externalfalse, externaltrue); rollup-2.61.1/test/form/samples/deprecated/interop-boolean-per-dependency/_expected/system.js000066400000000000000000000012661415504077600324410ustar00rootroot00000000000000System.register(['external-false', 'external-true'], (function (exports, module) { 'use strict'; var fooFalse__default, barFalse, fooFalse, fooTrue__default, barTrue, fooTrue; return { setters: [function (module) { fooFalse__default = module["default"]; barFalse = module.barFalse; fooFalse = module; }, function (module) { fooTrue__default = module["default"]; barTrue = module.barTrue; fooTrue = module; }], execute: (function () { console.log(fooFalse__default, barFalse, fooFalse); console.log(fooTrue__default, barTrue, fooTrue); module.import('external-false').then(console.log); module.import('external-true').then(console.log); }) }; })); rollup-2.61.1/test/form/samples/deprecated/interop-boolean-per-dependency/_expected/umd.js000066400000000000000000000025001415504077600316720ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('external-false'), require('external-true')) : typeof define === 'function' && define.amd ? define(['external-false', 'external-true'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.externalfalse, global.externaltrue)); })(this, (function (fooFalse, fooTrue) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? 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 fooTrue__default = /*#__PURE__*/_interopDefaultLegacy(fooTrue); var fooTrue__namespace = /*#__PURE__*/_interopNamespace(fooTrue); console.log(fooFalse, fooFalse.barFalse, fooFalse); console.log(fooTrue__default["default"], fooTrue.barTrue, fooTrue__namespace); import('external-false').then(console.log); import('external-true').then(console.log); })); rollup-2.61.1/test/form/samples/deprecated/interop-boolean-per-dependency/main.js000066400000000000000000000005751415504077600301030ustar00rootroot00000000000000import fooFalse, { barFalse } from 'external-false'; import fooTrue, { barTrue } from 'external-true'; import * as externalFalse from 'external-false'; import * as externalTrue from 'external-true'; console.log(fooFalse, barFalse, externalFalse); console.log(fooTrue, barTrue, externalTrue); import('external-false').then(console.log); import('external-true').then(console.log); rollup-2.61.1/test/form/samples/deprecated/interop-boolean-per-reexported-dependency/000077500000000000000000000000001415504077600307715ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/interop-boolean-per-reexported-dependency/_config.js000066400000000000000000000005411415504077600327330ustar00rootroot00000000000000module.exports = { description: 'allows to configure the interop type per reexported external dependency', options: { strictDeprecations: false, external: id => id.startsWith('external'), output: { interop(id) { return JSON.parse(id.split('-')[1]); }, globals(id) { return id.replace('-', ''); }, name: 'bundle' } } }; rollup-2.61.1/test/form/samples/deprecated/interop-boolean-per-reexported-dependency/_expected/000077500000000000000000000000001415504077600327315ustar00rootroot00000000000000amd.js000066400000000000000000000025571415504077600337620ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/interop-boolean-per-reexported-dependency/_expecteddefine(['exports', 'external-false', 'external-true'], (function (exports, externalFalse, externalTrue) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? 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 externalTrue__namespace = /*#__PURE__*/_interopNamespace(externalTrue); var externalTrue__default = /*#__PURE__*/_interopDefaultLegacy(externalTrue); Object.defineProperty(exports, 'barFalse', { enumerable: true, get: function () { return externalFalse.barFalse; } }); exports.externalFalse = externalFalse; exports.fooFalse = externalFalse; Object.defineProperty(exports, 'barTrue', { enumerable: true, get: function () { return externalTrue.barTrue; } }); exports.externalTrue = externalTrue__namespace; Object.defineProperty(exports, 'fooTrue', { enumerable: true, get: function () { return externalTrue__default["default"]; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); cjs.js000066400000000000000000000024701415504077600337720ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/interop-boolean-per-reexported-dependency/_expected'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var externalFalse = require('external-false'); var externalTrue = require('external-true'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? 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 externalTrue__namespace = /*#__PURE__*/_interopNamespace(externalTrue); var externalTrue__default = /*#__PURE__*/_interopDefaultLegacy(externalTrue); Object.defineProperty(exports, 'barFalse', { enumerable: true, get: function () { return externalFalse.barFalse; } }); exports.externalFalse = externalFalse; exports.fooFalse = externalFalse; Object.defineProperty(exports, 'barTrue', { enumerable: true, get: function () { return externalTrue.barTrue; } }); exports.externalTrue = externalTrue__namespace; Object.defineProperty(exports, 'fooTrue', { enumerable: true, get: function () { return externalTrue__default["default"]; } }); rollup-2.61.1/test/form/samples/deprecated/interop-boolean-per-reexported-dependency/_expected/es.js000066400000000000000000000004201415504077600336720ustar00rootroot00000000000000import * as externalFalse from 'external-false'; export { externalFalse }; export { barFalse, default as fooFalse } from 'external-false'; import * as externalTrue from 'external-true'; export { externalTrue }; export { barTrue, default as fooTrue } from 'external-true'; iife.js000066400000000000000000000025701415504077600341300ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/interop-boolean-per-reexported-dependency/_expectedvar bundle = (function (exports, externalFalse, externalTrue) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? 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 externalTrue__namespace = /*#__PURE__*/_interopNamespace(externalTrue); var externalTrue__default = /*#__PURE__*/_interopDefaultLegacy(externalTrue); Object.defineProperty(exports, 'barFalse', { enumerable: true, get: function () { return externalFalse.barFalse; } }); exports.externalFalse = externalFalse; exports.fooFalse = externalFalse; Object.defineProperty(exports, 'barTrue', { enumerable: true, get: function () { return externalTrue.barTrue; } }); exports.externalTrue = externalTrue__namespace; Object.defineProperty(exports, 'fooTrue', { enumerable: true, get: function () { return externalTrue__default["default"]; } }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, externalfalse, externaltrue); system.js000066400000000000000000000006221415504077600345340ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/interop-boolean-per-reexported-dependency/_expectedSystem.register('bundle', ['external-false', 'external-true'], (function (exports) { 'use strict'; return { setters: [function (module) { exports({ barFalse: module.barFalse, externalFalse: module, fooFalse: module["default"] }); }, function (module) { exports({ barTrue: module.barTrue, externalTrue: module, fooTrue: module["default"] }); }], execute: (function () { }) }; })); umd.js000066400000000000000000000033541415504077600340020ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/interop-boolean-per-reexported-dependency/_expected(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('external-false'), require('external-true')) : typeof define === 'function' && define.amd ? define(['exports', 'external-false', 'external-true'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bundle = {}, global.externalfalse, global.externaltrue)); })(this, (function (exports, externalFalse, externalTrue) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? 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 externalTrue__namespace = /*#__PURE__*/_interopNamespace(externalTrue); var externalTrue__default = /*#__PURE__*/_interopDefaultLegacy(externalTrue); Object.defineProperty(exports, 'barFalse', { enumerable: true, get: function () { return externalFalse.barFalse; } }); exports.externalFalse = externalFalse; exports.fooFalse = externalFalse; Object.defineProperty(exports, 'barTrue', { enumerable: true, get: function () { return externalTrue.barTrue; } }); exports.externalTrue = externalTrue__namespace; Object.defineProperty(exports, 'fooTrue', { enumerable: true, get: function () { return externalTrue__default["default"]; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/deprecated/interop-boolean-per-reexported-dependency/main.js000066400000000000000000000003351415504077600322540ustar00rootroot00000000000000export { default as fooFalse, barFalse } from 'external-false'; export { default as fooTrue, barTrue } from 'external-true'; export * as externalFalse from 'external-false'; export * as externalTrue from 'external-true'; rollup-2.61.1/test/form/samples/deprecated/interop-false-reexport/000077500000000000000000000000001415504077600252335ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/interop-false-reexport/_config.js000066400000000000000000000003431415504077600271750ustar00rootroot00000000000000module.exports = { description: 'reexports with interop: false', options: { strictDeprecations: false, external: ['external'], output: { globals: { external: 'external' }, name: 'foo', interop: false } } }; rollup-2.61.1/test/form/samples/deprecated/interop-false-reexport/_expected/000077500000000000000000000000001415504077600271735ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/interop-false-reexport/_expected/amd.js000066400000000000000000000004311415504077600302700ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, external) { 'use strict'; exports.p = external; Object.defineProperty(exports, 'q', { enumerable: true, get: function () { return external.p; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/deprecated/interop-false-reexport/_expected/cjs.js000066400000000000000000000003621415504077600303110ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var external = require('external'); exports.p = external; Object.defineProperty(exports, 'q', { enumerable: true, get: function () { return external.p; } }); rollup-2.61.1/test/form/samples/deprecated/interop-false-reexport/_expected/es.js000066400000000000000000000000611415504077600301350ustar00rootroot00000000000000export { default as p, p as q } from 'external'; rollup-2.61.1/test/form/samples/deprecated/interop-false-reexport/_expected/iife.js000066400000000000000000000004431415504077600304460ustar00rootroot00000000000000var foo = (function (exports, external) { 'use strict'; exports.p = external; Object.defineProperty(exports, 'q', { enumerable: true, get: function () { return external.p; } }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, external); rollup-2.61.1/test/form/samples/deprecated/interop-false-reexport/_expected/system.js000066400000000000000000000003301415504077600310510ustar00rootroot00000000000000System.register('foo', ['external'], (function (exports) { 'use strict'; return { setters: [function (module) { exports({ p: module["default"], q: module.p }); }], execute: (function () { }) }; })); rollup-2.61.1/test/form/samples/deprecated/interop-false-reexport/_expected/umd.js000066400000000000000000000011271415504077600303170ustar00rootroot00000000000000(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.foo = {}, global.external)); })(this, (function (exports, external) { 'use strict'; exports.p = external; Object.defineProperty(exports, 'q', { enumerable: true, get: function () { return external.p; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/deprecated/interop-false-reexport/main.js000066400000000000000000000001131415504077600265100ustar00rootroot00000000000000export { p as q } from 'external'; export { default as p } from 'external';rollup-2.61.1/test/form/samples/deprecated/interop-false/000077500000000000000000000000001415504077600233655ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/interop-false/_config.js000066400000000000000000000004231415504077600253260ustar00rootroot00000000000000module.exports = { description: 'getInterop with interop: false', expectedWarnings: ['UNUSED_EXTERNAL_IMPORT'], options: { strictDeprecations: false, external: ['core/view'], output: { globals: { 'core/view': 'View' }, name: 'foo', interop: false } } }; rollup-2.61.1/test/form/samples/deprecated/interop-false/_expected/000077500000000000000000000000001415504077600253255ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/interop-false/_expected/amd.js000066400000000000000000000001521415504077600264220ustar00rootroot00000000000000define(['core/view'], (function (View) { 'use strict'; var main = View.extend({}); return main; })); rollup-2.61.1/test/form/samples/deprecated/interop-false/_expected/cjs.js000066400000000000000000000001451415504077600264420ustar00rootroot00000000000000'use strict'; var View = require('core/view'); var main = View.extend({}); module.exports = main; rollup-2.61.1/test/form/samples/deprecated/interop-false/_expected/es.js000066400000000000000000000001301415504077600262640ustar00rootroot00000000000000import View from 'core/view'; var main = View.extend({}); export { main as default }; rollup-2.61.1/test/form/samples/deprecated/interop-false/_expected/iife.js000066400000000000000000000001441415504077600265760ustar00rootroot00000000000000var foo = (function (View) { 'use strict'; var main = View.extend({}); return main; })(View); rollup-2.61.1/test/form/samples/deprecated/interop-false/_expected/system.js000066400000000000000000000004001415504077600272010ustar00rootroot00000000000000System.register('foo', ['core/view'], (function (exports) { 'use strict'; var View; return { setters: [function (module) { View = module["default"]; }], execute: (function () { var main = exports('default', View.extend({})); }) }; })); rollup-2.61.1/test/form/samples/deprecated/interop-false/_expected/umd.js000066400000000000000000000006531415504077600264540ustar00rootroot00000000000000(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('core/view')) : typeof define === 'function' && define.amd ? define(['core/view'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.foo = factory(global.View)); })(this, (function (View) { 'use strict'; var main = View.extend({}); return main; })); rollup-2.61.1/test/form/samples/deprecated/interop-false/main.js000066400000000000000000000001101415504077600246370ustar00rootroot00000000000000import View, { name } from 'core/view'; export default View.extend({}); rollup-2.61.1/test/form/samples/deprecated/interop-per-dependency-no-live-binding-boolean/000077500000000000000000000000001415504077600315715ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/interop-per-dependency-no-live-binding-boolean/_config.js000066400000000000000000000007641415504077600335420ustar00rootroot00000000000000const checkedIds = new Set(); module.exports = { description: 'allows to configure the interop type per external dependency for boolean values', options: { strictDeprecations: false, external: id => id.startsWith('external'), output: { externalLiveBindings: false, interop(id) { if (checkedIds.has(id)) { throw new Error(`Interop for id ${id} has been requested twice.`); } checkedIds.add(id); return JSON.parse(id.split('-')[1]); }, format: 'cjs' } } }; _expected.js000066400000000000000000000015611415504077600340130ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/interop-per-dependency-no-live-binding-boolean'use strict'; var fooFalse = require('external-false'); var fooTrue = require('external-true'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; } function _interopNamespace(e) { if (e && e.__esModule) return e; var n = Object.create(null); if (e) { for (var k in e) { n[k] = e[k]; } } n["default"] = e; return Object.freeze(n); } var fooTrue__default = /*#__PURE__*/_interopDefaultLegacy(fooTrue); var fooTrue__namespace = /*#__PURE__*/_interopNamespace(fooTrue); console.log(fooFalse, fooFalse.barFalse, fooFalse); console.log(fooTrue__default, fooTrue.barTrue, fooTrue__namespace); Promise.resolve().then(function () { return require('external-false'); }).then(console.log); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('external-true')); }).then(console.log); rollup-2.61.1/test/form/samples/deprecated/interop-per-dependency-no-live-binding-boolean/main.js000066400000000000000000000005751415504077600330620ustar00rootroot00000000000000import fooFalse, { barFalse } from 'external-false'; import fooTrue, { barTrue } from 'external-true'; import * as externalFalse from 'external-false'; import * as externalTrue from 'external-true'; console.log(fooFalse, barFalse, externalFalse); console.log(fooTrue, barTrue, externalTrue); import('external-false').then(console.log); import('external-true').then(console.log); rollup-2.61.1/test/form/samples/deprecated/nested-inlined-dynamic-import/000077500000000000000000000000001415504077600264515ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/nested-inlined-dynamic-import/_config.js000066400000000000000000000002561415504077600304160ustar00rootroot00000000000000module.exports = { description: 'deconflicts variables when nested dynamic imports are inlined', options: { strictDeprecations: false, inlineDynamicImports: true } }; rollup-2.61.1/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/000077500000000000000000000000001415504077600304115ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/amd.js000066400000000000000000000004611415504077600315110ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/cjs.js000066400000000000000000000004121415504077600315230ustar00rootroot00000000000000'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-2.61.1/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/es.js000066400000000000000000000003731415504077600313610ustar00rootroot00000000000000async 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-2.61.1/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/iife.js000066400000000000000000000004541415504077600316660ustar00rootroot00000000000000(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-2.61.1/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/system.js000066400000000000000000000006021415504077600322710ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/deprecated/nested-inlined-dynamic-import/_expected/umd.js000066400000000000000000000006171415504077600315400ustar00rootroot00000000000000(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-2.61.1/test/form/samples/deprecated/nested-inlined-dynamic-import/foo.js000066400000000000000000000000311415504077600275640ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/form/samples/deprecated/nested-inlined-dynamic-import/main.js000066400000000000000000000001671415504077600277370ustar00rootroot00000000000000async function main() { const foo = 1; const ns = await import('./foo.js'); console.log(ns.value + foo); } main(); rollup-2.61.1/test/form/samples/deprecated/prefer-const/000077500000000000000000000000001415504077600232245ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/prefer-const/_config.js000066400000000000000000000003621415504077600251670ustar00rootroot00000000000000module.exports = { description: 'uses const instead of var if specified (#653)', options: { strictDeprecations: false, external: ['other'], output: { globals: { other: 'other' }, name: 'myBundle', preferConst: true } } }; rollup-2.61.1/test/form/samples/deprecated/prefer-const/_expected/000077500000000000000000000000001415504077600251645ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/prefer-const/_expected/amd.js000066400000000000000000000004301415504077600262600ustar00rootroot00000000000000define(['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-2.61.1/test/form/samples/deprecated/prefer-const/_expected/cjs.js000066400000000000000000000004141415504077600263000ustar00rootroot00000000000000'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-2.61.1/test/form/samples/deprecated/prefer-const/_expected/es.js000066400000000000000000000003721415504077600261330ustar00rootroot00000000000000import { 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-2.61.1/test/form/samples/deprecated/prefer-const/_expected/iife.js000066400000000000000000000004361415504077600264410ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/deprecated/prefer-const/_expected/system.js000066400000000000000000000006701415504077600270510ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/deprecated/prefer-const/_expected/umd.js000066400000000000000000000011331415504077600263050ustar00rootroot00000000000000(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-2.61.1/test/form/samples/deprecated/prefer-const/main.js000066400000000000000000000002361415504077600245070ustar00rootroot00000000000000import { name } from 'other'; import * as namespace from './namespace.js'; console.log( Object.keys( namespace ) ); console.log( name ); export default 42; rollup-2.61.1/test/form/samples/deprecated/prefer-const/namespace.js000066400000000000000000000000501415504077600255110ustar00rootroot00000000000000export const a = 1; export const b = 2; rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import-array/000077500000000000000000000000001415504077600266445ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import-array/_config.js000066400000000000000000000004621415504077600306100ustar00rootroot00000000000000module.exports = { description: 'prunes pure unused external imports ([#1352])', expectedWarnings: ['DEPRECATED_FEATURE'], options: { strictDeprecations: false, external: ['external', 'other'], treeshake: { pureExternalModules: ['external'] }, output: { globals: { other: 'other' } } } }; rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/000077500000000000000000000000001415504077600306045ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/amd.js000066400000000000000000000000741415504077600317040ustar00rootroot00000000000000define(['other'], (function (other) { 'use strict'; })); rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/cjs.js000066400000000000000000000000421415504077600317150ustar00rootroot00000000000000'use strict'; require('other'); rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/es.js000066400000000000000000000000201415504077600315410ustar00rootroot00000000000000import 'other'; rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/iife.js000066400000000000000000000000471415504077600320570ustar00rootroot00000000000000(function () { 'use strict'; })(); rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/system.js000066400000000000000000000002131415504077600324620ustar00rootroot00000000000000System.register(['other'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { }) }; })); rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/umd.js000066400000000000000000000002251415504077600317260ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(['other'], factory) : factory(); })((function () { 'use strict'; })); rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import-array/main.js000066400000000000000000000001671415504077600301320ustar00rootroot00000000000000import { unused } from 'external'; import { notused } from 'other'; function alsoUnused () { unused(); notused(); } rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import-function/000077500000000000000000000000001415504077600273535ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import-function/_config.js000066400000000000000000000005151415504077600313160ustar00rootroot00000000000000module.exports = { description: 'prunes pure unused external imports ([#1352])', expectedWarnings: ['DEPRECATED_FEATURE', 'EMPTY_BUNDLE'], options: { strictDeprecations: false, external: ['external', 'other'], treeshake: { pureExternalModules: id => id === 'external' }, output: { globals: { other: 'other' } } } }; rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/000077500000000000000000000000001415504077600313135ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/amd.js000066400000000000000000000000741415504077600324130ustar00rootroot00000000000000define(['other'], (function (other) { 'use strict'; })); rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/cjs.js000066400000000000000000000000421415504077600324240ustar00rootroot00000000000000'use strict'; require('other'); rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/es.js000066400000000000000000000000201415504077600322500ustar00rootroot00000000000000import 'other'; rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/iife.js000066400000000000000000000000471415504077600325660ustar00rootroot00000000000000(function () { 'use strict'; })(); rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/system.js000066400000000000000000000002131415504077600331710ustar00rootroot00000000000000System.register(['other'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { }) }; })); rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/umd.js000066400000000000000000000002251415504077600324350ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(['other'], factory) : factory(); })((function () { 'use strict'; })); rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import-function/main.js000066400000000000000000000001671415504077600306410ustar00rootroot00000000000000import { unused } from 'external'; import { notused } from 'other'; function alsoUnused () { unused(); notused(); } rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import/000077500000000000000000000000001415504077600255305ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import/_config.js000066400000000000000000000004121415504077600274670ustar00rootroot00000000000000module.exports = { description: 'prunes pure unused external imports ([#1352])', expectedWarnings: ['DEPRECATED_FEATURE', 'EMPTY_BUNDLE'], options: { strictDeprecations: false, external: ['external', 'other'], treeshake: { pureExternalModules: true } } }; rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import/_expected/000077500000000000000000000000001415504077600274705ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import/_expected/amd.js000066400000000000000000000000541415504077600305660ustar00rootroot00000000000000define((function () { 'use strict'; })); rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import/_expected/cjs.js000066400000000000000000000000171415504077600306030ustar00rootroot00000000000000'use strict'; rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import/_expected/es.js000066400000000000000000000000011415504077600304240ustar00rootroot00000000000000 rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import/_expected/iife.js000066400000000000000000000000471415504077600307430ustar00rootroot00000000000000(function () { 'use strict'; })(); rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import/_expected/system.js000066400000000000000000000001471415504077600313540ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { }) }; })); rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import/_expected/umd.js000066400000000000000000000002121415504077600306060ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; })); rollup-2.61.1/test/form/samples/deprecated/prune-pure-unused-import/main.js000066400000000000000000000001121415504077600270040ustar00rootroot00000000000000import { unused } from 'external'; function alsoUnused () { unused(); } rollup-2.61.1/test/form/samples/duplicated-var-declarations/000077500000000000000000000000001415504077600240675ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/duplicated-var-declarations/_config.js000066400000000000000000000001311415504077600260240ustar00rootroot00000000000000module.exports = { description: 'does not remove duplicated var declarations (#716)' }; rollup-2.61.1/test/form/samples/duplicated-var-declarations/_expected/000077500000000000000000000000001415504077600260275ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/duplicated-var-declarations/_expected/amd.js000066400000000000000000000003161415504077600271260ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/duplicated-var-declarations/_expected/cjs.js000066400000000000000000000002531415504077600271440ustar00rootroot00000000000000'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-2.61.1/test/form/samples/duplicated-var-declarations/_expected/es.js000066400000000000000000000002341415504077600267730ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/duplicated-var-declarations/_expected/iife.js000066400000000000000000000003111415504077600272740ustar00rootroot00000000000000(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-2.61.1/test/form/samples/duplicated-var-declarations/_expected/system.js000066400000000000000000000004271415504077600277140ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/duplicated-var-declarations/_expected/umd.js000066400000000000000000000004541415504077600271550ustar00rootroot00000000000000(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-2.61.1/test/form/samples/duplicated-var-declarations/main.js000066400000000000000000000002341415504077600253500ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/dynamic-import-inlining-array/000077500000000000000000000000001415504077600243725ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/dynamic-import-inlining-array/_config.js000066400000000000000000000002661415504077600263400ustar00rootroot00000000000000module.exports = { description: 'supports an array with a single entry when inlining dynamic imports', options: { output: { inlineDynamicImports: true }, input: ['main'] } }; rollup-2.61.1/test/form/samples/dynamic-import-inlining-array/_expected.js000066400000000000000000000002611415504077600266670ustar00rootroot00000000000000const bar = 2; Promise.resolve().then(function () { return foo$1; }); const foo = 1; var foo$1 = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo }); export { bar }; rollup-2.61.1/test/form/samples/dynamic-import-inlining-array/foo.js000066400000000000000000000000251415504077600255100ustar00rootroot00000000000000export const foo = 1;rollup-2.61.1/test/form/samples/dynamic-import-inlining-array/main.js000066400000000000000000000000521415504077600256510ustar00rootroot00000000000000export const bar = 2; import('./foo.js'); rollup-2.61.1/test/form/samples/dynamic-import-inlining/000077500000000000000000000000001415504077600232565ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/dynamic-import-inlining/_config.js000066400000000000000000000001671415504077600252240ustar00rootroot00000000000000module.exports = { description: 'dynamic import inlining', options: { output: { inlineDynamicImports: true } } }; rollup-2.61.1/test/form/samples/dynamic-import-inlining/_expected.js000066400000000000000000000002611415504077600255530ustar00rootroot00000000000000const bar = 2; Promise.resolve().then(function () { return foo$1; }); const foo = 1; var foo$1 = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo }); export { bar }; rollup-2.61.1/test/form/samples/dynamic-import-inlining/foo.js000066400000000000000000000000251415504077600243740ustar00rootroot00000000000000export const foo = 1;rollup-2.61.1/test/form/samples/dynamic-import-inlining/main.js000066400000000000000000000000521415504077600245350ustar00rootroot00000000000000export const bar = 2; import('./foo.js'); rollup-2.61.1/test/form/samples/dynamic-import-this-arrow/000077500000000000000000000000001415504077600235465ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/dynamic-import-this-arrow/_config.js000066400000000000000000000004121415504077600255050ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'uses correct "this" in dynamic imports when using arrow functions', options: { external: ['input', 'output'], output: { generatedCode: { arrowFunctions: true }, name: 'bundle' } } }; rollup-2.61.1/test/form/samples/dynamic-import-this-arrow/_expected/000077500000000000000000000000001415504077600255065ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/dynamic-import-this-arrow/_expected/amd.js000066400000000000000000000015371415504077600266130ustar00rootroot00000000000000define(['require', 'exports', 'input'], (function (require, exports, input) { 'use strict'; function _interopNamespace(e) { if (e && e.__esModule) 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); } class Importer { constructor() { this.outputPath = input.outputPath; } getImport() { return new Promise((resolve, reject) => require([this.outputPath], m => resolve(/*#__PURE__*/_interopNamespace(m)), reject)); } } const promise = new Importer().getImport(); exports.promise = promise; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/dynamic-import-this-arrow/_expected/cjs.js000066400000000000000000000013571415504077600266310ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var input = require('input'); function _interopNamespace(e) { if (e && e.__esModule) 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); } class Importer { constructor() { this.outputPath = input.outputPath; } getImport() { return Promise.resolve().then(() => /*#__PURE__*/_interopNamespace(require(this.outputPath))); } } const promise = new Importer().getImport(); exports.promise = promise; rollup-2.61.1/test/form/samples/dynamic-import-this-arrow/_expected/es.js000066400000000000000000000003431415504077600264530ustar00rootroot00000000000000import { outputPath } from 'input'; class Importer { constructor() { this.outputPath = outputPath; } getImport() { return import(this.outputPath); } } const promise = new Importer().getImport(); export { promise }; rollup-2.61.1/test/form/samples/dynamic-import-this-arrow/_expected/iife.js000066400000000000000000000005621415504077600267630ustar00rootroot00000000000000var 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; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, input); rollup-2.61.1/test/form/samples/dynamic-import-this-arrow/_expected/system.js000066400000000000000000000006671415504077600274010ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/dynamic-import-this-arrow/_expected/umd.js000066400000000000000000000012421415504077600266300ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/dynamic-import-this-arrow/main.js000066400000000000000000000003251415504077600250300ustar00rootroot00000000000000import { outputPath } from 'input'; class Importer { constructor() { this.outputPath = outputPath; } getImport() { return import(this.outputPath); } } export const promise = new Importer().getImport(); rollup-2.61.1/test/form/samples/dynamic-import-this-function/000077500000000000000000000000001415504077600242415ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/dynamic-import-this-function/_config.js000066400000000000000000000004171415504077600262050ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'uses correct "this" in dynamic imports when not using arrow functions', options: { external: ['input', 'output'], output: { generatedCode: { arrowFunctions: false }, name: 'bundle' } } }; rollup-2.61.1/test/form/samples/dynamic-import-this-function/_expected/000077500000000000000000000000001415504077600262015ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/dynamic-import-this-function/_expected/amd.js000066400000000000000000000016571415504077600273110ustar00rootroot00000000000000define(['require', 'exports', 'input'], (function (require, exports, input) { 'use strict'; 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); } class Importer { constructor() { this.outputPath = input.outputPath; } getImport() { return (function (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }); })(this.outputPath); } } const promise = new Importer().getImport(); exports.promise = promise; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/dynamic-import-this-function/_expected/cjs.js000066400000000000000000000014711415504077600273210ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var input = require('input'); 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); } class Importer { constructor() { this.outputPath = input.outputPath; } getImport() { return (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(this.outputPath); } } const promise = new Importer().getImport(); exports.promise = promise; rollup-2.61.1/test/form/samples/dynamic-import-this-function/_expected/es.js000066400000000000000000000003431415504077600271460ustar00rootroot00000000000000import { outputPath } from 'input'; class Importer { constructor() { this.outputPath = outputPath; } getImport() { return import(this.outputPath); } } const promise = new Importer().getImport(); export { promise }; rollup-2.61.1/test/form/samples/dynamic-import-this-function/_expected/iife.js000066400000000000000000000005621415504077600274560ustar00rootroot00000000000000var 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; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, input); rollup-2.61.1/test/form/samples/dynamic-import-this-function/_expected/system.js000066400000000000000000000006771415504077600300750ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/dynamic-import-this-function/_expected/umd.js000066400000000000000000000012421415504077600273230ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/dynamic-import-this-function/main.js000066400000000000000000000003251415504077600255230ustar00rootroot00000000000000import { outputPath } from 'input'; class Importer { constructor() { this.outputPath = outputPath; } getImport() { return import(this.outputPath); } } export const promise = new Importer().getImport(); rollup-2.61.1/test/form/samples/dynamic-import-unresolvable/000077500000000000000000000000001415504077600241505ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/dynamic-import-unresolvable/_config.js000066400000000000000000000011141415504077600261070ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Returns the raw AST nodes for unresolvable dynamic imports', options: { plugins: [ { resolveDynamicImport(specifier) { if (specifier === './seven.js') { return false; } assert.ok(specifier); assert.strictEqual(typeof specifier, 'object'); if (specifier.type === 'Literal') { return "'./seven.js'"; } if (specifier.type !== 'TemplateLiteral') { throw new Error(`Unexpected specifier type ${specifier.type}.`); } return false; } } ] } }; rollup-2.61.1/test/form/samples/dynamic-import-unresolvable/_expected/000077500000000000000000000000001415504077600261105ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/dynamic-import-unresolvable/_expected/amd.js000066400000000000000000000022051415504077600272060ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; 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 (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }); })(`${globalThis.unknown}`); (function (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }); })(`My ${globalThis.unknown}`); (function (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }); })('./seven.js'); new Promise(function (resolve, reject) { require(['./seven'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }); })); rollup-2.61.1/test/form/samples/dynamic-import-unresolvable/_expected/cjs.js000066400000000000000000000016571415504077600272360ustar00rootroot00000000000000'use strict'; 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 (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(`${globalThis.unknown}`); (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(`My ${globalThis.unknown}`); (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })('./seven.js'); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('./seven.js')); }); rollup-2.61.1/test/form/samples/dynamic-import-unresolvable/_expected/es.js000066400000000000000000000001611415504077600270530ustar00rootroot00000000000000import(`${globalThis.unknown}`); import(`My ${globalThis.unknown}`); import('./seven.js'); import('./seven.js'); rollup-2.61.1/test/form/samples/dynamic-import-unresolvable/_expected/iife.js000066400000000000000000000002331415504077600273600ustar00rootroot00000000000000(function () { 'use strict'; import(`${globalThis.unknown}`); import(`My ${globalThis.unknown}`); import('./seven.js'); import('./seven.js'); })(); rollup-2.61.1/test/form/samples/dynamic-import-unresolvable/_expected/system.js000066400000000000000000000004161415504077600277730ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/dynamic-import-unresolvable/_expected/umd.js000066400000000000000000000003761415504077600272410ustar00rootroot00000000000000(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-2.61.1/test/form/samples/dynamic-import-unresolvable/main.js000066400000000000000000000001461415504077600254330ustar00rootroot00000000000000import(`${globalThis.unknown}`); import(`My ${globalThis.unknown}`); import(7); import('./seven.js'); rollup-2.61.1/test/form/samples/dynamic-resolvable-if-statements/000077500000000000000000000000001415504077600250565ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/dynamic-resolvable-if-statements/_config.js000066400000000000000000000001251415504077600270160ustar00rootroot00000000000000module.exports = { description: 'allows using variables to resolve conditionals' }; rollup-2.61.1/test/form/samples/dynamic-resolvable-if-statements/_expected.js000066400000000000000000000003301415504077600273500ustar00rootroot00000000000000{ console.log('retained'); } { console.log('retained'); } { console.log('retained'); } { console.log('retained'); } { console.log('retained'); } { console.log('retained'); } { console.log('retained'); } rollup-2.61.1/test/form/samples/dynamic-resolvable-if-statements/main.js000066400000000000000000000015021415504077600263360ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/early-bind-member-expressions/000077500000000000000000000000001415504077600243705ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/early-bind-member-expressions/_config.js000066400000000000000000000002131415504077600263260ustar00rootroot00000000000000module.exports = { description: 'correctly resolves namespace members when accessed early (#2895)', options: { external: 'external' } }; rollup-2.61.1/test/form/samples/early-bind-member-expressions/_expected.js000066400000000000000000000000571415504077600266700ustar00rootroot00000000000000import * as stuff from 'external'; stuff.y(); rollup-2.61.1/test/form/samples/early-bind-member-expressions/main.js000066400000000000000000000000721415504077600256510ustar00rootroot00000000000000import * as stuff from 'external' const {x} = stuff.y(); rollup-2.61.1/test/form/samples/effect-in-for-of-loop-in-functions/000077500000000000000000000000001415504077600251245ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/effect-in-for-of-loop-in-functions/_config.js000066400000000000000000000001151415504077600270630ustar00rootroot00000000000000module.exports = { description: 'includes effects in for-of loop (#870)' }; rollup-2.61.1/test/form/samples/effect-in-for-of-loop-in-functions/_expected/000077500000000000000000000000001415504077600270645ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/effect-in-for-of-loop-in-functions/_expected/amd.js000066400000000000000000000006061415504077600301650ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/effect-in-for-of-loop-in-functions/_expected/cjs.js000066400000000000000000000005271415504077600302050ustar00rootroot00000000000000'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-2.61.1/test/form/samples/effect-in-for-of-loop-in-functions/_expected/es.js000066400000000000000000000005101415504077600300250ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/effect-in-for-of-loop-in-functions/_expected/iife.js000066400000000000000000000006011415504077600303330ustar00rootroot00000000000000(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-2.61.1/test/form/samples/effect-in-for-of-loop-in-functions/_expected/system.js000066400000000000000000000007471415504077600307560ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/effect-in-for-of-loop-in-functions/_expected/umd.js000066400000000000000000000007441415504077600302140ustar00rootroot00000000000000(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-2.61.1/test/form/samples/effect-in-for-of-loop-in-functions/main.js000066400000000000000000000005101415504077600264020ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/effect-in-for-of-loop/000077500000000000000000000000001415504077600225125ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/effect-in-for-of-loop/_config.js000066400000000000000000000001151415504077600244510ustar00rootroot00000000000000module.exports = { description: 'includes effects in for-of loop (#870)' }; rollup-2.61.1/test/form/samples/effect-in-for-of-loop/_expected/000077500000000000000000000000001415504077600244525ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/effect-in-for-of-loop/_expected/amd.js000066400000000000000000000005461415504077600255560ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/effect-in-for-of-loop/_expected/cjs.js000066400000000000000000000004711415504077600255710ustar00rootroot00000000000000'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-2.61.1/test/form/samples/effect-in-for-of-loop/_expected/es.js000066400000000000000000000004521415504077600254200ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/effect-in-for-of-loop/_expected/iife.js000066400000000000000000000005411415504077600257240ustar00rootroot00000000000000(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-2.61.1/test/form/samples/effect-in-for-of-loop/_expected/system.js000066400000000000000000000007031415504077600263340ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/effect-in-for-of-loop/_expected/umd.js000066400000000000000000000007041415504077600255760ustar00rootroot00000000000000(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-2.61.1/test/form/samples/effect-in-for-of-loop/main.js000066400000000000000000000004521415504077600237750ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/emit-asset-file/000077500000000000000000000000001415504077600215055ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/emit-asset-file/_config.js000066400000000000000000000021271415504077600234510ustar00rootroot00000000000000const assert = require('assert'); const fs = require('fs'); const path = require('path'); module.exports = { description: 'supports emitting assets from plugin hooks', options: { plugins: { 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: fs.readFileSync(id) })};`; } }, generateBundle(options, outputBundle) { const keys = Object.keys(outputBundle); assert.strictEqual(keys.length, 2); assert.strictEqual(keys[0], 'assets/logo-25585ac1.svg'); const asset = outputBundle[keys[0]]; assert.strictEqual(asset.fileName, 'assets/logo-25585ac1.svg'); assert.strictEqual(asset.type, 'asset'); assert.ok( asset.source.equals(fs.readFileSync(path.resolve(__dirname, 'logo.svg'))), 'asset has correct source' ); assert.ok(keys[1].endsWith('.js'), `${keys[1]} ends with ".js"`); } } } }; rollup-2.61.1/test/form/samples/emit-asset-file/_expected/000077500000000000000000000000001415504077600234455ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/emit-asset-file/_expected/amd.js000066400000000000000000000005641415504077600245510ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; var logo = new URL(require.toUrl('./assets/logo-25585ac1.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-2.61.1/test/form/samples/emit-asset-file/_expected/assets/000077500000000000000000000000001415504077600247475ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/emit-asset-file/_expected/assets/logo-25585ac1.svg000066400000000000000000000064331415504077600275110ustar00rootroot00000000000000 rollup-2.61.1/test/form/samples/emit-asset-file/_expected/cjs.js000066400000000000000000000007351415504077600245670ustar00rootroot00000000000000'use strict'; var logo = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/logo-25585ac1.svg').href : new URL('assets/logo-25585ac1.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-2.61.1/test/form/samples/emit-asset-file/_expected/es.js000066400000000000000000000004311415504077600244100ustar00rootroot00000000000000var logo = new URL('assets/logo-25585ac1.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-2.61.1/test/form/samples/emit-asset-file/_expected/iife.js000066400000000000000000000006021415504077600247150ustar00rootroot00000000000000(function () { 'use strict'; var logo = new URL('assets/logo-25585ac1.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-2.61.1/test/form/samples/emit-asset-file/_expected/system.js000066400000000000000000000006541415504077600253340ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { var logo = new URL('assets/logo-25585ac1.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-2.61.1/test/form/samples/emit-asset-file/_expected/umd.js000066400000000000000000000012661415504077600245750ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var logo = (typeof document === 'undefined' && typeof location === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/logo-25585ac1.svg').href : new URL('assets/logo-25585ac1.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-2.61.1/test/form/samples/emit-asset-file/index-amd.html000066400000000000000000000003361415504077600242430ustar00rootroot00000000000000 AMD rollup-2.61.1/test/form/samples/emit-asset-file/index-cjs.html000066400000000000000000000002511415504077600242550ustar00rootroot00000000000000 CommonJS rollup-2.61.1/test/form/samples/emit-asset-file/index-es.html000066400000000000000000000002671415504077600241140ustar00rootroot00000000000000 ES Module rollup-2.61.1/test/form/samples/emit-asset-file/index-iife.html000066400000000000000000000002461415504077600244160ustar00rootroot00000000000000 IIFE rollup-2.61.1/test/form/samples/emit-asset-file/index-system.html000066400000000000000000000004011415504077600250170ustar00rootroot00000000000000 SystemJS rollup-2.61.1/test/form/samples/emit-asset-file/index-umd-amd.html000066400000000000000000000003441415504077600250250ustar00rootroot00000000000000 UMD (AMD) rollup-2.61.1/test/form/samples/emit-asset-file/index-umd-iife-queryparam.html000066400000000000000000000003041415504077600273600ustar00rootroot00000000000000 UMD (IIFE) + query parameter rollup-2.61.1/test/form/samples/emit-asset-file/index-umd-iife.html000066400000000000000000000002531415504077600251770ustar00rootroot00000000000000 UMD (IIFE) rollup-2.61.1/test/form/samples/emit-asset-file/logo.svg000066400000000000000000000064331415504077600231740ustar00rootroot00000000000000 rollup-2.61.1/test/form/samples/emit-asset-file/main.js000066400000000000000000000003621415504077600227700ustar00rootroot00000000000000import 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-2.61.1/test/form/samples/emit-file-tree-shaken-access/000077500000000000000000000000001415504077600240335ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/emit-file-tree-shaken-access/_config.js000066400000000000000000000010441415504077600257740ustar00rootroot00000000000000const fs = require('fs'); const path = require('path'); module.exports = { description: 'does not include format globals when tree-shaking an asset access', options: { plugins: { 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: fs.readFileSync(id) })};`; } } } } }; rollup-2.61.1/test/form/samples/emit-file-tree-shaken-access/_expected/000077500000000000000000000000001415504077600257735ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/emit-file-tree-shaken-access/_expected/amd.js000066400000000000000000000001011415504077600270620ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main'); })); rollup-2.61.1/test/form/samples/emit-file-tree-shaken-access/_expected/assets/000077500000000000000000000000001415504077600272755ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/emit-file-tree-shaken-access/_expected/assets/logo-25585ac1.svg000066400000000000000000000064331415504077600320370ustar00rootroot00000000000000 rollup-2.61.1/test/form/samples/emit-file-tree-shaken-access/_expected/cjs.js000066400000000000000000000000441415504077600271060ustar00rootroot00000000000000'use strict'; console.log('main'); rollup-2.61.1/test/form/samples/emit-file-tree-shaken-access/_expected/es.js000066400000000000000000000000251415504077600267350ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/form/samples/emit-file-tree-shaken-access/_expected/iife.js000066400000000000000000000000741415504077600272460ustar00rootroot00000000000000(function () { 'use strict'; console.log('main'); })(); rollup-2.61.1/test/form/samples/emit-file-tree-shaken-access/_expected/system.js000066400000000000000000000001761415504077600276610ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-2.61.1/test/form/samples/emit-file-tree-shaken-access/_expected/umd.js000066400000000000000000000002371415504077600271200ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log('main'); })); rollup-2.61.1/test/form/samples/emit-file-tree-shaken-access/logo.svg000066400000000000000000000064331415504077600255220ustar00rootroot00000000000000 rollup-2.61.1/test/form/samples/emit-file-tree-shaken-access/main.js000066400000000000000000000001301415504077600253070ustar00rootroot00000000000000import logo from './logo.svg'; if (false) { console.log(logo); } console.log('main'); rollup-2.61.1/test/form/samples/emit-uint8array-no-buffer/000077500000000000000000000000001415504077600234405ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/emit-uint8array-no-buffer/_config.js000066400000000000000000000011431415504077600254010ustar00rootroot00000000000000const Buffer = global.Buffer; module.exports = { description: 'supports emitting assets as Uint8Arrays when Buffer is not available with deduplication', before() { delete global.Buffer; }, after() { global.Buffer = Buffer; }, options: { plugins: { 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(Array.from(id.slice(0, -1)).map(char => char.charCodeAt(0))) })};`; } } } } }; rollup-2.61.1/test/form/samples/emit-uint8array-no-buffer/_expected/000077500000000000000000000000001415504077600254005ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/emit-uint8array-no-buffer/_expected/amd.js000066400000000000000000000010761415504077600265030ustar00rootroot00000000000000define(['require'], (function (require) { 'use strict'; var asset1a = new URL(require.toUrl('./assets/asset-dc5cb674'), document.baseURI).href; var asset1b = new URL(require.toUrl('./assets/asset-dc5cb674'), document.baseURI).href; var asset2a = new URL(require.toUrl('./assets/asset-52cbd095'), document.baseURI).href; var asset2b = new URL(require.toUrl('./assets/asset-52cbd095'), document.baseURI).href; var asset99a = new URL(require.toUrl('./assets/asset-c568a840'), document.baseURI).href; console.log(asset1a, asset1b, asset2a, asset2b, asset99a); })); rollup-2.61.1/test/form/samples/emit-uint8array-no-buffer/_expected/assets/000077500000000000000000000000001415504077600267025ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/emit-uint8array-no-buffer/_expected/assets/asset-52cbd095000066400000000000000000000000061415504077600310730ustar00rootroot00000000000000asset2rollup-2.61.1/test/form/samples/emit-uint8array-no-buffer/_expected/assets/asset-c568a840000066400000000000000000000000071415504077600310210ustar00rootroot00000000000000asset99rollup-2.61.1/test/form/samples/emit-uint8array-no-buffer/_expected/assets/asset-dc5cb674000066400000000000000000000000061415504077600311570ustar00rootroot00000000000000asset1rollup-2.61.1/test/form/samples/emit-uint8array-no-buffer/_expected/cjs.js000066400000000000000000000024501415504077600265160ustar00rootroot00000000000000'use strict'; var asset1a = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/asset-dc5cb674').href : new URL('assets/asset-dc5cb674', document.currentScript && document.currentScript.src || document.baseURI).href); var asset1b = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/asset-dc5cb674').href : new URL('assets/asset-dc5cb674', document.currentScript && document.currentScript.src || document.baseURI).href); var asset2a = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/asset-52cbd095').href : new URL('assets/asset-52cbd095', document.currentScript && document.currentScript.src || document.baseURI).href); var asset2b = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/asset-52cbd095').href : new URL('assets/asset-52cbd095', document.currentScript && document.currentScript.src || document.baseURI).href); var asset99a = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/asset-c568a840').href : new URL('assets/asset-c568a840', document.currentScript && document.currentScript.src || document.baseURI).href); console.log(asset1a, asset1b, asset2a, asset2b, asset99a); rollup-2.61.1/test/form/samples/emit-uint8array-no-buffer/_expected/es.js000066400000000000000000000006371415504077600263530ustar00rootroot00000000000000var asset1a = new URL('assets/asset-dc5cb674', import.meta.url).href; var asset1b = new URL('assets/asset-dc5cb674', import.meta.url).href; var asset2a = new URL('assets/asset-52cbd095', import.meta.url).href; var asset2b = new URL('assets/asset-52cbd095', import.meta.url).href; var asset99a = new URL('assets/asset-c568a840', import.meta.url).href; console.log(asset1a, asset1b, asset2a, asset2b, asset99a); rollup-2.61.1/test/form/samples/emit-uint8array-no-buffer/_expected/iife.js000066400000000000000000000013501415504077600266510ustar00rootroot00000000000000(function () { 'use strict'; var asset1a = new URL('assets/asset-dc5cb674', document.currentScript && document.currentScript.src || document.baseURI).href; var asset1b = new URL('assets/asset-dc5cb674', document.currentScript && document.currentScript.src || document.baseURI).href; var asset2a = new URL('assets/asset-52cbd095', document.currentScript && document.currentScript.src || document.baseURI).href; var asset2b = new URL('assets/asset-52cbd095', document.currentScript && document.currentScript.src || document.baseURI).href; var asset99a = new URL('assets/asset-c568a840', document.currentScript && document.currentScript.src || document.baseURI).href; console.log(asset1a, asset1b, asset2a, asset2b, asset99a); })(); rollup-2.61.1/test/form/samples/emit-uint8array-no-buffer/_expected/system.js000066400000000000000000000010461415504077600272630ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { var asset1a = new URL('assets/asset-dc5cb674', module.meta.url).href; var asset1b = new URL('assets/asset-dc5cb674', module.meta.url).href; var asset2a = new URL('assets/asset-52cbd095', module.meta.url).href; var asset2b = new URL('assets/asset-52cbd095', module.meta.url).href; var asset99a = new URL('assets/asset-c568a840', module.meta.url).href; console.log(asset1a, asset1b, asset2a, asset2b, asset99a); }) }; })); rollup-2.61.1/test/form/samples/emit-uint8array-no-buffer/_expected/umd.js000066400000000000000000000035211415504077600265240ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var asset1a = (typeof document === 'undefined' && typeof location === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/asset-dc5cb674').href : new URL('assets/asset-dc5cb674', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); var asset1b = (typeof document === 'undefined' && typeof location === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/asset-dc5cb674').href : new URL('assets/asset-dc5cb674', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); var asset2a = (typeof document === 'undefined' && typeof location === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/asset-52cbd095').href : new URL('assets/asset-52cbd095', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); var asset2b = (typeof document === 'undefined' && typeof location === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/asset-52cbd095').href : new URL('assets/asset-52cbd095', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); var asset99a = (typeof document === 'undefined' && typeof location === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/asset-c568a840').href : new URL('assets/asset-c568a840', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); console.log(asset1a, asset1b, asset2a, asset2b, asset99a); })); rollup-2.61.1/test/form/samples/emit-uint8array-no-buffer/main.js000066400000000000000000000003311415504077600247170ustar00rootroot00000000000000import asset1a from 'asset1a'; import asset1b from 'asset1b'; import asset2a from 'asset2a'; import asset2b from 'asset2b'; import asset99a from 'asset99a'; console.log(asset1a, asset1b, asset2a, asset2b, asset99a); rollup-2.61.1/test/form/samples/empty-block-statement/000077500000000000000000000000001415504077600227455ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/empty-block-statement/_config.js000066400000000000000000000001071415504077600247050ustar00rootroot00000000000000module.exports = { description: 'removes an empty block statement' }; rollup-2.61.1/test/form/samples/empty-block-statement/_expected/000077500000000000000000000000001415504077600247055ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/empty-block-statement/_expected/amd.js000066400000000000000000000001211415504077600257760ustar00rootroot00000000000000define((function () { 'use strict'; console.log( 1 ); console.log( 2 ); })); rollup-2.61.1/test/form/samples/empty-block-statement/_expected/cjs.js000066400000000000000000000000631415504077600260210ustar00rootroot00000000000000'use strict'; console.log( 1 ); console.log( 2 ); rollup-2.61.1/test/form/samples/empty-block-statement/_expected/es.js000066400000000000000000000000441415504077600256500ustar00rootroot00000000000000console.log( 1 ); console.log( 2 ); rollup-2.61.1/test/form/samples/empty-block-statement/_expected/iife.js000066400000000000000000000001141415504077600261530ustar00rootroot00000000000000(function () { 'use strict'; console.log( 1 ); console.log( 2 ); })(); rollup-2.61.1/test/form/samples/empty-block-statement/_expected/system.js000066400000000000000000000002201415504077600265610ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log( 1 ); console.log( 2 ); }) }; })); rollup-2.61.1/test/form/samples/empty-block-statement/_expected/umd.js000066400000000000000000000002571415504077600260340ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log( 1 ); console.log( 2 ); })); rollup-2.61.1/test/form/samples/empty-block-statement/main.js000066400000000000000000000000621415504077600242250ustar00rootroot00000000000000console.log( 1 ); { // empty } console.log( 2 ); rollup-2.61.1/test/form/samples/empty-do-while-statement/000077500000000000000000000000001415504077600233635ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/empty-do-while-statement/_config.js000066400000000000000000000001121415504077600253170ustar00rootroot00000000000000module.exports = { description: 'removes an empty do-while statement' }; rollup-2.61.1/test/form/samples/empty-do-while-statement/_expected/000077500000000000000000000000001415504077600253235ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/empty-do-while-statement/_expected/amd.js000066400000000000000000000001211415504077600264140ustar00rootroot00000000000000define((function () { 'use strict'; console.log( 1 ); console.log( 2 ); })); rollup-2.61.1/test/form/samples/empty-do-while-statement/_expected/cjs.js000066400000000000000000000000631415504077600264370ustar00rootroot00000000000000'use strict'; console.log( 1 ); console.log( 2 ); rollup-2.61.1/test/form/samples/empty-do-while-statement/_expected/es.js000066400000000000000000000000441415504077600262660ustar00rootroot00000000000000console.log( 1 ); console.log( 2 ); rollup-2.61.1/test/form/samples/empty-do-while-statement/_expected/iife.js000066400000000000000000000001141415504077600265710ustar00rootroot00000000000000(function () { 'use strict'; console.log( 1 ); console.log( 2 ); })(); rollup-2.61.1/test/form/samples/empty-do-while-statement/_expected/system.js000066400000000000000000000002201415504077600271770ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log( 1 ); console.log( 2 ); }) }; })); rollup-2.61.1/test/form/samples/empty-do-while-statement/_expected/umd.js000066400000000000000000000002571415504077600264520ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log( 1 ); console.log( 2 ); })); rollup-2.61.1/test/form/samples/empty-do-while-statement/main.js000066400000000000000000000001521415504077600246430ustar00rootroot00000000000000console.log( 1 ); var condition = true; do { condition = false; } while ( condition ); console.log( 2 ); rollup-2.61.1/test/form/samples/empty-for-in-statement/000077500000000000000000000000001415504077600230455ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/empty-for-in-statement/_config.js000066400000000000000000000001101415504077600247770ustar00rootroot00000000000000module.exports = { description: 'removes an empty for-in statement' }; rollup-2.61.1/test/form/samples/empty-for-in-statement/_expected.js000066400000000000000000000000441415504077600253410ustar00rootroot00000000000000console.log( 1 ); console.log( 2 ); rollup-2.61.1/test/form/samples/empty-for-in-statement/main.js000066400000000000000000000001351415504077600243260ustar00rootroot00000000000000console.log( 1 ); for ( const i in globalThis.unknown ) { // do nothing } console.log( 2 ); rollup-2.61.1/test/form/samples/empty-for-statement/000077500000000000000000000000001415504077600224415ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/empty-for-statement/_config.js000066400000000000000000000001051415504077600243770ustar00rootroot00000000000000module.exports = { description: 'removes an empty for statement' }; rollup-2.61.1/test/form/samples/empty-for-statement/_expected/000077500000000000000000000000001415504077600244015ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/empty-for-statement/_expected/amd.js000066400000000000000000000001211415504077600254720ustar00rootroot00000000000000define((function () { 'use strict'; console.log( 1 ); console.log( 2 ); })); rollup-2.61.1/test/form/samples/empty-for-statement/_expected/cjs.js000066400000000000000000000000631415504077600255150ustar00rootroot00000000000000'use strict'; console.log( 1 ); console.log( 2 ); rollup-2.61.1/test/form/samples/empty-for-statement/_expected/es.js000066400000000000000000000000441415504077600253440ustar00rootroot00000000000000console.log( 1 ); console.log( 2 ); rollup-2.61.1/test/form/samples/empty-for-statement/_expected/iife.js000066400000000000000000000001141415504077600256470ustar00rootroot00000000000000(function () { 'use strict'; console.log( 1 ); console.log( 2 ); })(); rollup-2.61.1/test/form/samples/empty-for-statement/_expected/system.js000066400000000000000000000002201415504077600262550ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log( 1 ); console.log( 2 ); }) }; })); rollup-2.61.1/test/form/samples/empty-for-statement/_expected/umd.js000066400000000000000000000002571415504077600255300ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log( 1 ); console.log( 2 ); })); rollup-2.61.1/test/form/samples/empty-for-statement/main.js000066400000000000000000000001311415504077600237160ustar00rootroot00000000000000console.log( 1 ); for ( let i = 0; i < 10; i += 1 ) { // do nothing } console.log( 2 ); rollup-2.61.1/test/form/samples/empty-if-statement/000077500000000000000000000000001415504077600222515ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/empty-if-statement/_config.js000066400000000000000000000001041415504077600242060ustar00rootroot00000000000000module.exports = { description: 'removes an empty if statement' }; rollup-2.61.1/test/form/samples/empty-if-statement/_expected.js000066400000000000000000000000441415504077600245450ustar00rootroot00000000000000console.log( 1 ); console.log( 2 ); rollup-2.61.1/test/form/samples/empty-if-statement/main.js000066400000000000000000000001141415504077600235270ustar00rootroot00000000000000console.log( 1 ); if ( globalThis.unknown ) { // empty } console.log( 2 ); rollup-2.61.1/test/form/samples/empty-statement-consequent/000077500000000000000000000000001415504077600240375ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/empty-statement-consequent/_config.js000066400000000000000000000001501415504077600257750ustar00rootroot00000000000000module.exports = { description: 'preserves empty statements used as the consequent of conditionals' }; rollup-2.61.1/test/form/samples/empty-statement-consequent/_expected/000077500000000000000000000000001415504077600257775ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/empty-statement-consequent/_expected/amd.js000066400000000000000000000001071415504077600270740ustar00rootroot00000000000000define((function () { 'use strict'; if ( a === 0 ); else a++; })); rollup-2.61.1/test/form/samples/empty-statement-consequent/_expected/cjs.js000066400000000000000000000000511415504077600271100ustar00rootroot00000000000000'use strict'; if ( a === 0 ); else a++; rollup-2.61.1/test/form/samples/empty-statement-consequent/_expected/es.js000066400000000000000000000000321415504077600267370ustar00rootroot00000000000000if ( a === 0 ); else a++; rollup-2.61.1/test/form/samples/empty-statement-consequent/_expected/iife.js000066400000000000000000000001021415504077600272420ustar00rootroot00000000000000(function () { 'use strict'; if ( a === 0 ); else a++; })(); rollup-2.61.1/test/form/samples/empty-statement-consequent/_expected/system.js000066400000000000000000000002061415504077600276570ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { if ( a === 0 ); else a++; }) }; })); rollup-2.61.1/test/form/samples/empty-statement-consequent/_expected/umd.js000066400000000000000000000002451415504077600271230ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; if ( a === 0 ); else a++; })); rollup-2.61.1/test/form/samples/empty-statement-consequent/main.js000066400000000000000000000000321415504077600253140ustar00rootroot00000000000000if ( a === 0 ); else a++; rollup-2.61.1/test/form/samples/empty-statement/000077500000000000000000000000001415504077600216555ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/empty-statement/_config.js000066400000000000000000000001011415504077600236070ustar00rootroot00000000000000module.exports = { description: 'removes an empty statement' }; rollup-2.61.1/test/form/samples/empty-statement/_expected/000077500000000000000000000000001415504077600236155ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/empty-statement/_expected/amd.js000066400000000000000000000001171415504077600247130ustar00rootroot00000000000000define((function () { 'use strict'; console.log( 1 );console.log( 2 ); })); rollup-2.61.1/test/form/samples/empty-statement/_expected/cjs.js000066400000000000000000000000621415504077600247300ustar00rootroot00000000000000'use strict'; console.log( 1 );console.log( 2 ); rollup-2.61.1/test/form/samples/empty-statement/_expected/es.js000066400000000000000000000000431415504077600245570ustar00rootroot00000000000000console.log( 1 );console.log( 2 ); rollup-2.61.1/test/form/samples/empty-statement/_expected/iife.js000066400000000000000000000001121415504077600250610ustar00rootroot00000000000000(function () { 'use strict'; console.log( 1 );console.log( 2 ); })(); rollup-2.61.1/test/form/samples/empty-statement/_expected/system.js000066400000000000000000000002141415504077600254740ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log( 1 );console.log( 2 ); }) }; })); rollup-2.61.1/test/form/samples/empty-statement/_expected/umd.js000066400000000000000000000002551415504077600247420ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log( 1 );console.log( 2 ); })); rollup-2.61.1/test/form/samples/empty-statement/main.js000066400000000000000000000000521415504077600231340ustar00rootroot00000000000000; console.log( 1 );; ; console.log( 2 );; rollup-2.61.1/test/form/samples/empty-switch-statement/000077500000000000000000000000001415504077600231545ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/empty-switch-statement/_config.js000066400000000000000000000001101415504077600251060ustar00rootroot00000000000000module.exports = { description: 'removes an empty switch statement' }; rollup-2.61.1/test/form/samples/empty-switch-statement/_expected.js000066400000000000000000000000441415504077600254500ustar00rootroot00000000000000console.log( 1 ); console.log( 2 ); rollup-2.61.1/test/form/samples/empty-switch-statement/main.js000066400000000000000000000002331415504077600244340ustar00rootroot00000000000000console.log( 1 ); var result; switch ( globalThis.unknown ) { case 'foo': result = 'foo'; break; default: result = 'default'; } console.log( 2 ); rollup-2.61.1/test/form/samples/empty-try-catch-statement/000077500000000000000000000000001415504077600235515ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/empty-try-catch-statement/_config.js000066400000000000000000000001231415504077600255070ustar00rootroot00000000000000module.exports = { description: 'removes an empty try-catch-finally statement' }; rollup-2.61.1/test/form/samples/empty-try-catch-statement/_expected/000077500000000000000000000000001415504077600255115ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/empty-try-catch-statement/_expected/amd.js000066400000000000000000000001211415504077600266020ustar00rootroot00000000000000define((function () { 'use strict'; console.log( 1 ); console.log( 2 ); })); rollup-2.61.1/test/form/samples/empty-try-catch-statement/_expected/cjs.js000066400000000000000000000000631415504077600266250ustar00rootroot00000000000000'use strict'; console.log( 1 ); console.log( 2 ); rollup-2.61.1/test/form/samples/empty-try-catch-statement/_expected/es.js000066400000000000000000000000441415504077600264540ustar00rootroot00000000000000console.log( 1 ); console.log( 2 ); rollup-2.61.1/test/form/samples/empty-try-catch-statement/_expected/iife.js000066400000000000000000000001141415504077600267570ustar00rootroot00000000000000(function () { 'use strict'; console.log( 1 ); console.log( 2 ); })(); rollup-2.61.1/test/form/samples/empty-try-catch-statement/_expected/system.js000066400000000000000000000002201415504077600273650ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log( 1 ); console.log( 2 ); }) }; })); rollup-2.61.1/test/form/samples/empty-try-catch-statement/_expected/umd.js000066400000000000000000000002571415504077600266400ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log( 1 ); console.log( 2 ); })); rollup-2.61.1/test/form/samples/empty-try-catch-statement/main.js000066400000000000000000000001671415504077600250370ustar00rootroot00000000000000console.log( 1 ); try { // do nothing } catch ( err ) { // do nothing } finally { // do nothing } console.log( 2 ); rollup-2.61.1/test/form/samples/empty-while-statement/000077500000000000000000000000001415504077600227635ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/empty-while-statement/_config.js000066400000000000000000000001071415504077600247230ustar00rootroot00000000000000module.exports = { description: 'removes an empty while statement' }; rollup-2.61.1/test/form/samples/empty-while-statement/_expected/000077500000000000000000000000001415504077600247235ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/empty-while-statement/_expected/amd.js000066400000000000000000000001211415504077600260140ustar00rootroot00000000000000define((function () { 'use strict'; console.log( 1 ); console.log( 2 ); })); rollup-2.61.1/test/form/samples/empty-while-statement/_expected/cjs.js000066400000000000000000000000631415504077600260370ustar00rootroot00000000000000'use strict'; console.log( 1 ); console.log( 2 ); rollup-2.61.1/test/form/samples/empty-while-statement/_expected/es.js000066400000000000000000000000441415504077600256660ustar00rootroot00000000000000console.log( 1 ); console.log( 2 ); rollup-2.61.1/test/form/samples/empty-while-statement/_expected/iife.js000066400000000000000000000001141415504077600261710ustar00rootroot00000000000000(function () { 'use strict'; console.log( 1 ); console.log( 2 ); })(); rollup-2.61.1/test/form/samples/empty-while-statement/_expected/system.js000066400000000000000000000002201415504077600265770ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log( 1 ); console.log( 2 ); }) }; })); rollup-2.61.1/test/form/samples/empty-while-statement/_expected/umd.js000066400000000000000000000002571415504077600260520ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log( 1 ); console.log( 2 ); })); rollup-2.61.1/test/form/samples/empty-while-statement/main.js000066400000000000000000000001461415504077600242460ustar00rootroot00000000000000console.log( 1 ); var condition = true; while ( condition ) { condition = false; } console.log( 2 ); rollup-2.61.1/test/form/samples/entry-with-unused-synthetic-exports/000077500000000000000000000000001415504077600256425ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/entry-with-unused-synthetic-exports/_config.js000066400000000000000000000003731415504077600276070ustar00rootroot00000000000000module.exports = { description: 'does not include unused synthetic namespace object in entry points', options: { plugins: { name: 'test-plugin', transform(code) { return { code, syntheticNamedExports: '__moduleExports' }; } } } }; rollup-2.61.1/test/form/samples/entry-with-unused-synthetic-exports/_expected/000077500000000000000000000000001415504077600276025ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/entry-with-unused-synthetic-exports/_expected/amd.js000066400000000000000000000001011415504077600306710ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main'); })); rollup-2.61.1/test/form/samples/entry-with-unused-synthetic-exports/_expected/cjs.js000066400000000000000000000000441415504077600307150ustar00rootroot00000000000000'use strict'; console.log('main'); rollup-2.61.1/test/form/samples/entry-with-unused-synthetic-exports/_expected/es.js000066400000000000000000000000251415504077600305440ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/form/samples/entry-with-unused-synthetic-exports/_expected/iife.js000066400000000000000000000000741415504077600310550ustar00rootroot00000000000000(function () { 'use strict'; console.log('main'); })(); rollup-2.61.1/test/form/samples/entry-with-unused-synthetic-exports/_expected/system.js000066400000000000000000000001761415504077600314700ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-2.61.1/test/form/samples/entry-with-unused-synthetic-exports/_expected/umd.js000066400000000000000000000002371415504077600307270ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log('main'); })); rollup-2.61.1/test/form/samples/entry-with-unused-synthetic-exports/main.js000066400000000000000000000001111415504077600271150ustar00rootroot00000000000000console.log('main'); export const __moduleExports = { not: 'included' }; rollup-2.61.1/test/form/samples/erroneous-nested-member-expression/000077500000000000000000000000001415504077600254605ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/erroneous-nested-member-expression/_config.js000066400000000000000000000001411415504077600274160ustar00rootroot00000000000000module.exports = { description: 'erroneous nested member expression does not mess up naming' }; rollup-2.61.1/test/form/samples/erroneous-nested-member-expression/_expected/000077500000000000000000000000001415504077600274205ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/erroneous-nested-member-expression/_expected/amd.js000066400000000000000000000002061415504077600305150ustar00rootroot00000000000000define((function () { 'use strict'; function yar() { return { har() { console.log('har?'); } }; } yar.har(); })); rollup-2.61.1/test/form/samples/erroneous-nested-member-expression/_expected/cjs.js000066400000000000000000000001421415504077600305320ustar00rootroot00000000000000'use strict'; function yar() { return { har() { console.log('har?'); } }; } yar.har(); rollup-2.61.1/test/form/samples/erroneous-nested-member-expression/_expected/es.js000066400000000000000000000001231415504077600303610ustar00rootroot00000000000000function yar() { return { har() { console.log('har?'); } }; } yar.har(); rollup-2.61.1/test/form/samples/erroneous-nested-member-expression/_expected/iife.js000066400000000000000000000002011415504077600306630ustar00rootroot00000000000000(function () { 'use strict'; function yar() { return { har() { console.log('har?'); } }; } yar.har(); })(); rollup-2.61.1/test/form/samples/erroneous-nested-member-expression/_expected/system.js000066400000000000000000000003211415504077600312760ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function yar() { return { har() { console.log('har?'); } }; } yar.har(); }) }; })); rollup-2.61.1/test/form/samples/erroneous-nested-member-expression/_expected/umd.js000066400000000000000000000003441415504077600305440ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function yar() { return { har() { console.log('har?'); } }; } yar.har(); })); rollup-2.61.1/test/form/samples/erroneous-nested-member-expression/foo.js000066400000000000000000000001171415504077600266000ustar00rootroot00000000000000export function yar() { return { har() { console.log('har?'); } }; }; rollup-2.61.1/test/form/samples/erroneous-nested-member-expression/main.js000066400000000000000000000000601415504077600267360ustar00rootroot00000000000000import * as foo from './foo.js'; foo.yar.har(); rollup-2.61.1/test/form/samples/exclude-unnecessary-modifications/000077500000000000000000000000001415504077600253315ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/exclude-unnecessary-modifications/_config.js000066400000000000000000000001561415504077600272750ustar00rootroot00000000000000module.exports = { description: 'statements that modify definitions within unused functions are excluded' }; rollup-2.61.1/test/form/samples/exclude-unnecessary-modifications/_expected/000077500000000000000000000000001415504077600272715ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/exclude-unnecessary-modifications/_expected/amd.js000066400000000000000000000006011415504077600303650ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/exclude-unnecessary-modifications/_expected/cjs.js000066400000000000000000000005231415504077600304060ustar00rootroot00000000000000'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-2.61.1/test/form/samples/exclude-unnecessary-modifications/_expected/es.js000066400000000000000000000005041415504077600302350ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/exclude-unnecessary-modifications/_expected/iife.js000066400000000000000000000005741415504077600305510ustar00rootroot00000000000000(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-2.61.1/test/form/samples/exclude-unnecessary-modifications/_expected/system.js000066400000000000000000000007401415504077600311540ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/exclude-unnecessary-modifications/_expected/umd.js000066400000000000000000000007371415504077600304230ustar00rootroot00000000000000(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-2.61.1/test/form/samples/exclude-unnecessary-modifications/foo.js000066400000000000000000000007461415504077600264610ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/exclude-unnecessary-modifications/main.js000066400000000000000000000000551415504077600266130ustar00rootroot00000000000000import foo from './foo'; console.log( foo ); rollup-2.61.1/test/form/samples/exponentiation-operator/000077500000000000000000000000001415504077600234125ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/exponentiation-operator/_config.js000066400000000000000000000001371415504077600253550ustar00rootroot00000000000000module.exports = { description: 'folds exponentiation operator when considering dead code' }; rollup-2.61.1/test/form/samples/exponentiation-operator/_expected/000077500000000000000000000000001415504077600253525ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/exponentiation-operator/_expected/amd.js000066400000000000000000000001261415504077600264500ustar00rootroot00000000000000define((function () { 'use strict'; { console.log('8 is larger than 7'); } })); rollup-2.61.1/test/form/samples/exponentiation-operator/_expected/cjs.js000066400000000000000000000000671415504077600264720ustar00rootroot00000000000000'use strict'; { console.log('8 is larger than 7'); } rollup-2.61.1/test/form/samples/exponentiation-operator/_expected/es.js000066400000000000000000000000501415504077600263120ustar00rootroot00000000000000{ console.log('8 is larger than 7'); } rollup-2.61.1/test/form/samples/exponentiation-operator/_expected/iife.js000066400000000000000000000001211415504077600266160ustar00rootroot00000000000000(function () { 'use strict'; { console.log('8 is larger than 7'); } })(); rollup-2.61.1/test/form/samples/exponentiation-operator/_expected/system.js000066400000000000000000000002271415504077600272350ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { { console.log('8 is larger than 7'); } }) }; })); rollup-2.61.1/test/form/samples/exponentiation-operator/_expected/umd.js000066400000000000000000000002641415504077600264770ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; { console.log('8 is larger than 7'); } })); rollup-2.61.1/test/form/samples/exponentiation-operator/main.js000066400000000000000000000001541415504077600246740ustar00rootroot00000000000000if (2 ** 3 > 7) { console.log('8 is larger than 7'); } else { console.log('8 is... not larger than 7?'); }rollup-2.61.1/test/form/samples/export-all-before-named/000077500000000000000000000000001415504077600231265ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-all-before-named/_config.js000066400000000000000000000003371415504077600250730ustar00rootroot00000000000000module.exports = { description: 'external `export *` must not interfere with internal exports', options: { output: { globals: { external: 'external' }, name: 'exposedInternals' }, external: ['external'] } }; rollup-2.61.1/test/form/samples/export-all-before-named/_expected/000077500000000000000000000000001415504077600250665ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-all-before-named/_expected/amd.js000066400000000000000000000007061415504077600261700ustar00rootroot00000000000000define(['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' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/export-all-before-named/_expected/cjs.js000066400000000000000000000006321415504077600262040ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var external = require('external'); function internalFn(path) { return path[0] === '.'; } exports.internalFn = internalFn; Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); rollup-2.61.1/test/form/samples/export-all-before-named/_expected/es.js000066400000000000000000000001521415504077600260310ustar00rootroot00000000000000export * from 'external'; function internalFn(path) { return path[0] === '.'; } export { internalFn }; rollup-2.61.1/test/form/samples/export-all-before-named/_expected/iife.js000066400000000000000000000007351415504077600263450ustar00rootroot00000000000000var exposedInternals = (function (exports, external) { 'use strict'; function internalFn(path) { return path[0] === '.'; } exports.internalFn = internalFn; Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, external); rollup-2.61.1/test/form/samples/export-all-before-named/_expected/system.js000066400000000000000000000007311415504077600267510ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/export-all-before-named/_expected/umd.js000066400000000000000000000014231415504077600262110ustar00rootroot00000000000000(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' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/export-all-before-named/internal.js000066400000000000000000000000761415504077600253030ustar00rootroot00000000000000export function internalFn(path) { return path[0] === '.'; } rollup-2.61.1/test/form/samples/export-all-before-named/main.js000066400000000000000000000000711415504077600244060ustar00rootroot00000000000000export * from 'external'; export * from './internal.js'; rollup-2.61.1/test/form/samples/export-all-from-internal/000077500000000000000000000000001415504077600233575ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-all-from-internal/_config.js000066400000000000000000000002051415504077600253160ustar00rootroot00000000000000module.exports = { description: 'should be able to export * from the bundle', options: { output: { name: 'exposedInternals' } } }; rollup-2.61.1/test/form/samples/export-all-from-internal/_expected/000077500000000000000000000000001415504077600253175ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-all-from-internal/_expected/amd.js000066400000000000000000000002751415504077600264220ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const a = 1; const b = 2; exports.a = a; exports.b = b; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/export-all-from-internal/_expected/cjs.js000066400000000000000000000002101415504077600264250ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const a = 1; const b = 2; exports.a = a; exports.b = b; rollup-2.61.1/test/form/samples/export-all-from-internal/_expected/es.js000066400000000000000000000000541415504077600262630ustar00rootroot00000000000000const a = 1; const b = 2; export { a, b }; rollup-2.61.1/test/form/samples/export-all-from-internal/_expected/iife.js000066400000000000000000000003261415504077600265720ustar00rootroot00000000000000var exposedInternals = (function (exports) { 'use strict'; const a = 1; const b = 2; exports.a = a; exports.b = b; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/export-all-from-internal/_expected/system.js000066400000000000000000000002751415504077600272050ustar00rootroot00000000000000System.register('exposedInternals', [], (function (exports) { 'use strict'; return { execute: (function () { const a = exports('a', 1); const b = exports('b', 2); }) }; })); rollup-2.61.1/test/form/samples/export-all-from-internal/_expected/umd.js000066400000000000000000000007441415504077600264470ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/export-all-from-internal/internal.js000066400000000000000000000000731415504077600255310ustar00rootroot00000000000000export const a = 1; export const b = 2; export default 42; rollup-2.61.1/test/form/samples/export-all-from-internal/main.js000066400000000000000000000000371415504077600246410ustar00rootroot00000000000000export * from './internal.js'; rollup-2.61.1/test/form/samples/export-all-multiple/000077500000000000000000000000001415504077600224355ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-all-multiple/_config.js000066400000000000000000000003521415504077600243770ustar00rootroot00000000000000module.exports = { description: 'correctly handles multiple export * declarations (#1252)', options: { external: ['foo', 'bar', 'baz'], output: { globals: { foo: 'foo', bar: 'bar', baz: 'baz' }, name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/export-all-multiple/_expected/000077500000000000000000000000001415504077600243755ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-all-multiple/_expected/amd.js000066400000000000000000000014011415504077600254700ustar00rootroot00000000000000define(['exports', 'foo', 'bar', 'baz'], (function (exports, foo, bar, baz) { 'use strict'; Object.keys(foo).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return foo[k]; } }); }); Object.keys(bar).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return bar[k]; } }); }); Object.keys(baz).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return baz[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/export-all-multiple/_expected/cjs.js000066400000000000000000000013511415504077600255120ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var foo = require('foo'); var bar = require('bar'); var baz = require('baz'); Object.keys(foo).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return foo[k]; } }); }); Object.keys(bar).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return bar[k]; } }); }); Object.keys(baz).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return baz[k]; } }); }); rollup-2.61.1/test/form/samples/export-all-multiple/_expected/es.js000066400000000000000000000000771415504077600253460ustar00rootroot00000000000000export * from 'foo'; export * from 'bar'; export * from 'baz'; rollup-2.61.1/test/form/samples/export-all-multiple/_expected/iife.js000066400000000000000000000014141415504077600256470ustar00rootroot00000000000000var myBundle = (function (exports, foo, bar, baz) { 'use strict'; Object.keys(foo).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return foo[k]; } }); }); Object.keys(bar).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return bar[k]; } }); }); Object.keys(baz).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return baz[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, foo, bar, baz); rollup-2.61.1/test/form/samples/export-all-multiple/_expected/system.js000066400000000000000000000012411415504077600262550ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/export-all-multiple/_expected/umd.js000066400000000000000000000021621415504077600255210ustar00rootroot00000000000000(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' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return foo[k]; } }); }); Object.keys(bar).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return bar[k]; } }); }); Object.keys(baz).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return baz[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/export-all-multiple/main.js000066400000000000000000000000771415504077600237230ustar00rootroot00000000000000export * from 'foo'; export * from 'bar'; export * from 'baz'; rollup-2.61.1/test/form/samples/export-default-2/000077500000000000000000000000001415504077600216175ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-default-2/_config.js000066400000000000000000000001601415504077600235560ustar00rootroot00000000000000module.exports = { description: 're-exporting a default export', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/export-default-2/_expected/000077500000000000000000000000001415504077600235575ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-default-2/_expected/amd.js000066400000000000000000000001071415504077600246540ustar00rootroot00000000000000define((function () { 'use strict'; var bar = 1; return bar; })); rollup-2.61.1/test/form/samples/export-default-2/_expected/cjs.js000066400000000000000000000000631415504077600246730ustar00rootroot00000000000000'use strict'; var bar = 1; module.exports = bar; rollup-2.61.1/test/form/samples/export-default-2/_expected/es.js000066400000000000000000000000511415504077600245200ustar00rootroot00000000000000var bar = 1; export { bar as default }; rollup-2.61.1/test/form/samples/export-default-2/_expected/iife.js000066400000000000000000000001211415504077600250230ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var bar = 1; return bar; })(); rollup-2.61.1/test/form/samples/export-default-2/_expected/system.js000066400000000000000000000002351415504077600254410ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var bar = exports('default', 1); }) }; })); rollup-2.61.1/test/form/samples/export-default-2/_expected/umd.js000066400000000000000000000005561415504077600247100ustar00rootroot00000000000000(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-2.61.1/test/form/samples/export-default-2/bar.js000066400000000000000000000000421415504077600227150ustar00rootroot00000000000000var bar = 1; export default bar; rollup-2.61.1/test/form/samples/export-default-2/main.js000066400000000000000000000000571415504077600231030ustar00rootroot00000000000000export { default as default } from './bar.js'; rollup-2.61.1/test/form/samples/export-default-3/000077500000000000000000000000001415504077600216205ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-default-3/_config.js000066400000000000000000000001601415504077600235570ustar00rootroot00000000000000module.exports = { description: 're-exporting a default export', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/export-default-3/_expected/000077500000000000000000000000001415504077600235605ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-default-3/_expected/amd.js000066400000000000000000000001071415504077600246550ustar00rootroot00000000000000define((function () { 'use strict'; var bar = 1; return bar; })); rollup-2.61.1/test/form/samples/export-default-3/_expected/cjs.js000066400000000000000000000000631415504077600246740ustar00rootroot00000000000000'use strict'; var bar = 1; module.exports = bar; rollup-2.61.1/test/form/samples/export-default-3/_expected/es.js000066400000000000000000000000511415504077600245210ustar00rootroot00000000000000var bar = 1; export { bar as default }; rollup-2.61.1/test/form/samples/export-default-3/_expected/iife.js000066400000000000000000000001211415504077600250240ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var bar = 1; return bar; })(); rollup-2.61.1/test/form/samples/export-default-3/_expected/system.js000066400000000000000000000002351415504077600254420ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var bar = exports('default', 1); }) }; })); rollup-2.61.1/test/form/samples/export-default-3/_expected/umd.js000066400000000000000000000005561415504077600247110ustar00rootroot00000000000000(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-2.61.1/test/form/samples/export-default-3/bar.js000066400000000000000000000000421415504077600227160ustar00rootroot00000000000000var bar = 1; export default bar; rollup-2.61.1/test/form/samples/export-default-3/main.js000066400000000000000000000000611415504077600230770ustar00rootroot00000000000000import foo from './bar.js'; export default foo; rollup-2.61.1/test/form/samples/export-default-4/000077500000000000000000000000001415504077600216215ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-default-4/_config.js000066400000000000000000000002051415504077600235600ustar00rootroot00000000000000module.exports = { description: 'single default export in deep namespace', options: { output: { name: 'my.global.namespace' } } }; rollup-2.61.1/test/form/samples/export-default-4/_expected/000077500000000000000000000000001415504077600235615ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-default-4/_expected/amd.js000066400000000000000000000001121415504077600246520ustar00rootroot00000000000000define((function () { 'use strict'; var main = 42; return main; })); rollup-2.61.1/test/form/samples/export-default-4/_expected/cjs.js000066400000000000000000000000661415504077600247000ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-2.61.1/test/form/samples/export-default-4/_expected/es.js000066400000000000000000000000541415504077600245250ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-2.61.1/test/form/samples/export-default-4/_expected/iife.js000066400000000000000000000002401415504077600250270ustar00rootroot00000000000000this.my = this.my || {}; this.my.global = this.my.global || {}; this.my.global.namespace = (function () { 'use strict'; var main = 42; return main; })(); rollup-2.61.1/test/form/samples/export-default-4/_expected/system.js000066400000000000000000000002521415504077600254420ustar00rootroot00000000000000System.register('my.global.namespace', [], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', 42); }) }; })); rollup-2.61.1/test/form/samples/export-default-4/_expected/umd.js000066400000000000000000000007061415504077600247070ustar00rootroot00000000000000(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-2.61.1/test/form/samples/export-default-4/main.js000066400000000000000000000000231415504077600230760ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/form/samples/export-default-anonymous-declarations/000077500000000000000000000000001415504077600261545ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-default-anonymous-declarations/_config.js000066400000000000000000000001341415504077600301140ustar00rootroot00000000000000module.exports = { description: 'export default [Declaration] with spaces and comments' }; rollup-2.61.1/test/form/samples/export-default-anonymous-declarations/_expected/000077500000000000000000000000001415504077600301145ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-default-anonymous-declarations/_expected/amd.js000066400000000000000000000021011415504077600312050ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/export-default-anonymous-declarations/_expected/cjs.js000066400000000000000000000016631415504077600312370ustar00rootroot00000000000000'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-2.61.1/test/form/samples/export-default-anonymous-declarations/_expected/es.js000066400000000000000000000016441415504077600310660ustar00rootroot00000000000000// 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-2.61.1/test/form/samples/export-default-anonymous-declarations/_expected/iife.js000066400000000000000000000020751415504077600313720ustar00rootroot00000000000000(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-2.61.1/test/form/samples/export-default-anonymous-declarations/_expected/system.js000066400000000000000000000025471415504077600320060ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/export-default-anonymous-declarations/_expected/umd.js000066400000000000000000000022411415504077600312360ustar00rootroot00000000000000(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-2.61.1/test/form/samples/export-default-anonymous-declarations/async.js000066400000000000000000000003371415504077600276320ustar00rootroot00000000000000export /* comment */ // aaaa /* foo */ default // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol async /* [no LineTerminator here] */ function //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } rollup-2.61.1/test/form/samples/export-default-anonymous-declarations/class.js000066400000000000000000000003731415504077600276220ustar00rootroot00000000000000export /* comment */ // aaaa /* foo */ default // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol class /* oiasnpiueno */ /// iauianpns /* aiusni */ //iian iaouns /* aaain ob skubz */ { constructor() { console.log("Foo"); } } rollup-2.61.1/test/form/samples/export-default-anonymous-declarations/fn.js000066400000000000000000000002741415504077600271200ustar00rootroot00000000000000export /* comment */ // aaaa /* foo */ default // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol function //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } rollup-2.61.1/test/form/samples/export-default-anonymous-declarations/generator.js000066400000000000000000000003541415504077600305020ustar00rootroot00000000000000export /* comment */ // aaaa /* foo */ default // jsjjjsjjjjsjs /* jsjjddjksj */ // Too many comments lol function /* oiasnpiueno */ /// iauianpns /* aiusni */ * //iian iaouns /* aaain ob skubz */ () { console.log("Foo"); } rollup-2.61.1/test/form/samples/export-default-anonymous-declarations/main.js000066400000000000000000000004651415504077600274430ustar00rootroot00000000000000import 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-2.61.1/test/form/samples/export-default-anonymous-declarations/spacelessFn.js000066400000000000000000000001151415504077600307550ustar00rootroot00000000000000export/* 1 */default/* 2 */function/* 3 */()/* 4 */{ console.log("Foo"); } rollup-2.61.1/test/form/samples/export-default-anonymous-declarations/spacelessGenerator.js000066400000000000000000000000641415504077600323430ustar00rootroot00000000000000export default function*(){ console.log("Foo"); } rollup-2.61.1/test/form/samples/export-default-global/000077500000000000000000000000001415504077600227165ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-default-global/_config.js000066400000000000000000000001731415504077600246610ustar00rootroot00000000000000module.exports = { description: 'handles default exporting global variables', options: { output: { name: 'bundle' } } }; rollup-2.61.1/test/form/samples/export-default-global/_expected/000077500000000000000000000000001415504077600246565ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-default-global/_expected/amd.js000066400000000000000000000001461415504077600257560ustar00rootroot00000000000000define((function () { 'use strict'; var value = global; console.log(value); return value; })); rollup-2.61.1/test/form/samples/export-default-global/_expected/cjs.js000066400000000000000000000001211415504077600257650ustar00rootroot00000000000000'use strict'; var value = global; console.log(value); module.exports = value; rollup-2.61.1/test/form/samples/export-default-global/_expected/es.js000066400000000000000000000001071415504077600256210ustar00rootroot00000000000000var value = global; console.log(value); export { value as default }; rollup-2.61.1/test/form/samples/export-default-global/_expected/iife.js000066400000000000000000000001561415504077600261320ustar00rootroot00000000000000var bundle = (function () { 'use strict'; var value = global; console.log(value); return value; })(); rollup-2.61.1/test/form/samples/export-default-global/_expected/system.js000066400000000000000000000002721415504077600265410ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { var value = exports('default', global); console.log(value); }) }; })); rollup-2.61.1/test/form/samples/export-default-global/_expected/umd.js000066400000000000000000000006131415504077600260010ustar00rootroot00000000000000(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-2.61.1/test/form/samples/export-default-global/lib.js000066400000000000000000000000261415504077600240200ustar00rootroot00000000000000export default global;rollup-2.61.1/test/form/samples/export-default-global/main.js000066400000000000000000000001111415504077600241710ustar00rootroot00000000000000import value from './lib.js'; console.log(value); export default value; rollup-2.61.1/test/form/samples/export-default-import/000077500000000000000000000000001415504077600227705ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-default-import/_config.js000066400000000000000000000003001415504077600247230ustar00rootroot00000000000000module.exports = { description: 'correctly exports a default import, even in ES mode (#513)', options: { external: ['x'], output: { globals: { x: 'x' }, name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/export-default-import/_expected/000077500000000000000000000000001415504077600247305ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-default-import/_expected/amd.js000066400000000000000000000006561415504077600260360ustar00rootroot00000000000000define(['exports', 'x'], (function (exports, x) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var x__default = /*#__PURE__*/_interopDefaultLegacy(x); Object.defineProperty(exports, 'x', { enumerable: true, get: function () { return x__default["default"]; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/export-default-import/_expected/cjs.js000066400000000000000000000006061415504077600260470ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var x = require('x'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var x__default = /*#__PURE__*/_interopDefaultLegacy(x); Object.defineProperty(exports, 'x', { enumerable: true, get: function () { return x__default["default"]; } }); rollup-2.61.1/test/form/samples/export-default-import/_expected/es.js000066400000000000000000000000421415504077600256710ustar00rootroot00000000000000export { default as x } from 'x'; rollup-2.61.1/test/form/samples/export-default-import/_expected/iife.js000066400000000000000000000006751415504077600262120ustar00rootroot00000000000000var myBundle = (function (exports, x) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var x__default = /*#__PURE__*/_interopDefaultLegacy(x); Object.defineProperty(exports, 'x', { enumerable: true, get: function () { return x__default["default"]; } }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, x); rollup-2.61.1/test/form/samples/export-default-import/_expected/system.js000066400000000000000000000003071415504077600266120ustar00rootroot00000000000000System.register('myBundle', ['x'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('x', module["default"]); }], execute: (function () { }) }; })); rollup-2.61.1/test/form/samples/export-default-import/_expected/umd.js000066400000000000000000000013451415504077600260560ustar00rootroot00000000000000(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 _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var x__default = /*#__PURE__*/_interopDefaultLegacy(x); Object.defineProperty(exports, 'x', { enumerable: true, get: function () { return x__default["default"]; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/export-default-import/main.js000066400000000000000000000000421415504077600242460ustar00rootroot00000000000000import x from 'x'; export { x }; rollup-2.61.1/test/form/samples/export-default/000077500000000000000000000000001415504077600214605ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-default/_config.js000066400000000000000000000001531415504077600234210ustar00rootroot00000000000000module.exports = { description: 'single (default) exports', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/export-default/_expected/000077500000000000000000000000001415504077600234205ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-default/_expected/amd.js000066400000000000000000000001121415504077600245110ustar00rootroot00000000000000define((function () { 'use strict'; var main = 42; return main; })); rollup-2.61.1/test/form/samples/export-default/_expected/cjs.js000066400000000000000000000000661415504077600245370ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-2.61.1/test/form/samples/export-default/_expected/es.js000066400000000000000000000000541415504077600243640ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-2.61.1/test/form/samples/export-default/_expected/iife.js000066400000000000000000000001241415504077600246670ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var main = 42; return main; })(); rollup-2.61.1/test/form/samples/export-default/_expected/system.js000066400000000000000000000002371415504077600253040ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', 42); }) }; })); rollup-2.61.1/test/form/samples/export-default/_expected/umd.js000066400000000000000000000005611415504077600245450ustar00rootroot00000000000000(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-2.61.1/test/form/samples/export-default/main.js000066400000000000000000000000231415504077600227350ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/form/samples/export-globals/000077500000000000000000000000001415504077600214575ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-globals/Number.js000066400000000000000000000003571415504077600232520ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/export-globals/_config.js000066400000000000000000000004221415504077600234170ustar00rootroot00000000000000// Changed due to https://github.com/acornjs/acorn/issues/806 // Consider reverting this change should this become an acorn option module.exports = { description: 'Supports reexports of globals with namespace access', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/export-globals/_expected/000077500000000000000000000000001415504077600234175ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-globals/_expected/amd.js000066400000000000000000000003241415504077600245150ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const localIsNaN = isNaN; const isNaN$1 = localIsNaN; exports.isNaN = isNaN$1; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/export-globals/_expected/cjs.js000066400000000000000000000002401415504077600245300ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const localIsNaN = isNaN; const isNaN$1 = localIsNaN; exports.isNaN = isNaN$1; rollup-2.61.1/test/form/samples/export-globals/_expected/es.js000066400000000000000000000001251415504077600243620ustar00rootroot00000000000000const localIsNaN = isNaN; const isNaN$1 = localIsNaN; export { isNaN$1 as isNaN }; rollup-2.61.1/test/form/samples/export-globals/_expected/iife.js000066400000000000000000000003451415504077600246730ustar00rootroot00000000000000var myBundle = (function (exports) { 'use strict'; const localIsNaN = isNaN; const isNaN$1 = localIsNaN; exports.isNaN = isNaN$1; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/export-globals/_expected/system.js000066400000000000000000000003101415504077600252730ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { const localIsNaN = isNaN; const isNaN$1 = exports('isNaN', localIsNaN); }) }; })); rollup-2.61.1/test/form/samples/export-globals/_expected/umd.js000066400000000000000000000007631415504077600245500ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/export-globals/main.js000066400000000000000000000001071415504077600227370ustar00rootroot00000000000000import * as Number from './Number'; export const isNaN = Number.isNaN; rollup-2.61.1/test/form/samples/export-internal-namespace-as/000077500000000000000000000000001415504077600242035ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-internal-namespace-as/_config.js000066400000000000000000000001441415504077600261440ustar00rootroot00000000000000module.exports = { description: 'supports exporting and resolving internal namespaces as names' }; rollup-2.61.1/test/form/samples/export-internal-namespace-as/_expected.js000066400000000000000000000003431415504077600265010ustar00rootroot00000000000000const foo$1 = 'foo1'; const foo = 'foo2'; const bar = 'bar2'; var dep2 = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo, bar: bar }); console.log(foo$1); console.log(foo$1); console.log(dep2); console.log(dep2); rollup-2.61.1/test/form/samples/export-internal-namespace-as/dep1.js000066400000000000000000000000661415504077600253740ustar00rootroot00000000000000export const foo = 'foo1'; export const bar = 'bar1'; rollup-2.61.1/test/form/samples/export-internal-namespace-as/dep2.js000066400000000000000000000000661415504077600253750ustar00rootroot00000000000000export const foo = 'foo2'; export const bar = 'bar2'; rollup-2.61.1/test/form/samples/export-internal-namespace-as/main.js000066400000000000000000000004001415504077600254570ustar00rootroot00000000000000import * 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-2.61.1/test/form/samples/export-internal-namespace-as/reexport.js000066400000000000000000000001061415504077600264060ustar00rootroot00000000000000export * as dep1 from './dep1.js'; export * as dep2 from './dep2.js'; rollup-2.61.1/test/form/samples/export-live-bindings/000077500000000000000000000000001415504077600225665ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-live-bindings/_config.js000066400000000000000000000001551415504077600245310ustar00rootroot00000000000000module.exports = { description: 'exported live bindings', options: { output: { name: 'iife' } } }; rollup-2.61.1/test/form/samples/export-live-bindings/_expected/000077500000000000000000000000001415504077600245265ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-live-bindings/_expected/amd.js000066400000000000000000000012041415504077600256220ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/export-live-bindings/_expected/cjs.js000066400000000000000000000010421415504077600256400ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/form/samples/export-live-bindings/_expected/es.js000066400000000000000000000006041415504077600254730ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/export-live-bindings/_expected/iife.js000066400000000000000000000012231415504077600257760ustar00rootroot00000000000000var 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; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/export-live-bindings/_expected/system.js000066400000000000000000000013701415504077600264110ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/export-live-bindings/_expected/umd.js000066400000000000000000000016421415504077600256540ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/export-live-bindings/bar.js000066400000000000000000000000741415504077600236710ustar00rootroot00000000000000export function update () { bar++; } export let bar = 10;rollup-2.61.1/test/form/samples/export-live-bindings/baz.js000066400000000000000000000000741415504077600237010ustar00rootroot00000000000000export function update () { ++baz; } export let baz = 10;rollup-2.61.1/test/form/samples/export-live-bindings/foo.js000066400000000000000000000001001415504077600236760ustar00rootroot00000000000000export function update () { foo += 10; } export let foo = 10;rollup-2.61.1/test/form/samples/export-live-bindings/main.js000066400000000000000000000005451415504077600240540ustar00rootroot00000000000000import { 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-2.61.1/test/form/samples/export-multiple-vars/000077500000000000000000000000001415504077600226405ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-multiple-vars/_config.js000066400000000000000000000001351415504077600246010ustar00rootroot00000000000000module.exports = { description: 'splits up multiple vars in a single export declaration' }; rollup-2.61.1/test/form/samples/export-multiple-vars/_expected/000077500000000000000000000000001415504077600246005ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-multiple-vars/_expected/amd.js000066400000000000000000000002271415504077600257000ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/export-multiple-vars/_expected/cjs.js000066400000000000000000000001651415504077600257170ustar00rootroot00000000000000'use strict'; var a = 1; var e = 5; var i = 9; assert.equal( a, 1 ); assert.equal( e, 5 ); assert.equal( i, 9 ); rollup-2.61.1/test/form/samples/export-multiple-vars/_expected/es.js000066400000000000000000000001461415504077600255460ustar00rootroot00000000000000var a = 1; var e = 5; var i = 9; assert.equal( a, 1 ); assert.equal( e, 5 ); assert.equal( i, 9 ); rollup-2.61.1/test/form/samples/export-multiple-vars/_expected/iife.js000066400000000000000000000002221415504077600260460ustar00rootroot00000000000000(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-2.61.1/test/form/samples/export-multiple-vars/_expected/system.js000066400000000000000000000003361415504077600264640ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/export-multiple-vars/_expected/umd.js000066400000000000000000000003651415504077600257270ustar00rootroot00000000000000(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-2.61.1/test/form/samples/export-multiple-vars/bar.js000066400000000000000000000000401415504077600237340ustar00rootroot00000000000000export var d = 4, e = 5, f = 6; rollup-2.61.1/test/form/samples/export-multiple-vars/baz.js000066400000000000000000000000401415504077600237440ustar00rootroot00000000000000export var g = 7, h = 8, i = 9; rollup-2.61.1/test/form/samples/export-multiple-vars/foo.js000066400000000000000000000000401415504077600237530ustar00rootroot00000000000000export var a = 1, b = 2, c = 3; rollup-2.61.1/test/form/samples/export-multiple-vars/main.js000066400000000000000000000002241415504077600241200ustar00rootroot00000000000000import { a } from './foo'; import { e } from './bar'; import { i } from './baz'; assert.equal( a, 1 ); assert.equal( e, 5 ); assert.equal( i, 9 ); rollup-2.61.1/test/form/samples/export-namespace-as/000077500000000000000000000000001415504077600223715ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-namespace-as/_config.js000066400000000000000000000002071415504077600243320ustar00rootroot00000000000000module.exports = { description: 'supports exporting namespaces as names in entry points', options: { output: { name: 'bundle' } } }; rollup-2.61.1/test/form/samples/export-namespace-as/_expected/000077500000000000000000000000001415504077600243315ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/export-namespace-as/_expected/amd.js000066400000000000000000000004271415504077600254330ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const foo = 'foo1'; const bar = 'bar1'; var dep = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo, bar: bar }); exports.dep = dep; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/export-namespace-as/_expected/cjs.js000066400000000000000000000003361415504077600254500ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const foo = 'foo1'; const bar = 'bar1'; var dep = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo, bar: bar }); exports.dep = dep; rollup-2.61.1/test/form/samples/export-namespace-as/_expected/es.js000066400000000000000000000002141415504077600252730ustar00rootroot00000000000000const foo = 'foo1'; const bar = 'bar1'; var dep = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo, bar: bar }); export { dep }; rollup-2.61.1/test/form/samples/export-namespace-as/_expected/iife.js000066400000000000000000000004461415504077600256070ustar00rootroot00000000000000var bundle = (function (exports) { 'use strict'; const foo = 'foo1'; const bar = 'bar1'; var dep = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo, bar: bar }); exports.dep = dep; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/export-namespace-as/_expected/system.js000066400000000000000000000004371415504077600262170ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { const foo = 'foo1'; const bar = 'bar1'; var dep = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo, bar: bar }); exports('dep', dep); }) }; })); rollup-2.61.1/test/form/samples/export-namespace-as/_expected/umd.js000066400000000000000000000010641415504077600254550ustar00rootroot00000000000000(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, foo: foo, bar: bar }); exports.dep = dep; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/export-namespace-as/dep.js000066400000000000000000000000661415504077600235010ustar00rootroot00000000000000export const foo = 'foo1'; export const bar = 'bar1'; rollup-2.61.1/test/form/samples/export-namespace-as/main.js000066400000000000000000000000411415504077600236460ustar00rootroot00000000000000export * as dep from './dep.js'; rollup-2.61.1/test/form/samples/exports-at-end-if-possible/000077500000000000000000000000001415504077600236015ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/exports-at-end-if-possible/_config.js000066400000000000000000000001701415504077600255410ustar00rootroot00000000000000module.exports = { description: 'exports variables at end, if possible', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/exports-at-end-if-possible/_expected/000077500000000000000000000000001415504077600255415ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/exports-at-end-if-possible/_expected/amd.js000066400000000000000000000003471415504077600266440ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var FOO = 'foo'; console.log( FOO ); console.log( FOO ); console.log( FOO ); exports.FOO = FOO; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/exports-at-end-if-possible/_expected/cjs.js000066400000000000000000000002611415504077600266550ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var FOO = 'foo'; console.log( FOO ); console.log( FOO ); console.log( FOO ); exports.FOO = FOO; rollup-2.61.1/test/form/samples/exports-at-end-if-possible/_expected/es.js000066400000000000000000000001371415504077600265070ustar00rootroot00000000000000var FOO = 'foo'; console.log( FOO ); console.log( FOO ); console.log( FOO ); export { FOO }; rollup-2.61.1/test/form/samples/exports-at-end-if-possible/_expected/iife.js000066400000000000000000000003701415504077600270130ustar00rootroot00000000000000var myBundle = (function (exports) { 'use strict'; var FOO = 'foo'; console.log( FOO ); console.log( FOO ); console.log( FOO ); exports.FOO = FOO; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/exports-at-end-if-possible/_expected/system.js000066400000000000000000000003431415504077600274230ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var FOO = exports('FOO', 'foo'); console.log( FOO ); console.log( FOO ); console.log( FOO ); }) }; })); rollup-2.61.1/test/form/samples/exports-at-end-if-possible/_expected/umd.js000066400000000000000000000010061415504077600266610ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/exports-at-end-if-possible/main.js000066400000000000000000000001251415504077600250610ustar00rootroot00000000000000export var FOO = 'foo'; console.log( FOO ); console.log( FOO ); console.log( FOO ); rollup-2.61.1/test/form/samples/extend-exports/000077500000000000000000000000001415504077600215065ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/extend-exports/_config.js000066400000000000000000000001771415504077600234550ustar00rootroot00000000000000module.exports = { description: 'extends module correctly', options: { output: { extend: true, name: 'foo' } } }; rollup-2.61.1/test/form/samples/extend-exports/_expected/000077500000000000000000000000001415504077600234465ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/extend-exports/_expected/amd.js000066400000000000000000000002571415504077600245510ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const answer = 42; exports.answer = answer; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/extend-exports/_expected/cjs.js000066400000000000000000000001741415504077600245650ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const answer = 42; exports.answer = answer; rollup-2.61.1/test/form/samples/extend-exports/_expected/es.js000066400000000000000000000000471415504077600244140ustar00rootroot00000000000000const answer = 42; export { answer }; rollup-2.61.1/test/form/samples/extend-exports/_expected/iife.js000066400000000000000000000002661415504077600247240ustar00rootroot00000000000000(function (exports) { 'use strict'; const answer = 42; exports.answer = answer; Object.defineProperty(exports, '__esModule', { value: true }); })(this.foo = this.foo || {}); rollup-2.61.1/test/form/samples/extend-exports/_expected/system.js000066400000000000000000000002351415504077600253300ustar00rootroot00000000000000System.register('foo', [], (function (exports) { 'use strict'; return { execute: (function () { const answer = exports('answer', 42); }) }; })); rollup-2.61.1/test/form/samples/extend-exports/_expected/umd.js000066400000000000000000000007271415504077600245770ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/extend-exports/main.js000066400000000000000000000000321415504077600227630ustar00rootroot00000000000000export const answer = 42; rollup-2.61.1/test/form/samples/extend-namespaced-exports/000077500000000000000000000000001415504077600236045ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/extend-namespaced-exports/_config.js000066400000000000000000000002151415504077600255440ustar00rootroot00000000000000module.exports = { description: 'extends namespaced module name', options: { output: { extend: true, name: 'foo.bar.baz' } } }; rollup-2.61.1/test/form/samples/extend-namespaced-exports/_expected/000077500000000000000000000000001415504077600255445ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/extend-namespaced-exports/_expected/amd.js000066400000000000000000000002571415504077600266470ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const answer = 42; exports.answer = answer; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/extend-namespaced-exports/_expected/cjs.js000066400000000000000000000001741415504077600266630ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const answer = 42; exports.answer = answer; rollup-2.61.1/test/form/samples/extend-namespaced-exports/_expected/es.js000066400000000000000000000000471415504077600265120ustar00rootroot00000000000000const answer = 42; export { answer }; rollup-2.61.1/test/form/samples/extend-namespaced-exports/_expected/iife.js000066400000000000000000000004041415504077600270140ustar00rootroot00000000000000this.foo = this.foo || {}; this.foo.bar = this.foo.bar || {}; (function (exports) { 'use strict'; const answer = 42; exports.answer = answer; Object.defineProperty(exports, '__esModule', { value: true }); })(this.foo.bar.baz = this.foo.bar.baz || {}); rollup-2.61.1/test/form/samples/extend-namespaced-exports/_expected/system.js000066400000000000000000000002451415504077600274270ustar00rootroot00000000000000System.register('foo.bar.baz', [], (function (exports) { 'use strict'; return { execute: (function () { const answer = exports('answer', 42); }) }; })); rollup-2.61.1/test/form/samples/extend-namespaced-exports/_expected/umd.js000066400000000000000000000010571415504077600266720ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/extend-namespaced-exports/main.js000066400000000000000000000000321415504077600250610ustar00rootroot00000000000000export const answer = 42; rollup-2.61.1/test/form/samples/external-deshadowing/000077500000000000000000000000001415504077600226315ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/external-deshadowing/_config.js000066400000000000000000000002651415504077600245760ustar00rootroot00000000000000module.exports = { description: 'Externals aliases with deshadowing', options: { external: ['a', 'b'], output: { globals: { a: 'a', b: 'b' }, name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/external-deshadowing/_expected/000077500000000000000000000000001415504077600245715ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/external-deshadowing/_expected/amd.js000066400000000000000000000007761415504077600257020ustar00rootroot00000000000000define(['exports', 'a', 'b'], (function (exports, a, Test$1) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var Test__default = /*#__PURE__*/_interopDefaultLegacy(Test$1); const Test = () => { console.log(a.Test); }; const Test1 = () => { console.log(Test__default["default"]); }; exports.Test = Test; exports.Test1 = Test1; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/external-deshadowing/_expected/cjs.js000066400000000000000000000007251415504077600257120ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var a = require('a'); var Test$1 = require('b'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var Test__default = /*#__PURE__*/_interopDefaultLegacy(Test$1); const Test = () => { console.log(a.Test); }; const Test1 = () => { console.log(Test__default["default"]); }; exports.Test = Test; exports.Test1 = Test1; rollup-2.61.1/test/form/samples/external-deshadowing/_expected/es.js000066400000000000000000000002661415504077600255420ustar00rootroot00000000000000import { 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-2.61.1/test/form/samples/external-deshadowing/_expected/iife.js000066400000000000000000000010151415504077600260400ustar00rootroot00000000000000var myBundle = (function (exports, a, Test$1) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var Test__default = /*#__PURE__*/_interopDefaultLegacy(Test$1); const Test = () => { console.log(a.Test); }; const Test1 = () => { console.log(Test__default["default"]); }; exports.Test = Test; exports.Test1 = Test1; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, a, b); rollup-2.61.1/test/form/samples/external-deshadowing/_expected/system.js000066400000000000000000000007101415504077600264510ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/external-deshadowing/_expected/umd.js000066400000000000000000000015201415504077600257120ustar00rootroot00000000000000(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'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var Test__default = /*#__PURE__*/_interopDefaultLegacy(Test$1); const Test = () => { console.log(a.Test); }; const Test1 = () => { console.log(Test__default["default"]); }; exports.Test = Test; exports.Test1 = Test1; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/external-deshadowing/component-one.js000066400000000000000000000001301415504077600257420ustar00rootroot00000000000000import { Test as Test1 } from 'a'; export const Test = () => { console.log(Test1); };rollup-2.61.1/test/form/samples/external-deshadowing/component-two.js000066400000000000000000000001131415504077600257730ustar00rootroot00000000000000import Test from 'b'; export const Test1 = () => { console.log(Test); };rollup-2.61.1/test/form/samples/external-deshadowing/main.js000066400000000000000000000001261415504077600241120ustar00rootroot00000000000000export { Test } from './component-one.js'; export { Test1 } from './component-two.js';rollup-2.61.1/test/form/samples/external-empty-import-no-global-b/000077500000000000000000000000001415504077600250725ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/external-empty-import-no-global-b/_config.js000066400000000000000000000004431415504077600270350ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/form/samples/external-empty-import-no-global-b/_expected/000077500000000000000000000000001415504077600270325ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/external-empty-import-no-global-b/_expected/amd.js000066400000000000000000000002231415504077600301260ustar00rootroot00000000000000define(['babel-polyfill', 'other'], (function (babelPolyfill, other) { 'use strict'; other.x(); var main = new WeakMap(); return main; })); rollup-2.61.1/test/form/samples/external-empty-import-no-global-b/_expected/cjs.js000066400000000000000000000002071415504077600301460ustar00rootroot00000000000000'use strict'; require('babel-polyfill'); var other = require('other'); other.x(); var main = new WeakMap(); module.exports = main; rollup-2.61.1/test/form/samples/external-empty-import-no-global-b/_expected/es.js000066400000000000000000000001621415504077600277760ustar00rootroot00000000000000import 'babel-polyfill'; import { x } from 'other'; x(); var main = new WeakMap(); export { main as default }; rollup-2.61.1/test/form/samples/external-empty-import-no-global-b/_expected/iife.js000066400000000000000000000002131415504077600303000ustar00rootroot00000000000000var myBundle = (function (babelPolyfill, other) { 'use strict'; other.x(); var main = new WeakMap(); return main; })(null, other); rollup-2.61.1/test/form/samples/external-empty-import-no-global-b/_expected/system.js000066400000000000000000000004331415504077600307140ustar00rootroot00000000000000System.register('myBundle', ['babel-polyfill', 'other'], (function (exports) { 'use strict'; var x; return { setters: [function () {}, function (module) { x = module.x; }], execute: (function () { x(); var main = exports('default', new WeakMap()); }) }; })); rollup-2.61.1/test/form/samples/external-empty-import-no-global-b/_expected/umd.js000066400000000000000000000007671415504077600301670ustar00rootroot00000000000000(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-2.61.1/test/form/samples/external-empty-import-no-global-b/main.js000066400000000000000000000001311415504077600263470ustar00rootroot00000000000000import 'babel-polyfill'; import { x } from 'other'; x(); export default new WeakMap(); rollup-2.61.1/test/form/samples/external-empty-import-no-global/000077500000000000000000000000001415504077600246535ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/external-empty-import-no-global/_config.js000066400000000000000000000003721415504077600266170ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/form/samples/external-empty-import-no-global/_expected/000077500000000000000000000000001415504077600266135ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/external-empty-import-no-global/_expected/amd.js000066400000000000000000000001661415504077600277150ustar00rootroot00000000000000define(['babel-polyfill'], (function (babelPolyfill) { 'use strict'; var main = new WeakMap(); return main; })); rollup-2.61.1/test/form/samples/external-empty-import-no-global/_expected/cjs.js000066400000000000000000000001351415504077600277270ustar00rootroot00000000000000'use strict'; require('babel-polyfill'); var main = new WeakMap(); module.exports = main; rollup-2.61.1/test/form/samples/external-empty-import-no-global/_expected/es.js000066400000000000000000000001211415504077600275520ustar00rootroot00000000000000import 'babel-polyfill'; var main = new WeakMap(); export { main as default }; rollup-2.61.1/test/form/samples/external-empty-import-no-global/_expected/iife.js000066400000000000000000000001371415504077600300660ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var main = new WeakMap(); return main; })(); rollup-2.61.1/test/form/samples/external-empty-import-no-global/_expected/system.js000066400000000000000000000003271415504077600304770ustar00rootroot00000000000000System.register('myBundle', ['babel-polyfill'], (function (exports) { 'use strict'; return { setters: [function () {}], execute: (function () { var main = exports('default', new WeakMap()); }) }; })); rollup-2.61.1/test/form/samples/external-empty-import-no-global/_expected/umd.js000066400000000000000000000006511415504077600277400ustar00rootroot00000000000000(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-2.61.1/test/form/samples/external-empty-import-no-global/main.js000066400000000000000000000000701415504077600261320ustar00rootroot00000000000000import 'babel-polyfill'; export default new WeakMap(); rollup-2.61.1/test/form/samples/external-export-tracing/000077500000000000000000000000001415504077600233035ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/external-export-tracing/_config.js000066400000000000000000000002761415504077600252520ustar00rootroot00000000000000module.exports = { description: 'Support external namespace reexport', options: { external: ['external'], output: { globals: { external: 'external' }, name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/external-export-tracing/_expected/000077500000000000000000000000001415504077600252435ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/external-export-tracing/_expected/amd.js000066400000000000000000000004021415504077600263360ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, external) { 'use strict'; Object.defineProperty(exports, 's', { enumerable: true, get: function () { return external.p; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/external-export-tracing/_expected/cjs.js000066400000000000000000000003341415504077600263600ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var external = require('external'); Object.defineProperty(exports, 's', { enumerable: true, get: function () { return external.p; } }); rollup-2.61.1/test/form/samples/external-export-tracing/_expected/es.js000066400000000000000000000000431415504077600262050ustar00rootroot00000000000000export { p as s } from 'external'; rollup-2.61.1/test/form/samples/external-export-tracing/_expected/iife.js000066400000000000000000000004211415504077600265120ustar00rootroot00000000000000var myBundle = (function (exports, external) { 'use strict'; Object.defineProperty(exports, 's', { enumerable: true, get: function () { return external.p; } }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, external); rollup-2.61.1/test/form/samples/external-export-tracing/_expected/system.js000066400000000000000000000003051415504077600271230ustar00rootroot00000000000000System.register('myBundle', ['external'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('s', module.p); }], execute: (function () { }) }; })); rollup-2.61.1/test/form/samples/external-export-tracing/_expected/umd.js000066400000000000000000000011051415504077600263630ustar00rootroot00000000000000(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; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/external-export-tracing/dep.js000066400000000000000000000000641415504077600244110ustar00rootroot00000000000000import { p as q } from 'external'; export { q as r }rollup-2.61.1/test/form/samples/external-export-tracing/main.js000066400000000000000000000000421415504077600245610ustar00rootroot00000000000000export { r as s } from './dep.js';rollup-2.61.1/test/form/samples/external-import-alias-shadow/000077500000000000000000000000001415504077600242215ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/external-import-alias-shadow/_config.js000066400000000000000000000002741415504077600261660ustar00rootroot00000000000000module.exports = { description: 'handles external aliased named imports that shadow another name', options: { external: ['acorn'], output: { globals: { acorn: 'acorn' } } } }; rollup-2.61.1/test/form/samples/external-import-alias-shadow/_expected/000077500000000000000000000000001415504077600261615ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/external-import-alias-shadow/_expected/amd.js000066400000000000000000000002471415504077600272630ustar00rootroot00000000000000define(['acorn'], (function (acorn) { 'use strict'; function parse(source) { return acorn.parse(source, { ecmaVersion: 6 }); } console.log(parse('foo')); })); rollup-2.61.1/test/form/samples/external-import-alias-shadow/_expected/cjs.js000066400000000000000000000002261415504077600272760ustar00rootroot00000000000000'use strict'; var acorn = require('acorn'); function parse(source) { return acorn.parse(source, { ecmaVersion: 6 }); } console.log(parse('foo')); rollup-2.61.1/test/form/samples/external-import-alias-shadow/_expected/es.js000066400000000000000000000002171415504077600271260ustar00rootroot00000000000000import { parse as parse$1 } from 'acorn'; function parse(source) { return parse$1(source, { ecmaVersion: 6 }); } console.log(parse('foo')); rollup-2.61.1/test/form/samples/external-import-alias-shadow/_expected/iife.js000066400000000000000000000002341415504077600274320ustar00rootroot00000000000000(function (acorn) { 'use strict'; function parse(source) { return acorn.parse(source, { ecmaVersion: 6 }); } console.log(parse('foo')); })(acorn); rollup-2.61.1/test/form/samples/external-import-alias-shadow/_expected/system.js000066400000000000000000000004541415504077600300460ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/external-import-alias-shadow/_expected/umd.js000066400000000000000000000007071415504077600273100ustar00rootroot00000000000000(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-2.61.1/test/form/samples/external-import-alias-shadow/main.js000066400000000000000000000000711415504077600255010ustar00rootroot00000000000000import parse from './parse'; console.log(parse('foo')); rollup-2.61.1/test/form/samples/external-import-alias-shadow/parse.js000066400000000000000000000002101415504077600256620ustar00rootroot00000000000000import { parse as acornParse } from 'acorn'; export default function parse(source) { return acornParse(source, { ecmaVersion: 6 }); } rollup-2.61.1/test/form/samples/external-import-order/000077500000000000000000000000001415504077600227605ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/external-import-order/_config.js000066400000000000000000000002371415504077600247240ustar00rootroot00000000000000module.exports = { description: 'Retain the execution order of external imports', options: { external(id) { return id.startsWith('external'); } } }; rollup-2.61.1/test/form/samples/external-import-order/_expected.js000066400000000000000000000001641415504077600252570ustar00rootroot00000000000000import 'external-main1'; import 'external-dep'; import 'external-main2'; console.log('dep'); console.log('main'); rollup-2.61.1/test/form/samples/external-import-order/dep.js000066400000000000000000000000541415504077600240650ustar00rootroot00000000000000import 'external-dep'; console.log('dep'); rollup-2.61.1/test/form/samples/external-import-order/main.js000066400000000000000000000001331415504077600242370ustar00rootroot00000000000000import 'external-main1'; import './dep.js'; import 'external-main2'; console.log('main'); rollup-2.61.1/test/form/samples/external-imports-custom-names-function/000077500000000000000000000000001415504077600262665ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/external-imports-custom-names-function/_config.js000066400000000000000000000003021415504077600302230ustar00rootroot00000000000000module.exports = { description: 'allows globals to be specified as a function', options: { external: ['a-b-c'], output: { globals(id) { return id.replace(/-/g, '_'); } } } }; rollup-2.61.1/test/form/samples/external-imports-custom-names-function/_expected/000077500000000000000000000000001415504077600302265ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/external-imports-custom-names-function/_expected/amd.js000066400000000000000000000001051415504077600313210ustar00rootroot00000000000000define(['a-b-c'], (function (aBC) { 'use strict'; aBC.foo(); })); rollup-2.61.1/test/form/samples/external-imports-custom-names-function/_expected/cjs.js000066400000000000000000000000671415504077600313460ustar00rootroot00000000000000'use strict'; var aBC = require('a-b-c'); aBC.foo(); rollup-2.61.1/test/form/samples/external-imports-custom-names-function/_expected/es.js000066400000000000000000000000451415504077600311720ustar00rootroot00000000000000import { foo } from 'a-b-c'; foo(); rollup-2.61.1/test/form/samples/external-imports-custom-names-function/_expected/iife.js000066400000000000000000000000721415504077600314770ustar00rootroot00000000000000(function (aBC) { 'use strict'; aBC.foo(); })(a_b_c); rollup-2.61.1/test/form/samples/external-imports-custom-names-function/_expected/system.js000066400000000000000000000002741415504077600321130ustar00rootroot00000000000000System.register(['a-b-c'], (function () { 'use strict'; var foo; return { setters: [function (module) { foo = module.foo; }], execute: (function () { foo(); }) }; })); rollup-2.61.1/test/form/samples/external-imports-custom-names-function/_expected/umd.js000066400000000000000000000005451415504077600313550ustar00rootroot00000000000000(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-2.61.1/test/form/samples/external-imports-custom-names-function/main.js000066400000000000000000000000441415504077600275460ustar00rootroot00000000000000import { foo } from 'a-b-c'; foo(); rollup-2.61.1/test/form/samples/external-imports-custom-names/000077500000000000000000000000001415504077600244435ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/external-imports-custom-names/_config.js000066400000000000000000000002631415504077600264060ustar00rootroot00000000000000module.exports = { description: 'allows global names to be specified for IIFE/UMD exports', options: { external: ['jquery'], output: { globals: { jquery: 'jQuery' } } } }; rollup-2.61.1/test/form/samples/external-imports-custom-names/_expected/000077500000000000000000000000001415504077600264035ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/external-imports-custom-names/_expected/amd.js000066400000000000000000000005251415504077600275040ustar00rootroot00000000000000define(['jquery'], (function ($) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var $__default = /*#__PURE__*/_interopDefaultLegacy($); $__default["default"]( function () { $__default["default"]( 'body' ).html( '

hello world!

' ); }); })); rollup-2.61.1/test/form/samples/external-imports-custom-names/_expected/cjs.js000066400000000000000000000005031415504077600275160ustar00rootroot00000000000000'use strict'; var $ = require('jquery'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var $__default = /*#__PURE__*/_interopDefaultLegacy($); $__default["default"]( function () { $__default["default"]( 'body' ).html( '

hello world!

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

hello world!

' ); }); rollup-2.61.1/test/form/samples/external-imports-custom-names/_expected/iife.js000066400000000000000000000005121415504077600276530ustar00rootroot00000000000000(function ($) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var $__default = /*#__PURE__*/_interopDefaultLegacy($); $__default["default"]( function () { $__default["default"]( 'body' ).html( '

hello world!

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

hello world!

' ); }); }) }; })); rollup-2.61.1/test/form/samples/external-imports-custom-names/_expected/umd.js000066400000000000000000000011671415504077600275330ustar00rootroot00000000000000(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 _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var $__default = /*#__PURE__*/_interopDefaultLegacy($); $__default["default"]( function () { $__default["default"]( 'body' ).html( '

hello world!

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

hello world!

' ); }); rollup-2.61.1/test/form/samples/external-imports/000077500000000000000000000000001415504077600220325ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/external-imports/_config.js000066400000000000000000000005551415504077600240010ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/form/samples/external-imports/_expected/000077500000000000000000000000001415504077600237725ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/external-imports/_expected/amd.js000066400000000000000000000021001415504077600250620ustar00rootroot00000000000000define(['factory', 'baz', 'shipping-port', 'alphabet'], (function (factory, baz, containers, alphabet) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? 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 factory__default = /*#__PURE__*/_interopDefaultLegacy(factory); var containers__namespace = /*#__PURE__*/_interopNamespace(containers); var alphabet__default = /*#__PURE__*/_interopDefaultLegacy(alphabet); factory__default["default"]( null ); baz.foo( baz.bar, containers.port ); containers__namespace.forEach( console.log, console ); console.log( alphabet.a ); console.log( alphabet__default["default"].length ); })); rollup-2.61.1/test/form/samples/external-imports/_expected/cjs.js000066400000000000000000000021031415504077600251030ustar00rootroot00000000000000'use strict'; var factory = require('factory'); var baz = require('baz'); var containers = require('shipping-port'); var alphabet = require('alphabet'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? 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 factory__default = /*#__PURE__*/_interopDefaultLegacy(factory); var containers__namespace = /*#__PURE__*/_interopNamespace(containers); var alphabet__default = /*#__PURE__*/_interopDefaultLegacy(alphabet); factory__default["default"]( null ); baz.foo( baz.bar, containers.port ); containers__namespace.forEach( console.log, console ); console.log( alphabet.a ); console.log( alphabet__default["default"].length ); rollup-2.61.1/test/form/samples/external-imports/_expected/es.js000066400000000000000000000004741415504077600247440ustar00rootroot00000000000000import 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-2.61.1/test/form/samples/external-imports/_expected/iife.js000066400000000000000000000020541415504077600252450ustar00rootroot00000000000000(function (factory, baz, containers, alphabet) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? 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 factory__default = /*#__PURE__*/_interopDefaultLegacy(factory); var containers__namespace = /*#__PURE__*/_interopNamespace(containers); var alphabet__default = /*#__PURE__*/_interopDefaultLegacy(alphabet); factory__default["default"]( null ); baz.foo( baz.bar, containers.port ); containers__namespace.forEach( console.log, console ); console.log( alphabet.a ); console.log( alphabet__default["default"].length ); })(factory, baz, containers, alphabet); rollup-2.61.1/test/form/samples/external-imports/_expected/system.js000066400000000000000000000011661415504077600256600ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/external-imports/_expected/umd.js000066400000000000000000000027231415504077600251210ustar00rootroot00000000000000(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 _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? 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 factory__default = /*#__PURE__*/_interopDefaultLegacy(factory); var containers__namespace = /*#__PURE__*/_interopNamespace(containers); var alphabet__default = /*#__PURE__*/_interopDefaultLegacy(alphabet); factory__default["default"]( null ); baz.foo( baz.bar, containers.port ); containers__namespace.forEach( console.log, console ); console.log( alphabet.a ); console.log( alphabet__default["default"].length ); })); rollup-2.61.1/test/form/samples/external-imports/main.js000066400000000000000000000004771415504077600233240ustar00rootroot00000000000000import 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-2.61.1/test/form/samples/external-namespace-and-named/000077500000000000000000000000001415504077600241135ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/external-namespace-and-named/_config.js000066400000000000000000000003111415504077600260500ustar00rootroot00000000000000module.exports = { description: 'Correctly handles external namespace tracing with both namespace and named exports', options: { external: ['foo'], output: { globals: { foo: 'foo' } } } }; rollup-2.61.1/test/form/samples/external-namespace-and-named/_expected/000077500000000000000000000000001415504077600260535ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/external-namespace-and-named/_expected/amd.js000066400000000000000000000011421415504077600271500ustar00rootroot00000000000000define(['foo'], (function (foo) { 'use strict'; 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 foo__namespace = /*#__PURE__*/_interopNamespace(foo); console.log(foo__namespace); console.log(foo.blah); console.log(foo.bar); })); rollup-2.61.1/test/form/samples/external-namespace-and-named/_expected/cjs.js000066400000000000000000000011001415504077600271600ustar00rootroot00000000000000'use strict'; var foo = require('foo'); 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 foo__namespace = /*#__PURE__*/_interopNamespace(foo); console.log(foo__namespace); console.log(foo.blah); console.log(foo.bar); rollup-2.61.1/test/form/samples/external-namespace-and-named/_expected/es.js000066400000000000000000000001651415504077600270220ustar00rootroot00000000000000import * as foo from 'foo'; import { blah, bar } from 'foo'; console.log(foo); console.log(blah); console.log(bar); rollup-2.61.1/test/form/samples/external-namespace-and-named/_expected/iife.js000066400000000000000000000011271415504077600273260ustar00rootroot00000000000000(function (foo) { 'use strict'; 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 foo__namespace = /*#__PURE__*/_interopNamespace(foo); console.log(foo__namespace); console.log(foo.blah); console.log(foo.bar); })(foo); rollup-2.61.1/test/form/samples/external-namespace-and-named/_expected/system.js000066400000000000000000000004431415504077600277360ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/external-namespace-and-named/_expected/umd.js000066400000000000000000000015761415504077600272070ustar00rootroot00000000000000(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 _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 foo__namespace = /*#__PURE__*/_interopNamespace(foo); console.log(foo__namespace); console.log(foo.blah); console.log(foo.bar); })); rollup-2.61.1/test/form/samples/external-namespace-and-named/main.js000066400000000000000000000001621415504077600253740ustar00rootroot00000000000000import * as foo from 'foo'; import {blah, bar} from 'foo'; console.log(foo) console.log(blah); console.log(bar); rollup-2.61.1/test/form/samples/external-namespace-reexport/000077500000000000000000000000001415504077600241375ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/external-namespace-reexport/_config.js000066400000000000000000000003041415504077600260760ustar00rootroot00000000000000module.exports = { description: 'Support external namespace reexport', options: { external: ['highcharts'], output: { globals: { highcharts: 'highcharts' }, name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/external-namespace-reexport/_expected/000077500000000000000000000000001415504077600260775ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/external-namespace-reexport/_expected/amd.js000066400000000000000000000012651415504077600272020ustar00rootroot00000000000000define(['exports', 'highcharts'], (function (exports, highcharts) { 'use strict'; 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 highcharts__namespace = /*#__PURE__*/_interopNamespace(highcharts); exports.Highcharts = highcharts__namespace; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/external-namespace-reexport/_expected/cjs.js000066400000000000000000000012001415504077600272050ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var highcharts = require('highcharts'); 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 highcharts__namespace = /*#__PURE__*/_interopNamespace(highcharts); exports.Highcharts = highcharts__namespace; rollup-2.61.1/test/form/samples/external-namespace-reexport/_expected/es.js000066400000000000000000000001171415504077600270430ustar00rootroot00000000000000import * as highcharts from 'highcharts'; export { highcharts as Highcharts }; rollup-2.61.1/test/form/samples/external-namespace-reexport/_expected/iife.js000066400000000000000000000013041415504077600273470ustar00rootroot00000000000000var myBundle = (function (exports, highcharts) { 'use strict'; 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 highcharts__namespace = /*#__PURE__*/_interopNamespace(highcharts); exports.Highcharts = highcharts__namespace; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, highcharts); rollup-2.61.1/test/form/samples/external-namespace-reexport/_expected/system.js000066400000000000000000000003161415504077600277610ustar00rootroot00000000000000System.register('myBundle', ['highcharts'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('Highcharts', module); }], execute: (function () { }) }; })); rollup-2.61.1/test/form/samples/external-namespace-reexport/_expected/umd.js000066400000000000000000000017761415504077600272350ustar00rootroot00000000000000(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 _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 highcharts__namespace = /*#__PURE__*/_interopNamespace(highcharts); exports.Highcharts = highcharts__namespace; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/external-namespace-reexport/dep.js000066400000000000000000000000771415504077600252510ustar00rootroot00000000000000import * as Highcharts from 'highcharts'; export { Highcharts }rollup-2.61.1/test/form/samples/external-namespace-reexport/main.js000066400000000000000000000000461415504077600254210ustar00rootroot00000000000000export { Highcharts } from './dep.js';rollup-2.61.1/test/form/samples/for-in-scopes/000077500000000000000000000000001415504077600212015ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/for-in-scopes/_config.js000066400000000000000000000001501415504077600231370ustar00rootroot00000000000000module.exports = { description: 'properly associate or shadow variables in and around for-in-loops' }; rollup-2.61.1/test/form/samples/for-in-scopes/_expected.js000066400000000000000000000004271415504077600235020ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/for-in-scopes/main.js000066400000000000000000000007241415504077600224660ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/for-loop-body-var-declaration/000077500000000000000000000000001415504077600242565ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/for-loop-body-var-declaration/_config.js000066400000000000000000000001521415504077600262160ustar00rootroot00000000000000module.exports = { description: 'use a newline for line wraps removing a necessary semicolon (#1275)' }; rollup-2.61.1/test/form/samples/for-loop-body-var-declaration/_expected/000077500000000000000000000000001415504077600262165ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/for-loop-body-var-declaration/_expected/amd.js000066400000000000000000000001321415504077600273110ustar00rootroot00000000000000define((function () { 'use strict'; for(var x=1;x<2;x++)var d=x|0;console.log(d); })); rollup-2.61.1/test/form/samples/for-loop-body-var-declaration/_expected/cjs.js000066400000000000000000000000751415504077600273350ustar00rootroot00000000000000'use strict'; for(var x=1;x<2;x++)var d=x|0;console.log(d); rollup-2.61.1/test/form/samples/for-loop-body-var-declaration/_expected/es.js000066400000000000000000000000561415504077600271640ustar00rootroot00000000000000for(var x=1;x<2;x++)var d=x|0;console.log(d); rollup-2.61.1/test/form/samples/for-loop-body-var-declaration/_expected/iife.js000066400000000000000000000001251415504077600274660ustar00rootroot00000000000000(function () { 'use strict'; for(var x=1;x<2;x++)var d=x|0;console.log(d); })(); rollup-2.61.1/test/form/samples/for-loop-body-var-declaration/_expected/system.js000066400000000000000000000002271415504077600301010ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { for(var x=1;x<2;x++)var d=x|0;console.log(d); }) }; })); rollup-2.61.1/test/form/samples/for-loop-body-var-declaration/_expected/umd.js000066400000000000000000000002701415504077600273400ustar00rootroot00000000000000(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-2.61.1/test/form/samples/for-loop-body-var-declaration/main.js000066400000000000000000000000561415504077600255410ustar00rootroot00000000000000for(var x=1;x<2;x++)var d=x|0;console.log(d); rollup-2.61.1/test/form/samples/for-loop-with-empty-head/000077500000000000000000000000001415504077600232565ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/for-loop-with-empty-head/_config.js000066400000000000000000000001071415504077600252160ustar00rootroot00000000000000module.exports = { description: 'handles for loop with empty head' }; rollup-2.61.1/test/form/samples/for-loop-with-empty-head/_expected/000077500000000000000000000000001415504077600252165ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/for-loop-with-empty-head/_expected/amd.js000066400000000000000000000001221415504077600263100ustar00rootroot00000000000000define((function () { 'use strict'; for ( ; ; ) { console.log( 42 ); } })); rollup-2.61.1/test/form/samples/for-loop-with-empty-head/_expected/cjs.js000066400000000000000000000000631415504077600263320ustar00rootroot00000000000000'use strict'; for ( ; ; ) { console.log( 42 ); } rollup-2.61.1/test/form/samples/for-loop-with-empty-head/_expected/es.js000066400000000000000000000000441415504077600261610ustar00rootroot00000000000000for ( ; ; ) { console.log( 42 ); } rollup-2.61.1/test/form/samples/for-loop-with-empty-head/_expected/iife.js000066400000000000000000000001151415504077600264650ustar00rootroot00000000000000(function () { 'use strict'; for ( ; ; ) { console.log( 42 ); } })(); rollup-2.61.1/test/form/samples/for-loop-with-empty-head/_expected/system.js000066400000000000000000000002231415504077600270750ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { for ( ; ; ) { console.log( 42 ); } }) }; })); rollup-2.61.1/test/form/samples/for-loop-with-empty-head/_expected/umd.js000066400000000000000000000002601415504077600263370ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; for ( ; ; ) { console.log( 42 ); } })); rollup-2.61.1/test/form/samples/for-loop-with-empty-head/main.js000066400000000000000000000000441415504077600245360ustar00rootroot00000000000000for ( ; ; ) { console.log( 42 ); } rollup-2.61.1/test/form/samples/for-of-scopes/000077500000000000000000000000001415504077600211775ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/for-of-scopes/_config.js000066400000000000000000000001501415504077600231350ustar00rootroot00000000000000module.exports = { description: 'properly associate or shadow variables in and around for-of-loops' }; rollup-2.61.1/test/form/samples/for-of-scopes/_expected.js000066400000000000000000000006071415504077600235000ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/for-of-scopes/main.js000066400000000000000000000007341415504077600224650ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/for-scopes/000077500000000000000000000000001415504077600205755ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/for-scopes/_config.js000066400000000000000000000001451415504077600225370ustar00rootroot00000000000000module.exports = { description: 'properly associate or shadow variables in and around for-loops' }; rollup-2.61.1/test/form/samples/for-scopes/_expected/000077500000000000000000000000001415504077600225355ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/for-scopes/_expected/amd.js000066400000000000000000000005231415504077600236340ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/for-scopes/_expected/cjs.js000066400000000000000000000004541415504077600236550ustar00rootroot00000000000000'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-2.61.1/test/form/samples/for-scopes/_expected/es.js000066400000000000000000000004351415504077600235040ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/for-scopes/_expected/iife.js000066400000000000000000000005161415504077600240110ustar00rootroot00000000000000(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-2.61.1/test/form/samples/for-scopes/_expected/system.js000066400000000000000000000006441415504077600244230ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/for-scopes/_expected/umd.js000066400000000000000000000006611415504077600236630ustar00rootroot00000000000000(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-2.61.1/test/form/samples/for-scopes/main.js000066400000000000000000000007221415504077600220600ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/freeze/000077500000000000000000000000001415504077600177755ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/freeze/_config.js000066400000000000000000000002231415504077600217340ustar00rootroot00000000000000module.exports = { description: 'supports opt-ing out of usage of Object.freeze', options: { output: { name: 'myBundle', freeze: false } } }; rollup-2.61.1/test/form/samples/freeze/_expected/000077500000000000000000000000001415504077600217355ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/freeze/_expected/amd.js000066400000000000000000000005131415504077600230330ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const foo = 1; const bar = 2; var namespace = { __proto__: null, foo: foo, bar: bar }; console.log( Object.keys( namespace ) ); const a = 1; const b = 2; exports.a = a; exports.b = b; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/freeze/_expected/cjs.js000066400000000000000000000004161415504077600230530ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const foo = 1; const bar = 2; var namespace = { __proto__: null, foo: foo, bar: bar }; console.log( Object.keys( namespace ) ); const a = 1; const b = 2; exports.a = a; exports.b = b; rollup-2.61.1/test/form/samples/freeze/_expected/es.js000066400000000000000000000002621415504077600227020ustar00rootroot00000000000000const foo = 1; const bar = 2; var namespace = { __proto__: null, foo: foo, bar: bar }; console.log( Object.keys( namespace ) ); const a = 1; const b = 2; export { a, b }; rollup-2.61.1/test/form/samples/freeze/_expected/iife.js000066400000000000000000000005341415504077600232110ustar00rootroot00000000000000var myBundle = (function (exports) { 'use strict'; const foo = 1; const bar = 2; var namespace = { __proto__: null, foo: foo, bar: bar }; console.log( Object.keys( namespace ) ); const a = 1; const b = 2; exports.a = a; exports.b = b; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/freeze/_expected/system.js000066400000000000000000000005231415504077600236170ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { const foo = 1; const bar = 2; var namespace = { __proto__: null, foo: foo, bar: bar }; console.log( Object.keys( namespace ) ); const a = exports('a', 1); const b = exports('b', 2); }) }; })); rollup-2.61.1/test/form/samples/freeze/_expected/umd.js000066400000000000000000000011521415504077600230570ustar00rootroot00000000000000(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, foo: foo, bar: bar }; console.log( Object.keys( namespace ) ); const a = 1; const b = 2; exports.a = a; exports.b = b; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/freeze/main.js000066400000000000000000000002001415504077600212470ustar00rootroot00000000000000import * as namespace from './namespace.js'; console.log( Object.keys( namespace ) ); export const a = 1; export const b = 2; rollup-2.61.1/test/form/samples/freeze/namespace.js000066400000000000000000000000531415504077600222650ustar00rootroot00000000000000export const foo = 1; export const bar = 2;rollup-2.61.1/test/form/samples/function-body-return-values/000077500000000000000000000000001415504077600241075ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/function-body-return-values/_config.js000066400000000000000000000001321415504077600260450ustar00rootroot00000000000000module.exports = { description: 'properly extract return values from function bodies' }; rollup-2.61.1/test/form/samples/function-body-return-values/_expected.js000066400000000000000000000007661415504077600264160ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/function-body-return-values/main.js000066400000000000000000000012671415504077600253770ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/function-call-parameters/000077500000000000000000000000001415504077600234145ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/function-call-parameters/_config.js000066400000000000000000000002001415504077600253460ustar00rootroot00000000000000module.exports = { description: 'take actual parameters into account when determining side-effects of calls to functions' }; rollup-2.61.1/test/form/samples/function-call-parameters/_expected/000077500000000000000000000000001415504077600253545ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/function-call-parameters/_expected/amd.js000066400000000000000000000020131415504077600264470ustar00rootroot00000000000000define((function () { 'use strict'; // 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-2.61.1/test/form/samples/function-call-parameters/_expected/cjs.js000066400000000000000000000017201415504077600264710ustar00rootroot00000000000000'use strict'; // 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-2.61.1/test/form/samples/function-call-parameters/_expected/es.js000066400000000000000000000017011415504077600263200ustar00rootroot00000000000000// 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-2.61.1/test/form/samples/function-call-parameters/_expected/iife.js000066400000000000000000000020061415504077600266240ustar00rootroot00000000000000(function () { 'use strict'; // 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-2.61.1/test/form/samples/function-call-parameters/_expected/system.js000066400000000000000000000022041415504077600272340ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { // 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-2.61.1/test/form/samples/function-call-parameters/_expected/umd.js000066400000000000000000000021511415504077600264760ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; // 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-2.61.1/test/form/samples/function-call-parameters/main.js000066400000000000000000000017011415504077600246750ustar00rootroot00000000000000// 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-2.61.1/test/form/samples/function-mutation/000077500000000000000000000000001415504077600222005ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/function-mutation/_config.js000066400000000000000000000001671415504077600241460ustar00rootroot00000000000000module.exports = { description: 'function-mutations do not have effects', options: { output: { name: 'bundle' } } }; rollup-2.61.1/test/form/samples/function-mutation/_expected/000077500000000000000000000000001415504077600241405ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/function-mutation/_expected/amd.js000066400000000000000000000012611415504077600252370ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/function-mutation/_expected/cjs.js000066400000000000000000000011361415504077600252560ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/form/samples/function-mutation/_expected/es.js000066400000000000000000000007361415504077600251130ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/function-mutation/_expected/iife.js000066400000000000000000000013001415504077600254040ustar00rootroot00000000000000var 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; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/function-mutation/_expected/system.js000066400000000000000000000013411415504077600260210ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/function-mutation/_expected/umd.js000066400000000000000000000017161415504077600252700ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/function-mutation/main.js000066400000000000000000000014301415504077600234600ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/function-scopes/000077500000000000000000000000001415504077600216345ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/function-scopes/_config.js000066400000000000000000000001451415504077600235760ustar00rootroot00000000000000module.exports = { description: 'properly associate or shadow variables in and around functions' }; rollup-2.61.1/test/form/samples/function-scopes/_expected/000077500000000000000000000000001415504077600235745ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/function-scopes/_expected/amd.js000066400000000000000000000006651415504077600247020ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/function-scopes/_expected/cjs.js000066400000000000000000000006121415504077600247100ustar00rootroot00000000000000'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-2.61.1/test/form/samples/function-scopes/_expected/es.js000066400000000000000000000005731415504077600245460ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/function-scopes/_expected/iife.js000066400000000000000000000006601415504077600250500ustar00rootroot00000000000000(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-2.61.1/test/form/samples/function-scopes/_expected/system.js000066400000000000000000000010161415504077600254540ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/function-scopes/_expected/umd.js000066400000000000000000000010231415504077600247130ustar00rootroot00000000000000(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-2.61.1/test/form/samples/function-scopes/main.js000066400000000000000000000011271415504077600231170ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/generated-code-compact/000077500000000000000000000000001415504077600230075ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/arrow-functions-false/000077500000000000000000000000001415504077600272375ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/arrow-functions-false/_config.js000066400000000000000000000011161415504077600312000ustar00rootroot00000000000000module.exports = { 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 true; }, name: 'bundle', noConflict: true } } }; rollup-2.61.1/test/form/samples/generated-code-compact/arrow-functions-false/_expected/000077500000000000000000000000001415504077600311775ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/arrow-functions-false/_expected/amd.js000066400000000000000000000047621415504077600323070ustar00rootroot00000000000000define(['require','exports','externalNoImport','external','externalAuto','externalDefault','externalDefaultOnly'],(function(require,exports,externalNoImport,defaultLegacy,externalAuto,externalDefault,externalDefaultOnly){'use strict';function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e:{'default':e}}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){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)}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 defaultLegacy__namespace=/*#__PURE__*/_interopNamespace(defaultLegacy);var defaultLegacy__default=/*#__PURE__*/_interopDefaultLegacy(defaultLegacy);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 } = defaultLegacy.b); console.log({ a: exports.a } = defaultLegacy.b); Promise.resolve().then(function(){return main}).then(console.log); new Promise(function(c,e){require(['external'],function(m){c(/*#__PURE__*/_interopNamespace(m))},e)}).then(console.log); console.log(defaultLegacy__default["default"]); console.log(externalAuto__default["default"]); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace);var main=/*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return exports.a},foo:foo}, [defaultLegacy__namespace]));Object.defineProperty(exports,'foo',{enumerable:true,get:function(){return defaultLegacy.foo}});Object.keys(defaultLegacy).forEach(function(k){if(k!=='default'&&!exports.hasOwnProperty(k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return defaultLegacy[k]}})});Object.defineProperty(exports,'__esModule',{value:true});}));rollup-2.61.1/test/form/samples/generated-code-compact/arrow-functions-false/_expected/cjs.js000066400000000000000000000047171415504077600323250ustar00rootroot00000000000000'use strict';Object.defineProperty(exports,'__esModule',{value:true});require('externalNoImport');var defaultLegacy=require('external'),externalAuto=require('externalAuto'),externalDefault=require('externalDefault'),externalDefaultOnly=require('externalDefaultOnly');function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e:{'default':e}}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){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)}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 defaultLegacy__namespace=/*#__PURE__*/_interopNamespace(defaultLegacy);var defaultLegacy__default=/*#__PURE__*/_interopDefaultLegacy(defaultLegacy);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 } = defaultLegacy.b); console.log({ a: exports.a } = defaultLegacy.b); Promise.resolve().then(function(){return main}).then(console.log); Promise.resolve().then(function(){return /*#__PURE__*/_interopNamespace(require('external'))}).then(console.log); console.log(defaultLegacy__default["default"]); console.log(externalAuto__default["default"]); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace);var main=/*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return exports.a},foo:foo}, [defaultLegacy__namespace]));Object.defineProperty(exports,'foo',{enumerable:true,get:function(){return defaultLegacy.foo}});Object.keys(defaultLegacy).forEach(function(k){if(k!=='default'&&!exports.hasOwnProperty(k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return defaultLegacy[k]}})});rollup-2.61.1/test/form/samples/generated-code-compact/arrow-functions-false/_expected/es.js000066400000000000000000000020141415504077600321410ustar00rootroot00000000000000import'externalNoImport';import*as defaultLegacy from'external';import defaultLegacy__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(defaultLegacy__default); console.log(externalAuto); console.log(externalDefault); console.log(externalDefaultOnly);var main=/*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return a},foo:foo}, [defaultLegacy]));export{a};rollup-2.61.1/test/form/samples/generated-code-compact/arrow-functions-false/_expected/iife.js000066400000000000000000000046061415504077600324570ustar00rootroot00000000000000var bundle=(function(exports,externalNoImport,defaultLegacy,externalAuto,externalDefault,externalDefaultOnly){'use strict';function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e:{'default':e}}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){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)}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 defaultLegacy__namespace=/*#__PURE__*/_interopNamespace(defaultLegacy);var defaultLegacy__default=/*#__PURE__*/_interopDefaultLegacy(defaultLegacy);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 } = defaultLegacy.b); console.log({ a: exports.a } = defaultLegacy.b); Promise.resolve().then(function(){return main}).then(console.log); import('external').then(console.log); console.log(defaultLegacy__default["default"]); console.log(externalAuto__default["default"]); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace);var main=/*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return exports.a},foo:foo}, [defaultLegacy__namespace]));Object.defineProperty(exports,'foo',{enumerable:true,get:function(){return defaultLegacy.foo}});Object.keys(defaultLegacy).forEach(function(k){if(k!=='default'&&!exports.hasOwnProperty(k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return defaultLegacy[k]}})});Object.defineProperty(exports,'__esModule',{value:true});return exports;})({},null,defaultLegacy,externalAuto,externalDefault,externalDefaultOnly);rollup-2.61.1/test/form/samples/generated-code-compact/arrow-functions-false/_expected/system.js000066400000000000000000000027511415504077600330660ustar00rootroot00000000000000System.register('bundle',['externalNoImport','external','externalAuto','externalDefault','externalDefaultOnly'],(function(exports,module){'use strict';var _starExcludes={a:1,'default':1,foo:1};var b,defaultLegacy,defaultLegacy__default,externalAuto,externalDefault,externalDefaultOnly;return{setters:[function(){},function(module){b=module.b;defaultLegacy=module;defaultLegacy__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(defaultLegacy__default); console.log(externalAuto); console.log(externalDefault); console.log(externalDefaultOnly);var main=/*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return a},foo:foo}, [defaultLegacy]));})}}));rollup-2.61.1/test/form/samples/generated-code-compact/arrow-functions-false/_expected/umd.js000066400000000000000000000056051415504077600323300ustar00rootroot00000000000000(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.defaultLegacy,g.externalAuto,g.externalDefault,g.externalDefaultOnly);e.noConflict=function(){g.bundle=current;return e};})());})(this,(function(exports,externalNoImport,defaultLegacy,externalAuto,externalDefault,externalDefaultOnly){'use strict';function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e:{'default':e}}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){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)}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 defaultLegacy__namespace=/*#__PURE__*/_interopNamespace(defaultLegacy);var defaultLegacy__default=/*#__PURE__*/_interopDefaultLegacy(defaultLegacy);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 } = defaultLegacy.b); console.log({ a: exports.a } = defaultLegacy.b); Promise.resolve().then(function(){return main}).then(console.log); import('external').then(console.log); console.log(defaultLegacy__default["default"]); console.log(externalAuto__default["default"]); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace);var main=/*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return exports.a},foo:foo}, [defaultLegacy__namespace]));Object.defineProperty(exports,'foo',{enumerable:true,get:function(){return defaultLegacy.foo}});Object.keys(defaultLegacy).forEach(function(k){if(k!=='default'&&!exports.hasOwnProperty(k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return defaultLegacy[k]}})});Object.defineProperty(exports,'__esModule',{value:true});}));rollup-2.61.1/test/form/samples/generated-code-compact/arrow-functions-false/main.js000077700000000000000000000000001415504077600415222../../generated-code/arrow-functions-false/main.jsustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/arrow-functions-true/000077500000000000000000000000001415504077600271245ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/arrow-functions-true/_config.js000066400000000000000000000011051415504077600310630ustar00rootroot00000000000000module.exports = { 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 true; }, name: 'bundle', noConflict: true } } }; rollup-2.61.1/test/form/samples/generated-code-compact/arrow-functions-true/_expected/000077500000000000000000000000001415504077600310645ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/arrow-functions-true/_expected/amd.js000066400000000000000000000045031415504077600321650ustar00rootroot00000000000000define(['require','exports','externalNoImport','external','externalAuto','externalDefault','externalDefaultOnly'],(function(require,exports,externalNoImport,defaultLegacy,externalAuto,externalDefault,externalDefaultOnly){'use strict';var _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{'default':e};var _interopDefault=e=>e&&e.__esModule?e:{'default':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)}var _interopNamespace=e=>e&&e.__esModule?e:_interopNamespaceDefault(e);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 defaultLegacy__namespace=/*#__PURE__*/_interopNamespace(defaultLegacy);var defaultLegacy__default=/*#__PURE__*/_interopDefaultLegacy(defaultLegacy);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 } = defaultLegacy.b); console.log({ a: exports.a } = defaultLegacy.b); Promise.resolve().then(()=>main).then(console.log); new Promise((c,e)=>require(['external'],m=>c(/*#__PURE__*/_interopNamespace(m)),e)).then(console.log); console.log(defaultLegacy__default["default"]); console.log(externalAuto__default["default"]); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace);var main=/*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return exports.a},foo:foo}, [defaultLegacy__namespace]));Object.defineProperty(exports,'foo',{enumerable:true,get:()=>defaultLegacy.foo});Object.keys(defaultLegacy).forEach(k=>{if(k!=='default'&&!exports.hasOwnProperty(k))Object.defineProperty(exports,k,{enumerable:true,get:()=>defaultLegacy[k]})});Object.defineProperty(exports,'__esModule',{value:true});}));rollup-2.61.1/test/form/samples/generated-code-compact/arrow-functions-true/_expected/cjs.js000066400000000000000000000044431415504077600322060ustar00rootroot00000000000000'use strict';Object.defineProperty(exports,'__esModule',{value:true});require('externalNoImport');var defaultLegacy=require('external'),externalAuto=require('externalAuto'),externalDefault=require('externalDefault'),externalDefaultOnly=require('externalDefaultOnly');var _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{'default':e};var _interopDefault=e=>e&&e.__esModule?e:{'default':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)}var _interopNamespace=e=>e&&e.__esModule?e:_interopNamespaceDefault(e);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 defaultLegacy__namespace=/*#__PURE__*/_interopNamespace(defaultLegacy);var defaultLegacy__default=/*#__PURE__*/_interopDefaultLegacy(defaultLegacy);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 } = defaultLegacy.b); console.log({ a: exports.a } = defaultLegacy.b); Promise.resolve().then(()=>main).then(console.log); Promise.resolve().then(()=>/*#__PURE__*/_interopNamespace(require('external'))).then(console.log); console.log(defaultLegacy__default["default"]); console.log(externalAuto__default["default"]); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace);var main=/*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return exports.a},foo:foo}, [defaultLegacy__namespace]));Object.defineProperty(exports,'foo',{enumerable:true,get:()=>defaultLegacy.foo});Object.keys(defaultLegacy).forEach(k=>{if(k!=='default'&&!exports.hasOwnProperty(k))Object.defineProperty(exports,k,{enumerable:true,get:()=>defaultLegacy[k]})});rollup-2.61.1/test/form/samples/generated-code-compact/arrow-functions-true/_expected/es.js000066400000000000000000000017341415504077600320360ustar00rootroot00000000000000import'externalNoImport';import*as defaultLegacy from'external';import defaultLegacy__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(defaultLegacy__default); console.log(externalAuto); console.log(externalDefault); console.log(externalDefaultOnly);var main=/*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return a},foo:foo}, [defaultLegacy]));export{a};rollup-2.61.1/test/form/samples/generated-code-compact/arrow-functions-true/_expected/iife.js000066400000000000000000000043511415504077600323410ustar00rootroot00000000000000var bundle=(function(exports,externalNoImport,defaultLegacy,externalAuto,externalDefault,externalDefaultOnly){'use strict';var _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{'default':e};var _interopDefault=e=>e&&e.__esModule?e:{'default':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)}var _interopNamespace=e=>e&&e.__esModule?e:_interopNamespaceDefault(e);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 defaultLegacy__namespace=/*#__PURE__*/_interopNamespace(defaultLegacy);var defaultLegacy__default=/*#__PURE__*/_interopDefaultLegacy(defaultLegacy);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 } = defaultLegacy.b); console.log({ a: exports.a } = defaultLegacy.b); Promise.resolve().then(()=>main).then(console.log); import('external').then(console.log); console.log(defaultLegacy__default["default"]); console.log(externalAuto__default["default"]); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace);var main=/*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return exports.a},foo:foo}, [defaultLegacy__namespace]));Object.defineProperty(exports,'foo',{enumerable:true,get:()=>defaultLegacy.foo});Object.keys(defaultLegacy).forEach(k=>{if(k!=='default'&&!exports.hasOwnProperty(k))Object.defineProperty(exports,k,{enumerable:true,get:()=>defaultLegacy[k]})});Object.defineProperty(exports,'__esModule',{value:true});return exports;})({},null,defaultLegacy,externalAuto,externalDefault,externalDefaultOnly);rollup-2.61.1/test/form/samples/generated-code-compact/arrow-functions-true/_expected/system.js000066400000000000000000000025671415504077600327600ustar00rootroot00000000000000System.register('bundle',['externalNoImport','external','externalAuto','externalDefault','externalDefaultOnly'],(function(exports,module){'use strict';var _starExcludes={a:1,'default':1,foo:1};var b,defaultLegacy,defaultLegacy__default,externalAuto,externalDefault,externalDefaultOnly;return{setters:[()=>{},module=>{b=module.b;defaultLegacy=module;defaultLegacy__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(defaultLegacy__default); console.log(externalAuto); console.log(externalDefault); console.log(externalDefaultOnly);var main=/*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return a},foo:foo}, [defaultLegacy]));})}}));rollup-2.61.1/test/form/samples/generated-code-compact/arrow-functions-true/_expected/umd.js000066400000000000000000000053341415504077600322140ustar00rootroot00000000000000(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.defaultLegacy,g.externalAuto,g.externalDefault,g.externalDefaultOnly);e.noConflict=()=>{g.bundle=current;return e};})());})(this,(function(exports,externalNoImport,defaultLegacy,externalAuto,externalDefault,externalDefaultOnly){'use strict';var _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{'default':e};var _interopDefault=e=>e&&e.__esModule?e:{'default':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)}var _interopNamespace=e=>e&&e.__esModule?e:_interopNamespaceDefault(e);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 defaultLegacy__namespace=/*#__PURE__*/_interopNamespace(defaultLegacy);var defaultLegacy__default=/*#__PURE__*/_interopDefaultLegacy(defaultLegacy);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 } = defaultLegacy.b); console.log({ a: exports.a } = defaultLegacy.b); Promise.resolve().then(()=>main).then(console.log); import('external').then(console.log); console.log(defaultLegacy__default["default"]); console.log(externalAuto__default["default"]); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace);var main=/*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({__proto__:null,get a(){return exports.a},foo:foo}, [defaultLegacy__namespace]));Object.defineProperty(exports,'foo',{enumerable:true,get:()=>defaultLegacy.foo});Object.keys(defaultLegacy).forEach(k=>{if(k!=='default'&&!exports.hasOwnProperty(k))Object.defineProperty(exports,k,{enumerable:true,get:()=>defaultLegacy[k]})});Object.defineProperty(exports,'__esModule',{value:true});}));rollup-2.61.1/test/form/samples/generated-code-compact/arrow-functions-true/main.js000077700000000000000000000000001415504077600414072../../generated-code/arrow-functions-false/main.jsustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/const-bindings-false/000077500000000000000000000000001415504077600270205ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/const-bindings-false/_config.js000066400000000000000000000007471415504077600307720ustar00rootroot00000000000000module.exports = { 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' }, plugins: [ { transform(code, id) { if (id.endsWith('synthetic.js')) { return { syntheticNamedExports: true }; } } } ] } }; rollup-2.61.1/test/form/samples/generated-code-compact/const-bindings-false/_expected/000077500000000000000000000000001415504077600307605ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/const-bindings-false/_expected/amd.js000066400000000000000000000021171415504077600320600ustar00rootroot00000000000000define(['exports','external'],(function(exports,foo$1){'use strict';const _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{'default':e};function _interopNamespace(e){if(e&&e.__esModule)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__default=/*#__PURE__*/_interopDefaultLegacy(foo$1);const foo__namespace=/*#__PURE__*/_interopNamespace(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__default["default"], foo__namespace, other, bar, _missingExportShim); const main = 42;exports["default"]=main;exports.syntheticMissing=synthetic.syntheticMissing;for(const k in foo$1){if(k!=='default'&&!exports.hasOwnProperty(k))Object.defineProperty(exports,k,{enumerable:true,get:()=>foo$1[k]})}Object.defineProperty(exports,'__esModule',{value:true});}));rollup-2.61.1/test/form/samples/generated-code-compact/const-bindings-false/_expected/cjs.js000066400000000000000000000020641415504077600320770ustar00rootroot00000000000000'use strict';Object.defineProperty(exports,'__esModule',{value:true});const foo$1=require('external');const _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{'default':e};function _interopNamespace(e){if(e&&e.__esModule)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__default=/*#__PURE__*/_interopDefaultLegacy(foo$1);const foo__namespace=/*#__PURE__*/_interopNamespace(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__default["default"], foo__namespace, other, bar, _missingExportShim); const main = 42;exports["default"]=main;exports.syntheticMissing=synthetic.syntheticMissing;for(const k in foo$1){if(k!=='default'&&!exports.hasOwnProperty(k))Object.defineProperty(exports,k,{enumerable:true,get:()=>foo$1[k]})}rollup-2.61.1/test/form/samples/generated-code-compact/const-bindings-false/_expected/es.js000066400000000000000000000006641415504077600317330ustar00rootroot00000000000000import*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-2.61.1/test/form/samples/generated-code-compact/const-bindings-false/_expected/iife.js000066400000000000000000000021261415504077600322330ustar00rootroot00000000000000const bundle=(function(exports,foo$1){'use strict';const _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{'default':e};function _interopNamespace(e){if(e&&e.__esModule)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__default=/*#__PURE__*/_interopDefaultLegacy(foo$1);const foo__namespace=/*#__PURE__*/_interopNamespace(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__default["default"], foo__namespace, other, bar, _missingExportShim); const main = 42;exports["default"]=main;exports.syntheticMissing=synthetic.syntheticMissing;for(const k in foo$1){if(k!=='default'&&!exports.hasOwnProperty(k))Object.defineProperty(exports,k,{enumerable:true,get:()=>foo$1[k]})}Object.defineProperty(exports,'__esModule',{value:true});return exports;})({},foo$1);rollup-2.61.1/test/form/samples/generated-code-compact/const-bindings-false/_expected/system.js000066400000000000000000000012561415504077600326460ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/generated-code-compact/const-bindings-false/_expected/umd.js000066400000000000000000000026151415504077600321070ustar00rootroot00000000000000(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';const _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{'default':e};function _interopNamespace(e){if(e&&e.__esModule)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__default=/*#__PURE__*/_interopDefaultLegacy(foo$1);const foo__namespace=/*#__PURE__*/_interopNamespace(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__default["default"], foo__namespace, other, bar, _missingExportShim); const main = 42;exports["default"]=main;exports.syntheticMissing=synthetic.syntheticMissing;for(const k in foo$1){if(k!=='default'&&!exports.hasOwnProperty(k))Object.defineProperty(exports,k,{enumerable:true,get:()=>foo$1[k]})}Object.defineProperty(exports,'__esModule',{value:true});}));rollup-2.61.1/test/form/samples/generated-code-compact/const-bindings-false/main.js000077700000000000000000000000001415504077600410642../../generated-code/const-bindings-false/main.jsustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/const-bindings-true/000077500000000000000000000000001415504077600267055ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/const-bindings-true/_config.js000066400000000000000000000007371415504077600306560ustar00rootroot00000000000000module.exports = { 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' }, plugins: [ { transform(code, id) { if (id.endsWith('synthetic.js')) { return { syntheticNamedExports: true }; } } } ] } }; rollup-2.61.1/test/form/samples/generated-code-compact/const-bindings-true/_expected/000077500000000000000000000000001415504077600306455ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/const-bindings-true/_expected/amd.js000066400000000000000000000021171415504077600317450ustar00rootroot00000000000000define(['exports','external'],(function(exports,foo$1){'use strict';const _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{'default':e};function _interopNamespace(e){if(e&&e.__esModule)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__default=/*#__PURE__*/_interopDefaultLegacy(foo$1);const foo__namespace=/*#__PURE__*/_interopNamespace(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__default["default"], foo__namespace, other, bar, _missingExportShim); const main = 42;exports["default"]=main;exports.syntheticMissing=synthetic.syntheticMissing;for(const k in foo$1){if(k!=='default'&&!exports.hasOwnProperty(k))Object.defineProperty(exports,k,{enumerable:true,get:()=>foo$1[k]})}Object.defineProperty(exports,'__esModule',{value:true});}));rollup-2.61.1/test/form/samples/generated-code-compact/const-bindings-true/_expected/cjs.js000066400000000000000000000020641415504077600317640ustar00rootroot00000000000000'use strict';Object.defineProperty(exports,'__esModule',{value:true});const foo$1=require('external');const _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{'default':e};function _interopNamespace(e){if(e&&e.__esModule)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__default=/*#__PURE__*/_interopDefaultLegacy(foo$1);const foo__namespace=/*#__PURE__*/_interopNamespace(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__default["default"], foo__namespace, other, bar, _missingExportShim); const main = 42;exports["default"]=main;exports.syntheticMissing=synthetic.syntheticMissing;for(const k in foo$1){if(k!=='default'&&!exports.hasOwnProperty(k))Object.defineProperty(exports,k,{enumerable:true,get:()=>foo$1[k]})}rollup-2.61.1/test/form/samples/generated-code-compact/const-bindings-true/_expected/es.js000066400000000000000000000006641415504077600316200ustar00rootroot00000000000000import*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-2.61.1/test/form/samples/generated-code-compact/const-bindings-true/_expected/iife.js000066400000000000000000000021261415504077600321200ustar00rootroot00000000000000const bundle=(function(exports,foo$1){'use strict';const _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{'default':e};function _interopNamespace(e){if(e&&e.__esModule)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__default=/*#__PURE__*/_interopDefaultLegacy(foo$1);const foo__namespace=/*#__PURE__*/_interopNamespace(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__default["default"], foo__namespace, other, bar, _missingExportShim); const main = 42;exports["default"]=main;exports.syntheticMissing=synthetic.syntheticMissing;for(const k in foo$1){if(k!=='default'&&!exports.hasOwnProperty(k))Object.defineProperty(exports,k,{enumerable:true,get:()=>foo$1[k]})}Object.defineProperty(exports,'__esModule',{value:true});return exports;})({},foo$1);rollup-2.61.1/test/form/samples/generated-code-compact/const-bindings-true/_expected/system.js000066400000000000000000000012561415504077600325330ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/generated-code-compact/const-bindings-true/_expected/umd.js000066400000000000000000000026151415504077600317740ustar00rootroot00000000000000(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';const _interopDefaultLegacy=e=>e&&typeof e==='object'&&'default'in e?e:{'default':e};function _interopNamespace(e){if(e&&e.__esModule)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__default=/*#__PURE__*/_interopDefaultLegacy(foo$1);const foo__namespace=/*#__PURE__*/_interopNamespace(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__default["default"], foo__namespace, other, bar, _missingExportShim); const main = 42;exports["default"]=main;exports.syntheticMissing=synthetic.syntheticMissing;for(const k in foo$1){if(k!=='default'&&!exports.hasOwnProperty(k))Object.defineProperty(exports,k,{enumerable:true,get:()=>foo$1[k]})}Object.defineProperty(exports,'__esModule',{value:true});}));rollup-2.61.1/test/form/samples/generated-code-compact/const-bindings-true/main.js000077700000000000000000000000001415504077600407512../../generated-code/const-bindings-false/main.jsustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/object-shorthand-false/000077500000000000000000000000001415504077600273355ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/object-shorthand-false/_config.js000066400000000000000000000003471415504077600313030ustar00rootroot00000000000000module.exports = { description: 'does not use object shorthand syntax', options: { output: { compact: true, exports: 'named', format: 'system', generatedCode: { objectShorthand: false }, name: 'bundle' } } }; rollup-2.61.1/test/form/samples/generated-code-compact/object-shorthand-false/_expected.js000066400000000000000000000003761415504077600316410ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/generated-code-compact/object-shorthand-false/main.js000077700000000000000000000000001415504077600417162../../generated-code/object-shorthand-false/main.jsustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/object-shorthand-true/000077500000000000000000000000001415504077600272225ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/object-shorthand-true/_config.js000066400000000000000000000003361415504077600311660ustar00rootroot00000000000000module.exports = { description: 'uses object shorthand syntax', options: { output: { compact: true, exports: 'named', format: 'system', generatedCode: { objectShorthand: true }, name: 'bundle' } } }; rollup-2.61.1/test/form/samples/generated-code-compact/object-shorthand-true/_expected.js000066400000000000000000000003701415504077600315200ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/generated-code-compact/object-shorthand-true/main.js000077700000000000000000000000001415504077600416032../../generated-code/object-shorthand-false/main.jsustar00rootroot00000000000000reserved-names-as-props-false-no-external-live-bindings/000077500000000000000000000000001415504077600354645ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact_config.js000066400000000000000000000004651415504077600374330ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-false-no-external-live-bindingsmodule.exports = { 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 }, name: 'bundle' } } }; _expected/000077500000000000000000000000001415504077600374245ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-false-no-external-live-bindingsamd.js000066400000000000000000000003411415504077600405210ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-false-no-external-live-bindings/_expecteddefine(['external'],(function(ns){'use strict';function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e["default"]:e}var ns__default=/*#__PURE__*/_interopDefaultLegacy(ns);console.log(ns__default);}));cjs.js000066400000000000000000000003261415504077600405420ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-false-no-external-live-bindings/_expected'use strict';var ns=require('external');function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e["default"]:e}var ns__default=/*#__PURE__*/_interopDefaultLegacy(ns);console.log(ns__default);es.js000066400000000000000000000000511415504077600403650ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-false-no-external-live-bindings/_expectedimport ns from'external';console.log(ns);iife.js000066400000000000000000000003201415504077600406710ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-false-no-external-live-bindings/_expected(function(ns){'use strict';function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e["default"]:e}var ns__default=/*#__PURE__*/_interopDefaultLegacy(ns);console.log(ns__default);})(ns);system.js000066400000000000000000000002521415504077600413050ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000006571415504077600405570ustar00rootroot00000000000000rollup-2.61.1/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 _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e["default"]:e}var ns__default=/*#__PURE__*/_interopDefaultLegacy(ns);console.log(ns__default);}));main.js000077700000000000000000000000001415504077600562532../../generated-code/reserved-names-as-props-false-no-external-live-bindings/main.jsustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-false-no-external-live-bindingsrollup-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-false/000077500000000000000000000000001415504077600305615ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-false/_config.js000066400000000000000000000007441415504077600325300ustar00rootroot00000000000000module.exports = { 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: [ { transform(code, id) { return { syntheticNamedExports: true }; } } ] } }; rollup-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-false/_expected/000077500000000000000000000000001415504077600325215ustar00rootroot00000000000000amd.js000066400000000000000000000034321415504077600335430ustar00rootroot00000000000000rollup-2.61.1/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__*/Object.freeze(/*#__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.js000066400000000000000000000033771415504077600335710ustar00rootroot00000000000000rollup-2.61.1/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__*/Object.freeze(/*#__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-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-false/_expected/es.js000066400000000000000000000016111415504077600334650ustar00rootroot00000000000000import {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__*/Object.freeze(/*#__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.js000066400000000000000000000034101415504077600337120ustar00rootroot00000000000000rollup-2.61.1/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__*/Object.freeze(/*#__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.js000066400000000000000000000020771415504077600343320ustar00rootroot00000000000000rollup-2.61.1/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__*/Object.freeze(/*#__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.js000066400000000000000000000041021415504077600335620ustar00rootroot00000000000000rollup-2.61.1/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__*/Object.freeze(/*#__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-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-false/main.js000077700000000000000000000000001415504077600443662../../generated-code/reserved-names-as-props-false/main.jsustar00rootroot00000000000000reserved-names-as-props-true-no-external-live-bindings/000077500000000000000000000000001415504077600353515ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact_config.js000066400000000000000000000004641415504077600373170ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-true-no-external-live-bindingsmodule.exports = { 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 }, name: 'bundle' } } }; _expected/000077500000000000000000000000001415504077600373115ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-true-no-external-live-bindingsamd.js000066400000000000000000000003361415504077600404120ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-true-no-external-live-bindings/_expecteddefine(['external'],(function(ns){'use strict';function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e.default:e}var ns__default=/*#__PURE__*/_interopDefaultLegacy(ns);console.log(ns__default);}));cjs.js000066400000000000000000000003231415504077600404240ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-true-no-external-live-bindings/_expected'use strict';var ns=require('external');function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e.default:e}var ns__default=/*#__PURE__*/_interopDefaultLegacy(ns);console.log(ns__default);es.js000066400000000000000000000000511415504077600402520ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-true-no-external-live-bindings/_expectedimport ns from'external';console.log(ns);iife.js000066400000000000000000000003151415504077600405620ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-true-no-external-live-bindings/_expected(function(ns){'use strict';function _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e.default:e}var ns__default=/*#__PURE__*/_interopDefaultLegacy(ns);console.log(ns__default);})(ns);system.js000066400000000000000000000002471415504077600411760ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000006541415504077600404410ustar00rootroot00000000000000rollup-2.61.1/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 _interopDefaultLegacy(e){return e&&typeof e==='object'&&'default'in e?e.default:e}var ns__default=/*#__PURE__*/_interopDefaultLegacy(ns);console.log(ns__default);}));main.js000077700000000000000000000000001415504077600561402../../generated-code/reserved-names-as-props-false-no-external-live-bindings/main.jsustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-true-no-external-live-bindingsrollup-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-true/000077500000000000000000000000001415504077600304465ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-true/_config.js000066400000000000000000000007431415504077600324140ustar00rootroot00000000000000module.exports = { 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: [ { transform(code, id) { return { syntheticNamedExports: true }; } } ] } }; rollup-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-true/_expected/000077500000000000000000000000001415504077600324065ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-true/_expected/amd.js000066400000000000000000000033711415504077600335110ustar00rootroot00000000000000define(['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__*/Object.freeze(/*#__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-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-true/_expected/cjs.js000066400000000000000000000033361415504077600335300ustar00rootroot00000000000000'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__*/Object.freeze(/*#__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-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-true/_expected/es.js000066400000000000000000000016041415504077600333540ustar00rootroot00000000000000import {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__*/Object.freeze(/*#__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.js000066400000000000000000000033471415504077600336100ustar00rootroot00000000000000rollup-2.61.1/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__*/Object.freeze(/*#__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.js000066400000000000000000000020471415504077600342140ustar00rootroot00000000000000rollup-2.61.1/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__*/Object.freeze(/*#__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-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-true/_expected/umd.js000066400000000000000000000040411415504077600335300ustar00rootroot00000000000000(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__*/Object.freeze(/*#__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-2.61.1/test/form/samples/generated-code-compact/reserved-names-as-props-true/main.js000077700000000000000000000000001415504077600442532../../generated-code/reserved-names-as-props-false/main.jsustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-presets/000077500000000000000000000000001415504077600230465ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-presets/es2015/000077500000000000000000000000001415504077600237655ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-presets/es2015/_config.js000066400000000000000000000007721415504077600257350ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'handles generatedCode preset "es2015"', options: { output: { exports: 'named', format: 'system', generatedCode: 'es2015', name: 'bundle' }, plugins: [ { renderStart(options) { assert.strictEqual(options.generatedCode.arrowFunctions, true); assert.strictEqual(options.generatedCode.objectShorthand, true); assert.strictEqual(options.generatedCode.reservedNamesAsProps, true); } } ] } }; rollup-2.61.1/test/form/samples/generated-code-presets/es2015/_expected.js000066400000000000000000000002631415504077600262640ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { const foo = 1; exports({ foo, bar: foo, default: foo }); }) }; })); rollup-2.61.1/test/form/samples/generated-code-presets/es2015/main.js000066400000000000000000000000731415504077600252470ustar00rootroot00000000000000const foo = 1; export { foo, foo as bar, foo as default }; rollup-2.61.1/test/form/samples/generated-code-presets/es5/000077500000000000000000000000001415504077600235425ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-presets/es5/_config.js000066400000000000000000000007661415504077600255150ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'handles generatedCode preset "es5"', options: { output: { exports: 'named', format: 'system', generatedCode: 'es5', name: 'bundle' }, plugins: [ { renderStart(options) { assert.strictEqual(options.generatedCode.arrowFunctions, false); assert.strictEqual(options.generatedCode.objectShorthand, false); assert.strictEqual(options.generatedCode.reservedNamesAsProps, true); } } ] } }; rollup-2.61.1/test/form/samples/generated-code-presets/es5/_expected.js000066400000000000000000000002701415504077600260370ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { const foo = 1; exports({ foo: foo, bar: foo, default: foo }); }) }; })); rollup-2.61.1/test/form/samples/generated-code-presets/es5/main.js000066400000000000000000000000731415504077600250240ustar00rootroot00000000000000const foo = 1; export { foo, foo as bar, foo as default }; rollup-2.61.1/test/form/samples/generated-code-presets/preset-with-override/000077500000000000000000000000001415504077600271365ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code-presets/preset-with-override/_config.js000066400000000000000000000010511415504077600310750ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'handles generatedCode preset "es2015"', options: { output: { exports: 'named', format: 'system', generatedCode: { preset: 'es2015', arrowFunctions: false }, name: 'bundle' }, plugins: [ { renderStart(options) { assert.strictEqual(options.generatedCode.arrowFunctions, false); assert.strictEqual(options.generatedCode.objectShorthand, true); assert.strictEqual(options.generatedCode.reservedNamesAsProps, true); } } ] } }; rollup-2.61.1/test/form/samples/generated-code-presets/preset-with-override/_expected.js000066400000000000000000000002631415504077600314350ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { const foo = 1; exports({ foo, bar: foo, default: foo }); }) }; })); rollup-2.61.1/test/form/samples/generated-code-presets/preset-with-override/main.js000066400000000000000000000000731415504077600304200ustar00rootroot00000000000000const foo = 1; export { foo, foo as bar, foo as default }; rollup-2.61.1/test/form/samples/generated-code/000077500000000000000000000000001415504077600213635ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/arrow-functions-false/000077500000000000000000000000001415504077600256135ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/arrow-functions-false/_config.js000066400000000000000000000010741415504077600275570ustar00rootroot00000000000000module.exports = { 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 true; }, name: 'bundle', noConflict: true } } }; rollup-2.61.1/test/form/samples/generated-code/arrow-functions-false/_expected/000077500000000000000000000000001415504077600275535ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/arrow-functions-false/_expected/amd.js000066400000000000000000000056611415504077600306620ustar00rootroot00000000000000define(['require', 'exports', 'externalNoImport', 'external', 'externalAuto', 'externalDefault', 'externalDefaultOnly'], (function (require, exports, externalNoImport, defaultLegacy, externalAuto, externalDefault, externalDefaultOnly) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } 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) { 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); } 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 defaultLegacy__namespace = /*#__PURE__*/_interopNamespace(defaultLegacy); var defaultLegacy__default = /*#__PURE__*/_interopDefaultLegacy(defaultLegacy); 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 } = defaultLegacy.b); console.log({ a: exports.a } = defaultLegacy.b); Promise.resolve().then(function () { return main; }).then(console.log); new Promise(function (resolve, reject) { require(['external'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }).then(console.log); console.log(defaultLegacy__default["default"]); console.log(externalAuto__default["default"]); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace); var main = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return exports.a; }, foo: foo }, [defaultLegacy__namespace])); Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return defaultLegacy.foo; } }); Object.keys(defaultLegacy).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return defaultLegacy[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/generated-code/arrow-functions-false/_expected/cjs.js000066400000000000000000000054701415504077600306760ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); require('externalNoImport'); var defaultLegacy = require('external'); var externalAuto = require('externalAuto'); var externalDefault = require('externalDefault'); var externalDefaultOnly = require('externalDefaultOnly'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } 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) { 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); } 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 defaultLegacy__namespace = /*#__PURE__*/_interopNamespace(defaultLegacy); var defaultLegacy__default = /*#__PURE__*/_interopDefaultLegacy(defaultLegacy); 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 } = defaultLegacy.b); console.log({ a: exports.a } = defaultLegacy.b); Promise.resolve().then(function () { return main; }).then(console.log); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('external')); }).then(console.log); console.log(defaultLegacy__default["default"]); console.log(externalAuto__default["default"]); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace); var main = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return exports.a; }, foo: foo }, [defaultLegacy__namespace])); Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return defaultLegacy.foo; } }); Object.keys(defaultLegacy).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return defaultLegacy[k]; } }); }); rollup-2.61.1/test/form/samples/generated-code/arrow-functions-false/_expected/es.js000066400000000000000000000022401415504077600305160ustar00rootroot00000000000000import 'externalNoImport'; import * as defaultLegacy from 'external'; import defaultLegacy__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(defaultLegacy__default); console.log(externalAuto); console.log(externalDefault); console.log(externalDefaultOnly); var main = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return a; }, foo: foo }, [defaultLegacy])); export { a }; rollup-2.61.1/test/form/samples/generated-code/arrow-functions-false/_expected/iife.js000066400000000000000000000054451415504077600310350ustar00rootroot00000000000000var bundle = (function (exports, externalNoImport, defaultLegacy, externalAuto, externalDefault, externalDefaultOnly) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } 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) { 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); } 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 defaultLegacy__namespace = /*#__PURE__*/_interopNamespace(defaultLegacy); var defaultLegacy__default = /*#__PURE__*/_interopDefaultLegacy(defaultLegacy); 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 } = defaultLegacy.b); console.log({ a: exports.a } = defaultLegacy.b); Promise.resolve().then(function () { return main; }).then(console.log); import('external').then(console.log); console.log(defaultLegacy__default["default"]); console.log(externalAuto__default["default"]); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace); var main = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return exports.a; }, foo: foo }, [defaultLegacy__namespace])); Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return defaultLegacy.foo; } }); Object.keys(defaultLegacy).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return defaultLegacy[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, null, defaultLegacy, externalAuto, externalDefault, externalDefaultOnly); rollup-2.61.1/test/form/samples/generated-code/arrow-functions-false/_expected/system.js000066400000000000000000000035231415504077600314400ustar00rootroot00000000000000System.register('bundle', ['externalNoImport', 'external', 'externalAuto', 'externalDefault', 'externalDefaultOnly'], (function (exports, module) { 'use strict'; var _starExcludes = { a: 1, 'default': 1, foo: 1 }; var b, defaultLegacy, defaultLegacy__default, externalAuto, externalDefault, externalDefaultOnly; return { setters: [function () {}, function (module) { b = module.b; defaultLegacy = module; defaultLegacy__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(defaultLegacy__default); console.log(externalAuto); console.log(externalDefault); console.log(externalDefaultOnly); var main = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return a; }, foo: foo }, [defaultLegacy])); }) }; })); rollup-2.61.1/test/form/samples/generated-code/arrow-functions-false/_expected/umd.js000066400000000000000000000067211415504077600307040ustar00rootroot00000000000000(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.defaultLegacy, global.externalAuto, global.externalDefault, global.externalDefaultOnly); exports.noConflict = function () { global.bundle = current; return exports; }; })()); })(this, (function (exports, externalNoImport, defaultLegacy, externalAuto, externalDefault, externalDefaultOnly) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } 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) { 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); } 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 defaultLegacy__namespace = /*#__PURE__*/_interopNamespace(defaultLegacy); var defaultLegacy__default = /*#__PURE__*/_interopDefaultLegacy(defaultLegacy); 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 } = defaultLegacy.b); console.log({ a: exports.a } = defaultLegacy.b); Promise.resolve().then(function () { return main; }).then(console.log); import('external').then(console.log); console.log(defaultLegacy__default["default"]); console.log(externalAuto__default["default"]); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace); var main = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return exports.a; }, foo: foo }, [defaultLegacy__namespace])); Object.defineProperty(exports, 'foo', { enumerable: true, get: function () { return defaultLegacy.foo; } }); Object.keys(defaultLegacy).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return defaultLegacy[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/generated-code/arrow-functions-false/main.js000066400000000000000000000010641415504077600270760ustar00rootroot00000000000000import '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 defaultLegacy from 'external'; console.log(defaultLegacy); import externalAuto from 'externalAuto'; console.log(externalAuto); import * as externalDefault from 'externalDefault'; console.log(externalDefault); import * as externalDefaultOnly from 'externalDefaultOnly'; console.log(externalDefaultOnly); rollup-2.61.1/test/form/samples/generated-code/arrow-functions-true/000077500000000000000000000000001415504077600255005ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/arrow-functions-true/_config.js000066400000000000000000000010631415504077600274420ustar00rootroot00000000000000module.exports = { 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 true; }, name: 'bundle', noConflict: true } } }; rollup-2.61.1/test/form/samples/generated-code/arrow-functions-true/_expected/000077500000000000000000000000001415504077600274405ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/arrow-functions-true/_expected/amd.js000066400000000000000000000053501415504077600305420ustar00rootroot00000000000000define(['require', 'exports', 'externalNoImport', 'external', 'externalAuto', 'externalDefault', 'externalDefaultOnly'], (function (require, exports, externalNoImport, defaultLegacy, externalAuto, externalDefault, externalDefaultOnly) { 'use strict'; var _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; var _interopDefault = e => e && e.__esModule ? e : { 'default': 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); } var _interopNamespace = e => e && e.__esModule ? e : _interopNamespaceDefault(e); 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 defaultLegacy__namespace = /*#__PURE__*/_interopNamespace(defaultLegacy); var defaultLegacy__default = /*#__PURE__*/_interopDefaultLegacy(defaultLegacy); 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 } = defaultLegacy.b); console.log({ a: exports.a } = defaultLegacy.b); Promise.resolve().then(() => main).then(console.log); new Promise((resolve, reject) => require(['external'], m => resolve(/*#__PURE__*/_interopNamespace(m)), reject)).then(console.log); console.log(defaultLegacy__default["default"]); console.log(externalAuto__default["default"]); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace); var main = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return exports.a; }, foo: foo }, [defaultLegacy__namespace])); Object.defineProperty(exports, 'foo', { enumerable: true, get: () => defaultLegacy.foo }); Object.keys(defaultLegacy).forEach(k => { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: () => defaultLegacy[k] }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/generated-code/arrow-functions-true/_expected/cjs.js000066400000000000000000000051651415504077600305640ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); require('externalNoImport'); var defaultLegacy = require('external'); var externalAuto = require('externalAuto'); var externalDefault = require('externalDefault'); var externalDefaultOnly = require('externalDefaultOnly'); var _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; var _interopDefault = e => e && e.__esModule ? e : { 'default': 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); } var _interopNamespace = e => e && e.__esModule ? e : _interopNamespaceDefault(e); 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 defaultLegacy__namespace = /*#__PURE__*/_interopNamespace(defaultLegacy); var defaultLegacy__default = /*#__PURE__*/_interopDefaultLegacy(defaultLegacy); 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 } = defaultLegacy.b); console.log({ a: exports.a } = defaultLegacy.b); Promise.resolve().then(() => main).then(console.log); Promise.resolve().then(() => /*#__PURE__*/_interopNamespace(require('external'))).then(console.log); console.log(defaultLegacy__default["default"]); console.log(externalAuto__default["default"]); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace); var main = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return exports.a; }, foo: foo }, [defaultLegacy__namespace])); Object.defineProperty(exports, 'foo', { enumerable: true, get: () => defaultLegacy.foo }); Object.keys(defaultLegacy).forEach(k => { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: () => defaultLegacy[k] }); }); rollup-2.61.1/test/form/samples/generated-code/arrow-functions-true/_expected/es.js000066400000000000000000000021511415504077600304040ustar00rootroot00000000000000import 'externalNoImport'; import * as defaultLegacy from 'external'; import defaultLegacy__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(defaultLegacy__default); console.log(externalAuto); console.log(externalDefault); console.log(externalDefaultOnly); var main = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return a; }, foo: foo }, [defaultLegacy])); export { a }; rollup-2.61.1/test/form/samples/generated-code/arrow-functions-true/_expected/iife.js000066400000000000000000000051641415504077600307200ustar00rootroot00000000000000var bundle = (function (exports, externalNoImport, defaultLegacy, externalAuto, externalDefault, externalDefaultOnly) { 'use strict'; var _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; var _interopDefault = e => e && e.__esModule ? e : { 'default': 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); } var _interopNamespace = e => e && e.__esModule ? e : _interopNamespaceDefault(e); 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 defaultLegacy__namespace = /*#__PURE__*/_interopNamespace(defaultLegacy); var defaultLegacy__default = /*#__PURE__*/_interopDefaultLegacy(defaultLegacy); 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 } = defaultLegacy.b); console.log({ a: exports.a } = defaultLegacy.b); Promise.resolve().then(() => main).then(console.log); import('external').then(console.log); console.log(defaultLegacy__default["default"]); console.log(externalAuto__default["default"]); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace); var main = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return exports.a; }, foo: foo }, [defaultLegacy__namespace])); Object.defineProperty(exports, 'foo', { enumerable: true, get: () => defaultLegacy.foo }); Object.keys(defaultLegacy).forEach(k => { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: () => defaultLegacy[k] }); }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, null, defaultLegacy, externalAuto, externalDefault, externalDefaultOnly); rollup-2.61.1/test/form/samples/generated-code/arrow-functions-true/_expected/system.js000066400000000000000000000033241415504077600313240ustar00rootroot00000000000000System.register('bundle', ['externalNoImport', 'external', 'externalAuto', 'externalDefault', 'externalDefaultOnly'], (function (exports, module) { 'use strict'; var _starExcludes = { a: 1, 'default': 1, foo: 1 }; var b, defaultLegacy, defaultLegacy__default, externalAuto, externalDefault, externalDefaultOnly; return { setters: [() => {}, module => { b = module.b; defaultLegacy = module; defaultLegacy__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(defaultLegacy__default); console.log(externalAuto); console.log(externalDefault); console.log(externalDefaultOnly); var main = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return a; }, foo: foo }, [defaultLegacy])); }) }; })); rollup-2.61.1/test/form/samples/generated-code/arrow-functions-true/_expected/umd.js000066400000000000000000000064241415504077600305710ustar00rootroot00000000000000(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.defaultLegacy, global.externalAuto, global.externalDefault, global.externalDefaultOnly); exports.noConflict = () => { global.bundle = current; return exports; }; })()); })(this, (function (exports, externalNoImport, defaultLegacy, externalAuto, externalDefault, externalDefaultOnly) { 'use strict'; var _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; var _interopDefault = e => e && e.__esModule ? e : { 'default': 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); } var _interopNamespace = e => e && e.__esModule ? e : _interopNamespaceDefault(e); 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 defaultLegacy__namespace = /*#__PURE__*/_interopNamespace(defaultLegacy); var defaultLegacy__default = /*#__PURE__*/_interopDefaultLegacy(defaultLegacy); 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 } = defaultLegacy.b); console.log({ a: exports.a } = defaultLegacy.b); Promise.resolve().then(() => main).then(console.log); import('external').then(console.log); console.log(defaultLegacy__default["default"]); console.log(externalAuto__default["default"]); console.log(externalDefault__namespace); console.log(externalDefaultOnly__namespace); var main = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, get a () { return exports.a; }, foo: foo }, [defaultLegacy__namespace])); Object.defineProperty(exports, 'foo', { enumerable: true, get: () => defaultLegacy.foo }); Object.keys(defaultLegacy).forEach(k => { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: () => defaultLegacy[k] }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/generated-code/arrow-functions-true/main.js000077700000000000000000000000001415504077600347022../arrow-functions-false/main.jsustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/const-bindings-false/000077500000000000000000000000001415504077600253745ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/const-bindings-false/_config.js000066400000000000000000000007261415504077600273430ustar00rootroot00000000000000module.exports = { 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' }, plugins: [ { transform(code, id) { if (id.endsWith('synthetic.js')) { return { syntheticNamedExports: true }; } } } ] } }; rollup-2.61.1/test/form/samples/generated-code/const-bindings-false/_expected/000077500000000000000000000000001415504077600273345ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/const-bindings-false/_expected/amd.js000066400000000000000000000024661415504077600304430ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, foo$1) { 'use strict'; var _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; function _interopNamespace(e) { if (e && e.__esModule) 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__default = /*#__PURE__*/_interopDefaultLegacy(foo$1); var foo__namespace = /*#__PURE__*/_interopNamespace(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__default["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' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: () => foo$1[k] }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/generated-code/const-bindings-false/_expected/cjs.js000066400000000000000000000023561415504077600304570ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var foo$1 = require('external'); var _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; function _interopNamespace(e) { if (e && e.__esModule) 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__default = /*#__PURE__*/_interopDefaultLegacy(foo$1); var foo__namespace = /*#__PURE__*/_interopNamespace(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__default["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' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: () => foo$1[k] }); }); rollup-2.61.1/test/form/samples/generated-code/const-bindings-false/_expected/es.js000066400000000000000000000007251415504077600303050ustar00rootroot00000000000000import * 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-2.61.1/test/form/samples/generated-code/const-bindings-false/_expected/iife.js000066400000000000000000000025001415504077600306030ustar00rootroot00000000000000var bundle = (function (exports, foo$1) { 'use strict'; var _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; function _interopNamespace(e) { if (e && e.__esModule) 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__default = /*#__PURE__*/_interopDefaultLegacy(foo$1); var foo__namespace = /*#__PURE__*/_interopNamespace(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__default["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' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: () => foo$1[k] }); }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, foo$1); rollup-2.61.1/test/form/samples/generated-code/const-bindings-false/_expected/system.js000066400000000000000000000014671415504077600312260ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/generated-code/const-bindings-false/_expected/umd.js000066400000000000000000000034131415504077600304600ustar00rootroot00000000000000(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'; var _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; function _interopNamespace(e) { if (e && e.__esModule) 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__default = /*#__PURE__*/_interopDefaultLegacy(foo$1); var foo__namespace = /*#__PURE__*/_interopNamespace(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__default["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' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: () => foo$1[k] }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/generated-code/const-bindings-false/main.js000066400000000000000000000003621415504077600266570ustar00rootroot00000000000000import 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-2.61.1/test/form/samples/generated-code/const-bindings-false/other.js000066400000000000000000000000321415504077600270460ustar00rootroot00000000000000export const foo = 'bar'; rollup-2.61.1/test/form/samples/generated-code/const-bindings-false/synthetic.js000066400000000000000000000000371415504077600277440ustar00rootroot00000000000000export default { bar: 'baz' }; rollup-2.61.1/test/form/samples/generated-code/const-bindings-true/000077500000000000000000000000001415504077600252615ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/const-bindings-true/_config.js000066400000000000000000000007151415504077600272260ustar00rootroot00000000000000module.exports = { description: 'uses block bindings', expectedWarnings: ['SHIMMED_EXPORT'], options: { external: ['external'], shimMissingExports: true, output: { generatedCode: { arrowFunctions: true, constBindings: true }, name: 'bundle', noConflict: true, exports: 'named' }, plugins: [ { transform(code, id) { if (id.endsWith('synthetic.js')) { return { syntheticNamedExports: true }; } } } ] } }; rollup-2.61.1/test/form/samples/generated-code/const-bindings-true/_expected/000077500000000000000000000000001415504077600272215ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/const-bindings-true/_expected/amd.js000066400000000000000000000024621415504077600303240ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, foo$1) { 'use strict'; const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; function _interopNamespace(e) { if (e && e.__esModule) 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__default = /*#__PURE__*/_interopDefaultLegacy(foo$1); const foo__namespace = /*#__PURE__*/_interopNamespace(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__default["default"], foo__namespace, other, bar, _missingExportShim); const main = 42; exports["default"] = main; exports.syntheticMissing = synthetic.syntheticMissing; for (const k in foo$1) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: () => foo$1[k] }); } Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/generated-code/const-bindings-true/_expected/cjs.js000066400000000000000000000023541415504077600303420ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const foo$1 = require('external'); const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; function _interopNamespace(e) { if (e && e.__esModule) 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__default = /*#__PURE__*/_interopDefaultLegacy(foo$1); const foo__namespace = /*#__PURE__*/_interopNamespace(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__default["default"], foo__namespace, other, bar, _missingExportShim); const main = 42; exports["default"] = main; exports.syntheticMissing = synthetic.syntheticMissing; for (const k in foo$1) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: () => foo$1[k] }); } rollup-2.61.1/test/form/samples/generated-code/const-bindings-true/_expected/es.js000066400000000000000000000007371415504077600301750ustar00rootroot00000000000000import * 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-2.61.1/test/form/samples/generated-code/const-bindings-true/_expected/iife.js000066400000000000000000000024761415504077600305040ustar00rootroot00000000000000const bundle = (function (exports, foo$1) { 'use strict'; const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; function _interopNamespace(e) { if (e && e.__esModule) 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__default = /*#__PURE__*/_interopDefaultLegacy(foo$1); const foo__namespace = /*#__PURE__*/_interopNamespace(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__default["default"], foo__namespace, other, bar, _missingExportShim); const main = 42; exports["default"] = main; exports.syntheticMissing = synthetic.syntheticMissing; for (const k in foo$1) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: () => foo$1[k] }); } Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, foo$1); rollup-2.61.1/test/form/samples/generated-code/const-bindings-true/_expected/system.js000066400000000000000000000015051415504077600311040ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/generated-code/const-bindings-true/_expected/umd.js000066400000000000000000000034131415504077600303450ustar00rootroot00000000000000(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'; const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; function _interopNamespace(e) { if (e && e.__esModule) 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__default = /*#__PURE__*/_interopDefaultLegacy(foo$1); const foo__namespace = /*#__PURE__*/_interopNamespace(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__default["default"], foo__namespace, other, bar, _missingExportShim); const main = 42; exports["default"] = main; exports.syntheticMissing = synthetic.syntheticMissing; for (const k in foo$1) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: () => foo$1[k] }); } Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/generated-code/const-bindings-true/main.js000077700000000000000000000000001415504077600373252../../generated-code/const-bindings-false/main.jsustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/object-shorthand-false/000077500000000000000000000000001415504077600257115ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/object-shorthand-false/_config.js000066400000000000000000000003251415504077600276530ustar00rootroot00000000000000module.exports = { description: 'does not use object shorthand syntax', options: { output: { exports: 'named', format: 'system', generatedCode: { objectShorthand: false }, name: 'bundle' } } }; rollup-2.61.1/test/form/samples/generated-code/object-shorthand-false/_expected.js000066400000000000000000000005151415504077600302100ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/generated-code/object-shorthand-false/main.js000066400000000000000000000001571415504077600271760ustar00rootroot00000000000000import * as ns from './other.js'; console.log(ns); const foo = 1; export { foo, foo as bar, foo as default }; rollup-2.61.1/test/form/samples/generated-code/object-shorthand-false/other.js000066400000000000000000000000631415504077600273670ustar00rootroot00000000000000const a = 'a'; export { a, a as b, a as default }; rollup-2.61.1/test/form/samples/generated-code/object-shorthand-true/000077500000000000000000000000001415504077600255765ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/object-shorthand-true/_config.js000066400000000000000000000003141415504077600275360ustar00rootroot00000000000000module.exports = { description: 'uses object shorthand syntax', options: { output: { exports: 'named', format: 'system', generatedCode: { objectShorthand: true }, name: 'bundle' } } }; rollup-2.61.1/test/form/samples/generated-code/object-shorthand-true/_expected.js000066400000000000000000000005051415504077600300740ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/generated-code/object-shorthand-true/main.js000077700000000000000000000000001415504077600401572../../generated-code/object-shorthand-false/main.jsustar00rootroot00000000000000reserved-names-as-props-false-no-external-live-bindings/000077500000000000000000000000001415504077600340405ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code_config.js000066400000000000000000000004431415504077600360030ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/reserved-names-as-props-false-no-external-live-bindingsmodule.exports = { description: 'escapes reserved names used as props when external live-bindings are off', options: { external: ['external'], output: { exports: 'named', externalLiveBindings: false, generatedCode: { reservedNamesAsProps: false }, name: 'bundle' } } }; _expected/000077500000000000000000000000001415504077600360005ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/reserved-names-as-props-false-no-external-live-bindingsamd.js000066400000000000000000000004031415504077600370740ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/reserved-names-as-props-false-no-external-live-bindings/_expecteddefine(['external'], (function (ns) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; } var ns__default = /*#__PURE__*/_interopDefaultLegacy(ns); console.log(ns__default); })); cjs.js000066400000000000000000000003631415504077600371170ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/reserved-names-as-props-false-no-external-live-bindings/_expected'use strict'; var ns = require('external'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; } var ns__default = /*#__PURE__*/_interopDefaultLegacy(ns); console.log(ns__default); es.js000066400000000000000000000000551415504077600367450ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/reserved-names-as-props-false-no-external-live-bindings/_expectedimport ns from 'external'; console.log(ns); iife.js000066400000000000000000000003621415504077600372530ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/reserved-names-as-props-false-no-external-live-bindings/_expected(function (ns) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; } var ns__default = /*#__PURE__*/_interopDefaultLegacy(ns); console.log(ns__default); })(ns); system.js000066400000000000000000000003301415504077600376560ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000010431415504077600371210ustar00rootroot00000000000000rollup-2.61.1/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 _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; } var ns__default = /*#__PURE__*/_interopDefaultLegacy(ns); console.log(ns__default); })); main.js000066400000000000000000000000541415504077600353210ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/reserved-names-as-props-false-no-external-live-bindingsimport ns from 'external'; console.log(ns); rollup-2.61.1/test/form/samples/generated-code/reserved-names-as-props-false/000077500000000000000000000000001415504077600271355ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/reserved-names-as-props-false/_config.js000066400000000000000000000007121415504077600310770ustar00rootroot00000000000000module.exports = { 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: [ { transform() { return { syntheticNamedExports: true }; } } ] } }; rollup-2.61.1/test/form/samples/generated-code/reserved-names-as-props-false/_expected/000077500000000000000000000000001415504077600310755ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/reserved-names-as-props-false/_expected/amd.js000066400000000000000000000041611415504077600321760ustar00rootroot00000000000000define(['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__*/Object.freeze(/*#__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-2.61.1/test/form/samples/generated-code/reserved-names-as-props-false/_expected/cjs.js000066400000000000000000000040411415504077600322110ustar00rootroot00000000000000'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__*/Object.freeze(/*#__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-2.61.1/test/form/samples/generated-code/reserved-names-as-props-false/_expected/es.js000066400000000000000000000020141415504077600320370ustar00rootroot00000000000000import { 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__*/Object.freeze(/*#__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-2.61.1/test/form/samples/generated-code/reserved-names-as-props-false/_expected/iife.js000066400000000000000000000041421415504077600323500ustar00rootroot00000000000000var 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__*/Object.freeze(/*#__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-2.61.1/test/form/samples/generated-code/reserved-names-as-props-false/_expected/system.js000066400000000000000000000025051415504077600327610ustar00rootroot00000000000000System.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__*/Object.freeze(/*#__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-2.61.1/test/form/samples/generated-code/reserved-names-as-props-false/_expected/umd.js000066400000000000000000000050001415504077600322130ustar00rootroot00000000000000(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__*/Object.freeze(/*#__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-2.61.1/test/form/samples/generated-code/reserved-names-as-props-false/main.js000066400000000000000000000007111415504077600304160ustar00rootroot00000000000000import * 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-2.61.1/test/form/samples/generated-code/reserved-names-as-props-false/other.js000066400000000000000000000000401415504077600306060ustar00rootroot00000000000000export default { foo: 'bar' }; reserved-names-as-props-true-no-external-live-bindings/000077500000000000000000000000001415504077600337255ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code_config.js000066400000000000000000000004421415504077600356670ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/reserved-names-as-props-true-no-external-live-bindingsmodule.exports = { description: 'escapes reserved names used as props when external live-bindings are off', options: { external: ['external'], output: { exports: 'named', externalLiveBindings: false, generatedCode: { reservedNamesAsProps: true }, name: 'bundle' } } }; _expected/000077500000000000000000000000001415504077600356655ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/reserved-names-as-props-true-no-external-live-bindingsamd.js000066400000000000000000000004001415504077600367560ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/reserved-names-as-props-true-no-external-live-bindings/_expecteddefine(['external'], (function (ns) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; } var ns__default = /*#__PURE__*/_interopDefaultLegacy(ns); console.log(ns__default); })); cjs.js000066400000000000000000000003601415504077600370010ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/reserved-names-as-props-true-no-external-live-bindings/_expected'use strict'; var ns = require('external'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; } var ns__default = /*#__PURE__*/_interopDefaultLegacy(ns); console.log(ns__default); es.js000066400000000000000000000000551415504077600366320ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/reserved-names-as-props-true-no-external-live-bindings/_expectedimport ns from 'external'; console.log(ns); iife.js000066400000000000000000000003571415504077600371440ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/reserved-names-as-props-true-no-external-live-bindings/_expected(function (ns) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; } var ns__default = /*#__PURE__*/_interopDefaultLegacy(ns); console.log(ns__default); })(ns); system.js000066400000000000000000000003251415504077600375470ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000010401415504077600370030ustar00rootroot00000000000000rollup-2.61.1/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 _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; } var ns__default = /*#__PURE__*/_interopDefaultLegacy(ns); console.log(ns__default); })); main.js000077700000000000000000000000001415504077600545142../../generated-code/reserved-names-as-props-false-no-external-live-bindings/main.jsustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/reserved-names-as-props-true-no-external-live-bindingsrollup-2.61.1/test/form/samples/generated-code/reserved-names-as-props-true/000077500000000000000000000000001415504077600270225ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/reserved-names-as-props-true/_config.js000066400000000000000000000007111415504077600307630ustar00rootroot00000000000000module.exports = { 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: [ { transform() { return { syntheticNamedExports: true }; } } ] } }; rollup-2.61.1/test/form/samples/generated-code/reserved-names-as-props-true/_expected/000077500000000000000000000000001415504077600307625ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/generated-code/reserved-names-as-props-true/_expected/amd.js000066400000000000000000000041201415504077600320560ustar00rootroot00000000000000define(['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__*/Object.freeze(/*#__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-2.61.1/test/form/samples/generated-code/reserved-names-as-props-true/_expected/cjs.js000066400000000000000000000040001415504077600320710ustar00rootroot00000000000000'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__*/Object.freeze(/*#__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-2.61.1/test/form/samples/generated-code/reserved-names-as-props-true/_expected/es.js000066400000000000000000000020071415504077600317260ustar00rootroot00000000000000import { 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__*/Object.freeze(/*#__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-2.61.1/test/form/samples/generated-code/reserved-names-as-props-true/_expected/iife.js000066400000000000000000000041011415504077600322300ustar00rootroot00000000000000var 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__*/Object.freeze(/*#__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-2.61.1/test/form/samples/generated-code/reserved-names-as-props-true/_expected/system.js000066400000000000000000000024551415504077600326520ustar00rootroot00000000000000System.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__*/Object.freeze(/*#__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-2.61.1/test/form/samples/generated-code/reserved-names-as-props-true/_expected/umd.js000066400000000000000000000047371415504077600321200ustar00rootroot00000000000000(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__*/Object.freeze(/*#__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-2.61.1/test/form/samples/generated-code/reserved-names-as-props-true/main.js000077700000000000000000000000001415504077600426272../../generated-code/reserved-names-as-props-false/main.jsustar00rootroot00000000000000rollup-2.61.1/test/form/samples/getter-return-values/000077500000000000000000000000001415504077600226215ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/getter-return-values/_config.js000066400000000000000000000001101415504077600245530ustar00rootroot00000000000000module.exports = { description: 'forwards return values of getters' }; rollup-2.61.1/test/form/samples/getter-return-values/_expected.js000066400000000000000000000006551415504077600251250ustar00rootroot00000000000000({ 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-2.61.1/test/form/samples/getter-return-values/main.js000066400000000000000000000011061415504077600241010ustar00rootroot00000000000000({ 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-2.61.1/test/form/samples/globals-function/000077500000000000000000000000001415504077600217635ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/globals-function/_config.js000066400000000000000000000003041415504077600237220ustar00rootroot00000000000000module.exports = { description: 'Externals aliases with deshadowing', options: { external: ['a', 'b'], output: { globals: id => `thisIs${id.toUpperCase()}`, name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/globals-function/_expected/000077500000000000000000000000001415504077600237235ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/globals-function/_expected/amd.js000066400000000000000000000005371415504077600250270ustar00rootroot00000000000000define(['a', 'b'], (function (a, b) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var a__default = /*#__PURE__*/_interopDefaultLegacy(a); var b__default = /*#__PURE__*/_interopDefaultLegacy(b); console.log(a__default["default"], b__default["default"]); })); rollup-2.61.1/test/form/samples/globals-function/_expected/cjs.js000066400000000000000000000005341415504077600250420ustar00rootroot00000000000000'use strict'; var a = require('a'); var b = require('b'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var a__default = /*#__PURE__*/_interopDefaultLegacy(a); var b__default = /*#__PURE__*/_interopDefaultLegacy(b); console.log(a__default["default"], b__default["default"]); rollup-2.61.1/test/form/samples/globals-function/_expected/es.js000066400000000000000000000000721415504077600246670ustar00rootroot00000000000000import a from 'a'; import b from 'b'; console.log(a, b); rollup-2.61.1/test/form/samples/globals-function/_expected/iife.js000066400000000000000000000005361415504077600252010ustar00rootroot00000000000000(function (a, b) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var a__default = /*#__PURE__*/_interopDefaultLegacy(a); var b__default = /*#__PURE__*/_interopDefaultLegacy(b); console.log(a__default["default"], b__default["default"]); })(thisIsA, thisIsB); rollup-2.61.1/test/form/samples/globals-function/_expected/system.js000066400000000000000000000004161415504077600256060ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/globals-function/_expected/umd.js000066400000000000000000000012331415504077600250450ustar00rootroot00000000000000(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'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var a__default = /*#__PURE__*/_interopDefaultLegacy(a); var b__default = /*#__PURE__*/_interopDefaultLegacy(b); console.log(a__default["default"], b__default["default"]); })); rollup-2.61.1/test/form/samples/globals-function/main.js000066400000000000000000000000721415504077600232440ustar00rootroot00000000000000import a from 'a'; import b from 'b'; console.log(a, b); rollup-2.61.1/test/form/samples/globals-removes-access-to-pure-function-members/000077500000000000000000000000001415504077600277215ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/globals-removes-access-to-pure-function-members/_config.js000066400000000000000000000001641415504077600316640ustar00rootroot00000000000000module.exports = { description: 'accessing members of pure functions and their prototypes is not a side-effect' }; rollup-2.61.1/test/form/samples/globals-removes-access-to-pure-function-members/_expected/000077500000000000000000000000001415504077600316615ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/globals-removes-access-to-pure-function-members/_expected/amd.js000066400000000000000000000001351415504077600327570ustar00rootroot00000000000000define((function () { 'use strict'; Unknown.staticMember; Unknown.prototype.method; })); rollup-2.61.1/test/form/samples/globals-removes-access-to-pure-function-members/_expected/cjs.js000066400000000000000000000000771415504077600330020ustar00rootroot00000000000000'use strict'; Unknown.staticMember; Unknown.prototype.method; rollup-2.61.1/test/form/samples/globals-removes-access-to-pure-function-members/_expected/es.js000066400000000000000000000000601415504077600326220ustar00rootroot00000000000000Unknown.staticMember; Unknown.prototype.method; rollup-2.61.1/test/form/samples/globals-removes-access-to-pure-function-members/_expected/iife.js000066400000000000000000000001301415504077600331250ustar00rootroot00000000000000(function () { 'use strict'; Unknown.staticMember; Unknown.prototype.method; })(); rollup-2.61.1/test/form/samples/globals-removes-access-to-pure-function-members/_expected/system.js000066400000000000000000000002341415504077600335420ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { Unknown.staticMember; Unknown.prototype.method; }) }; })); rollup-2.61.1/test/form/samples/globals-removes-access-to-pure-function-members/_expected/umd.js000066400000000000000000000002731415504077600330060ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; Unknown.staticMember; Unknown.prototype.method; })); rollup-2.61.1/test/form/samples/globals-removes-access-to-pure-function-members/main.js000066400000000000000000000001741415504077600312050ustar00rootroot00000000000000Symbol.iterator; Array.prototype.reverse; Object.prototype.hasOwnProperty; Unknown.staticMember; Unknown.prototype.method; rollup-2.61.1/test/form/samples/guessed-global-names/000077500000000000000000000000001415504077600225135ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/guessed-global-names/_config.js000066400000000000000000000004501415504077600244540ustar00rootroot00000000000000const { resolve } = require('path'); module.exports = { description: 'guesses global names if necessary', expectedWarnings: ['MISSING_GLOBAL_NAME'], options: { external: [ 'unchanged', 'changed', 'special-character', 'with/slash', resolve(__dirname, 'relative.js') ] } }; rollup-2.61.1/test/form/samples/guessed-global-names/_expected/000077500000000000000000000000001415504077600244535ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/guessed-global-names/_expected/amd.js000066400000000000000000000007461415504077600255610ustar00rootroot00000000000000define(['unchanged', 'changed', 'special-character', 'with/slash', './relative'], (function (unchanged, changedName, specialCharacter, slash, relative_js) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var changedName__default = /*#__PURE__*/_interopDefaultLegacy(changedName); console.log(unchanged.foo, changedName__default["default"], specialCharacter.bar, slash.baz, relative_js.quux); })); rollup-2.61.1/test/form/samples/guessed-global-names/_expected/cjs.js000066400000000000000000000010211415504077600255620ustar00rootroot00000000000000'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'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var changedName__default = /*#__PURE__*/_interopDefaultLegacy(changedName); console.log(unchanged.foo, changedName__default["default"], specialCharacter.bar, slash.baz, relative_js.quux); rollup-2.61.1/test/form/samples/guessed-global-names/_expected/es.js000066400000000000000000000003451415504077600254220ustar00rootroot00000000000000import { 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-2.61.1/test/form/samples/guessed-global-names/_expected/iife.js000066400000000000000000000007221415504077600257260ustar00rootroot00000000000000(function (unchanged, changedName, specialCharacter, slash, relative_js) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var changedName__default = /*#__PURE__*/_interopDefaultLegacy(changedName); console.log(unchanged.foo, changedName__default["default"], specialCharacter.bar, slash.baz, relative_js.quux); })(unchanged, changedName, specialCharacter, slash, relative_js); rollup-2.61.1/test/form/samples/guessed-global-names/_expected/system.js000066400000000000000000000010151415504077600263320ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/guessed-global-names/_expected/umd.js000066400000000000000000000017001415504077600255740ustar00rootroot00000000000000(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'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var changedName__default = /*#__PURE__*/_interopDefaultLegacy(changedName); console.log(unchanged.foo, changedName__default["default"], specialCharacter.bar, slash.baz, relative_js.quux); })); rollup-2.61.1/test/form/samples/guessed-global-names/main.js000066400000000000000000000003451415504077600237770ustar00rootroot00000000000000import { 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-2.61.1/test/form/samples/handles-async-await/000077500000000000000000000000001415504077600223515ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/handles-async-await/_config.js000066400000000000000000000001211415504077600243050ustar00rootroot00000000000000module.exports = { description: 'properly handles exporting async functions' }; rollup-2.61.1/test/form/samples/handles-async-await/_expected.js000066400000000000000000000001671415504077600246530ustar00rootroot00000000000000async function callback() { const response = await Promise.resolve(43); return response - 1; } export { callback }; rollup-2.61.1/test/form/samples/handles-async-await/main.js000066400000000000000000000001501415504077600236270ustar00rootroot00000000000000export async function callback() { const response = await Promise.resolve(43); return response - 1; } rollup-2.61.1/test/form/samples/handles-empty-imports-iife/000077500000000000000000000000001415504077600236745ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/handles-empty-imports-iife/_config.js000066400000000000000000000004201415504077600256320ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/form/samples/handles-empty-imports-iife/_expected.js000066400000000000000000000001671415504077600261760ustar00rootroot00000000000000(function (dns, util, fs) { 'use strict'; dns.resolve('name'); fs.writeFileSync('foo', 'bar'); })(dns, util, fs); rollup-2.61.1/test/form/samples/handles-empty-imports-iife/main.js000066400000000000000000000002011415504077600251470ustar00rootroot00000000000000import { resolve } from 'dns'; import 'util'; import { writeFileSync } from 'fs'; resolve('name'); writeFileSync('foo', 'bar'); rollup-2.61.1/test/form/samples/handles-empty-imports-umd/000077500000000000000000000000001415504077600235455ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/handles-empty-imports-umd/_config.js000066400000000000000000000004171415504077600255110ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/form/samples/handles-empty-imports-umd/_expected.js000066400000000000000000000007321415504077600260450ustar00rootroot00000000000000(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-2.61.1/test/form/samples/handles-empty-imports-umd/main.js000066400000000000000000000002011415504077600250200ustar00rootroot00000000000000import { resolve } from 'dns'; import 'util'; import { writeFileSync } from 'fs'; resolve('name'); writeFileSync('foo', 'bar'); rollup-2.61.1/test/form/samples/hoisted-unused-conditional/000077500000000000000000000000001415504077600237565ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/hoisted-unused-conditional/_config.js000066400000000000000000000001521415504077600257160ustar00rootroot00000000000000module.exports = { description: 'Properly renders conditionals in hoisted variables in dead branches' }; rollup-2.61.1/test/form/samples/hoisted-unused-conditional/_expected.js000066400000000000000000000001251415504077600262520ustar00rootroot00000000000000var deadVariable, otherDeadVariable; console.log(deadVariable, otherDeadVariable); rollup-2.61.1/test/form/samples/hoisted-unused-conditional/main.js000066400000000000000000000001751415504077600252430ustar00rootroot00000000000000if (false) { var deadVariable = someGlobal ? 1 : 2, otherDeadVariable = 3; } console.log(deadVariable, otherDeadVariable); rollup-2.61.1/test/form/samples/hoisted-variable-case-stmt/000077500000000000000000000000001415504077600236355ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/hoisted-variable-case-stmt/_config.js000066400000000000000000000001601415504077600255740ustar00rootroot00000000000000module.exports = { description: 'Properly handles a variable hoisted from within a fallthrough switch case' }; rollup-2.61.1/test/form/samples/hoisted-variable-case-stmt/_expected.js000066400000000000000000000002211415504077600261260ustar00rootroot00000000000000switch (globalThis.unknown) { case 1: var hoisted = true; case 2: if (hoisted) { throw "failed"; } } rollup-2.61.1/test/form/samples/hoisted-variable-case-stmt/main.js000066400000000000000000000002211415504077600251120ustar00rootroot00000000000000switch (globalThis.unknown) { case 1: var hoisted = true; case 2: if (hoisted) { throw "failed"; } } rollup-2.61.1/test/form/samples/hoisted-variable-if-stmt/000077500000000000000000000000001415504077600233205ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/hoisted-variable-if-stmt/_config.js000066400000000000000000000001751415504077600252650ustar00rootroot00000000000000module.exports = { description: 'Properly renders branches which refer to hoisted variables from other lexical scopes' }; rollup-2.61.1/test/form/samples/hoisted-variable-if-stmt/_expected.js000066400000000000000000000002041415504077600256120ustar00rootroot00000000000000var foo; if (foo) { console.log("nope"); } { var bar; { bar = true; } } if (bar) { console.log("ok"); } rollup-2.61.1/test/form/samples/hoisted-variable-if-stmt/main.js000066400000000000000000000003371415504077600246050ustar00rootroot00000000000000if (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-2.61.1/test/form/samples/hoisted-vars-in-dead-branches/000077500000000000000000000000001415504077600242075ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/hoisted-vars-in-dead-branches/_config.js000066400000000000000000000001211415504077600261430ustar00rootroot00000000000000module.exports = { description: 'renders hoisted variables in dead branches' }; rollup-2.61.1/test/form/samples/hoisted-vars-in-dead-branches/_expected.js000066400000000000000000000001571415504077600265100ustar00rootroot00000000000000var a, b; { console.log(a, b); } var c, d; if (((() => console.log('effect'))(), true)) ; console.log(c, d); rollup-2.61.1/test/form/samples/hoisted-vars-in-dead-branches/main.js000066400000000000000000000004121415504077600254660ustar00rootroot00000000000000if (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-2.61.1/test/form/samples/ignore-property-access-side-effects/000077500000000000000000000000001415504077600254605ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/ignore-property-access-side-effects/_config.js000066400000000000000000000003561415504077600274260ustar00rootroot00000000000000module.exports = { description: 'ignore side-effects when accessing properties if treeshake.propertyReadSideEffects is false', expectedWarnings: ['EMPTY_BUNDLE'], options: { treeshake: { propertyReadSideEffects: false } } }; rollup-2.61.1/test/form/samples/ignore-property-access-side-effects/_expected.js000066400000000000000000000000011415504077600277450ustar00rootroot00000000000000 rollup-2.61.1/test/form/samples/ignore-property-access-side-effects/main.js000066400000000000000000000010471415504077600267440ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/ignore-unknown-global-side-effects/000077500000000000000000000000001415504077600252725ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/ignore-unknown-global-side-effects/_config.js000066400000000000000000000003651415504077600272400ustar00rootroot00000000000000module.exports = { description: 'ignore side-effects when accessing unknown globals if treeshake.unknownGlobalSideEffects is false', expectedWarnings: ['EMPTY_BUNDLE'], options: { treeshake: { unknownGlobalSideEffects: false } } }; rollup-2.61.1/test/form/samples/ignore-unknown-global-side-effects/_expected.js000066400000000000000000000000011415504077600275570ustar00rootroot00000000000000 rollup-2.61.1/test/form/samples/ignore-unknown-global-side-effects/main.js000066400000000000000000000000361415504077600265530ustar00rootroot00000000000000foo; class bar extends baz {} rollup-2.61.1/test/form/samples/implicit-undefined-assignments/000077500000000000000000000000001415504077600246175ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/implicit-undefined-assignments/_config.js000066400000000000000000000001571415504077600265640ustar00rootroot00000000000000module.exports = { description: 'Make sure implicit undefined assignments in declarations are not ignored' }; rollup-2.61.1/test/form/samples/implicit-undefined-assignments/_expected/000077500000000000000000000000001415504077600265575ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/implicit-undefined-assignments/_expected/amd.js000066400000000000000000000002141415504077600276530ustar00rootroot00000000000000define((function () { 'use strict'; let a; a(); let b; b.foo = 'bar'; let { c } = {}; c(); let { d } = {}; d.foo = 'bar'; })); rollup-2.61.1/test/form/samples/implicit-undefined-assignments/_expected/cjs.js000066400000000000000000000001501415504077600276700ustar00rootroot00000000000000'use strict'; let a; a(); let b; b.foo = 'bar'; let { c } = {}; c(); let { d } = {}; d.foo = 'bar'; rollup-2.61.1/test/form/samples/implicit-undefined-assignments/_expected/es.js000066400000000000000000000001311415504077600275170ustar00rootroot00000000000000let a; a(); let b; b.foo = 'bar'; let { c } = {}; c(); let { d } = {}; d.foo = 'bar'; rollup-2.61.1/test/form/samples/implicit-undefined-assignments/_expected/iife.js000066400000000000000000000002071415504077600300300ustar00rootroot00000000000000(function () { 'use strict'; let a; a(); let b; b.foo = 'bar'; let { c } = {}; c(); let { d } = {}; d.foo = 'bar'; })(); rollup-2.61.1/test/form/samples/implicit-undefined-assignments/_expected/system.js000066400000000000000000000003271415504077600304430ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { let a; a(); let b; b.foo = 'bar'; let { c } = {}; c(); let { d } = {}; d.foo = 'bar'; }) }; })); rollup-2.61.1/test/form/samples/implicit-undefined-assignments/_expected/umd.js000066400000000000000000000003521415504077600277020ustar00rootroot00000000000000(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-2.61.1/test/form/samples/implicit-undefined-assignments/main.js000066400000000000000000000001311415504077600260740ustar00rootroot00000000000000let a; a(); let b; b.foo = 'bar'; let { c } = {}; c(); let { d } = {}; d.foo = 'bar'; rollup-2.61.1/test/form/samples/import-expression/000077500000000000000000000000001415504077600222245ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/import-expression/_config.js000066400000000000000000000002721415504077600241670ustar00rootroot00000000000000module.exports = { description: 'correctly transforms variables in imported expressions', options: { external: 'external', output: { globals: { external: 'external' } } } }; rollup-2.61.1/test/form/samples/import-expression/_expected/000077500000000000000000000000001415504077600241645ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/import-expression/_expected/amd.js000066400000000000000000000013121415504077600252600ustar00rootroot00000000000000define(['require', 'external'], (function (require, external) { 'use strict'; 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 (t) { return new Promise(function (resolve, reject) { require([t], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }); })(external.join('a', 'b')); console.log(external.join); })); rollup-2.61.1/test/form/samples/import-expression/_expected/cjs.js000066400000000000000000000011611415504077600253000ustar00rootroot00000000000000'use strict'; var external = require('external'); 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 (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })(external.join('a', 'b')); console.log(external.join); rollup-2.61.1/test/form/samples/import-expression/_expected/es.js000066400000000000000000000001151415504077600251260ustar00rootroot00000000000000import { join } from 'external'; import(join('a', 'b')); console.log(join); rollup-2.61.1/test/form/samples/import-expression/_expected/iife.js000066400000000000000000000001651415504077600254400ustar00rootroot00000000000000(function (external) { 'use strict'; import(external.join('a', 'b')); console.log(external.join); })(external); rollup-2.61.1/test/form/samples/import-expression/_expected/system.js000066400000000000000000000003771415504077600260550ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/import-expression/_expected/umd.js000066400000000000000000000006461415504077600253150ustar00rootroot00000000000000(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-2.61.1/test/form/samples/import-expression/main.js000066400000000000000000000001411415504077600235020ustar00rootroot00000000000000import { join as pathJoin } from 'external'; import(pathJoin('a', 'b')); console.log(pathJoin); rollup-2.61.1/test/form/samples/import-external-namespace-and-default/000077500000000000000000000000001415504077600257635ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/import-external-namespace-and-default/_config.js000066400000000000000000000002611415504077600277240ustar00rootroot00000000000000module.exports = { description: 'disinguishes between external default and namespace (#637)', options: { external: ['foo'], output: { globals: { foo: 'foo' } } } }; rollup-2.61.1/test/form/samples/import-external-namespace-and-default/_expected/000077500000000000000000000000001415504077600277235ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/import-external-namespace-and-default/_expected/amd.js000066400000000000000000000014251415504077600310240ustar00rootroot00000000000000define(['foo'], (function (foo) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? 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 foo__namespace = /*#__PURE__*/_interopNamespace(foo); var foo__default = /*#__PURE__*/_interopDefaultLegacy(foo); console.log( foo__namespace.bar ); console.log( foo__default["default"] ); })); rollup-2.61.1/test/form/samples/import-external-namespace-and-default/_expected/cjs.js000066400000000000000000000013621415504077600310420ustar00rootroot00000000000000'use strict'; var foo = require('foo'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? 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 foo__namespace = /*#__PURE__*/_interopNamespace(foo); var foo__default = /*#__PURE__*/_interopDefaultLegacy(foo); console.log( foo__namespace.bar ); console.log( foo__default["default"] ); rollup-2.61.1/test/form/samples/import-external-namespace-and-default/_expected/es.js000066400000000000000000000001631415504077600306700ustar00rootroot00000000000000import * as foo from 'foo'; import foo__default from 'foo'; console.log( foo.bar ); console.log( foo__default ); rollup-2.61.1/test/form/samples/import-external-namespace-and-default/_expected/iife.js000066400000000000000000000014121415504077600311730ustar00rootroot00000000000000(function (foo) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? 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 foo__namespace = /*#__PURE__*/_interopNamespace(foo); var foo__default = /*#__PURE__*/_interopDefaultLegacy(foo); console.log( foo__namespace.bar ); console.log( foo__default["default"] ); })(foo); rollup-2.61.1/test/form/samples/import-external-namespace-and-default/_expected/system.js000066400000000000000000000004331415504077600316050ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/import-external-namespace-and-default/_expected/umd.js000066400000000000000000000020611415504077600310450ustar00rootroot00000000000000(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 _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? 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 foo__namespace = /*#__PURE__*/_interopNamespace(foo); var foo__default = /*#__PURE__*/_interopDefaultLegacy(foo); console.log( foo__namespace.bar ); console.log( foo__default["default"] ); })); rollup-2.61.1/test/form/samples/import-external-namespace-and-default/main.js000066400000000000000000000001011415504077600272350ustar00rootroot00000000000000import foo from 'foo'; import './other.js'; console.log( foo ); rollup-2.61.1/test/form/samples/import-external-namespace-and-default/other.js000066400000000000000000000000651415504077600274430ustar00rootroot00000000000000import * as foo from 'foo'; console.log( foo.bar ); rollup-2.61.1/test/form/samples/import-meta-resolve/000077500000000000000000000000001415504077600224305ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/import-meta-resolve/_config.js000066400000000000000000000001031415504077600243640ustar00rootroot00000000000000module.exports = { description: 'supports import.meta.resolve' }; rollup-2.61.1/test/form/samples/import-meta-resolve/_expected/000077500000000000000000000000001415504077600243705ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/import-meta-resolve/_expected/amd.js000066400000000000000000000001251415504077600254650ustar00rootroot00000000000000define(['module'], (function (module) { 'use strict'; undefined('./foo.js'); })); rollup-2.61.1/test/form/samples/import-meta-resolve/_expected/cjs.js000066400000000000000000000000461415504077600255050ustar00rootroot00000000000000'use strict'; undefined('./foo.js'); rollup-2.61.1/test/form/samples/import-meta-resolve/_expected/es.js000066400000000000000000000000411415504077600253300ustar00rootroot00000000000000import.meta.resolve('./foo.js'); rollup-2.61.1/test/form/samples/import-meta-resolve/_expected/iife.js000066400000000000000000000000761415504077600256450ustar00rootroot00000000000000(function () { 'use strict'; undefined('./foo.js'); })(); rollup-2.61.1/test/form/samples/import-meta-resolve/_expected/system.js000066400000000000000000000002311415504077600262460ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { module.meta.resolve('./foo.js'); }) }; })); rollup-2.61.1/test/form/samples/import-meta-resolve/_expected/umd.js000066400000000000000000000002411415504077600255100ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; undefined('./foo.js'); })); rollup-2.61.1/test/form/samples/import-meta-resolve/main.js000066400000000000000000000000411415504077600237050ustar00rootroot00000000000000import.meta.resolve('./foo.js'); rollup-2.61.1/test/form/samples/import-meta-url/000077500000000000000000000000001415504077600215535ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/import-meta-url/_config.js000066400000000000000000000000771415504077600235210ustar00rootroot00000000000000module.exports = { description: 'supports import.meta.url' }; rollup-2.61.1/test/form/samples/import-meta-url/_expected/000077500000000000000000000000001415504077600235135ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/import-meta-url/_expected/amd.js000066400000000000000000000003671415504077600246200ustar00rootroot00000000000000define(['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-2.61.1/test/form/samples/import-meta-url/_expected/cjs.js000066400000000000000000000005301415504077600246260ustar00rootroot00000000000000'use strict'; function log(url) { if (typeof document === 'undefined') { console.log(url); } else { document.body.innerText = url; } } log((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('cjs.js', document.baseURI).href))); rollup-2.61.1/test/form/samples/import-meta-url/_expected/es.js000066400000000000000000000002271415504077600244610ustar00rootroot00000000000000function log(url) { if (typeof document === 'undefined') { console.log(url); } else { document.body.innerText = url; } } log(import.meta.url); rollup-2.61.1/test/form/samples/import-meta-url/_expected/iife.js000066400000000000000000000004311415504077600247630ustar00rootroot00000000000000(function () { 'use strict'; function log(url) { if (typeof document === 'undefined') { console.log(url); } else { document.body.innerText = url; } } log((document.currentScript && document.currentScript.src || new URL('iife.js', document.baseURI).href)); })(); rollup-2.61.1/test/form/samples/import-meta-url/_expected/system.js000066400000000000000000000004441415504077600253770ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/import-meta-url/_expected/umd.js000066400000000000000000000010571415504077600246410ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function log(url) { if (typeof document === 'undefined') { console.log(url); } else { document.body.innerText = url; } } log((typeof document === 'undefined' && typeof location === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : typeof document === 'undefined' ? location.href : (document.currentScript && document.currentScript.src || new URL('umd.js', document.baseURI).href))); })); rollup-2.61.1/test/form/samples/import-meta-url/index-amd.html000066400000000000000000000003361415504077600243110ustar00rootroot00000000000000 AMD rollup-2.61.1/test/form/samples/import-meta-url/index-cjs.html000066400000000000000000000002511415504077600243230ustar00rootroot00000000000000 CommonJS rollup-2.61.1/test/form/samples/import-meta-url/index-es.html000066400000000000000000000002671415504077600241620ustar00rootroot00000000000000 ES Module rollup-2.61.1/test/form/samples/import-meta-url/index-iife.html000066400000000000000000000002461415504077600244640ustar00rootroot00000000000000 IIFE rollup-2.61.1/test/form/samples/import-meta-url/index-system.html000066400000000000000000000004011415504077600250650ustar00rootroot00000000000000 SystemJS rollup-2.61.1/test/form/samples/import-meta-url/index-umd-amd.html000066400000000000000000000003441415504077600250730ustar00rootroot00000000000000 UMD (AMD) rollup-2.61.1/test/form/samples/import-meta-url/index-umd-iife.html000066400000000000000000000002531415504077600252450ustar00rootroot00000000000000 UMD (IIFE) rollup-2.61.1/test/form/samples/import-meta-url/main.js000066400000000000000000000002271415504077600230360ustar00rootroot00000000000000function log(url) { if (typeof document === 'undefined') { console.log(url); } else { document.body.innerText = url; } } log(import.meta.url); rollup-2.61.1/test/form/samples/import-meta/000077500000000000000000000000001415504077600207535ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/import-meta/_config.js000066400000000000000000000001161415504077600227130ustar00rootroot00000000000000module.exports = { description: 'supports directly accessing import.meta' }; rollup-2.61.1/test/form/samples/import-meta/_expected/000077500000000000000000000000001415504077600227135ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/import-meta/_expected/amd.js000066400000000000000000000002021415504077600240040ustar00rootroot00000000000000define(['module'], (function (module) { 'use strict'; console.log(({ url: new URL(module.uri, document.baseURI).href })); })); rollup-2.61.1/test/form/samples/import-meta/_expected/cjs.js000066400000000000000000000003521415504077600240300ustar00rootroot00000000000000'use strict'; console.log(({ url: (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('cjs.js', document.baseURI).href)) })); rollup-2.61.1/test/form/samples/import-meta/_expected/es.js000066400000000000000000000000321415504077600236530ustar00rootroot00000000000000console.log(import.meta); rollup-2.61.1/test/form/samples/import-meta/_expected/iife.js000066400000000000000000000002441415504077600241650ustar00rootroot00000000000000(function () { 'use strict'; console.log(({ url: (document.currentScript && document.currentScript.src || new URL('iife.js', document.baseURI).href) })); })(); rollup-2.61.1/test/form/samples/import-meta/_expected/system.js000066400000000000000000000002221415504077600245710ustar00rootroot00000000000000System.register([], (function (exports, module) { 'use strict'; return { execute: (function () { console.log(module.meta); }) }; })); rollup-2.61.1/test/form/samples/import-meta/_expected/umd.js000066400000000000000000000006721415504077600240430ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log(({ url: (typeof document === 'undefined' && typeof location === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : typeof document === 'undefined' ? location.href : (document.currentScript && document.currentScript.src || new URL('umd.js', document.baseURI).href)) })); })); rollup-2.61.1/test/form/samples/import-meta/main.js000066400000000000000000000000321415504077600222300ustar00rootroot00000000000000console.log(import.meta); rollup-2.61.1/test/form/samples/import-named-exported-global-with-alias/000077500000000000000000000000001415504077600262375ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/import-named-exported-global-with-alias/_config.js000066400000000000000000000004401415504077600301770ustar00rootroot00000000000000// Changed due to https://github.com/acornjs/acorn/issues/806 // Consider reverting this change should this become an acorn option module.exports = { description: 'allow globals to be exported and imported', expectedWarnings: ['EMPTY_BUNDLE'], options: { output: { name: 'doc' } } }; rollup-2.61.1/test/form/samples/import-named-exported-global-with-alias/_expected.js000066400000000000000000000000011415504077600305240ustar00rootroot00000000000000 rollup-2.61.1/test/form/samples/import-named-exported-global-with-alias/browser.js000066400000000000000000000001151415504077600302550ustar00rootroot00000000000000const localDocument = window.document; export { localDocument as document }; rollup-2.61.1/test/form/samples/import-named-exported-global-with-alias/main.js000066400000000000000000000000731415504077600275210ustar00rootroot00000000000000import { document } from './browser.js'; var d = document; rollup-2.61.1/test/form/samples/import-namespace-systemjs/000077500000000000000000000000001415504077600236405ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/import-namespace-systemjs/_config.js000066400000000000000000000002301415504077600255750ustar00rootroot00000000000000module.exports = { description: 'imports namespace (systemjs only)', options: { external: ['dependency'], output: { format: 'system' } } }; rollup-2.61.1/test/form/samples/import-namespace-systemjs/_expected.js000066400000000000000000000003351415504077600261370ustar00rootroot00000000000000System.register(['dependency'], (function () { 'use strict'; var dependency; return { setters: [function (module) { dependency = module; }], execute: (function () { console.log(dependency); }) }; })); rollup-2.61.1/test/form/samples/import-namespace-systemjs/main.js000066400000000000000000000001021415504077600251130ustar00rootroot00000000000000import * as dependency from 'dependency'; console.log(dependency);rollup-2.61.1/test/form/samples/import-namespace/000077500000000000000000000000001415504077600217615ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/import-namespace/_config.js000066400000000000000000000002451415504077600237240ustar00rootroot00000000000000module.exports = { description: 'imports external namespaces', options: { external: ['foo', 'bar'], output: { globals: { foo: 'foo', bar: 'bar' } } } }; rollup-2.61.1/test/form/samples/import-namespace/_expected/000077500000000000000000000000001415504077600237215ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/import-namespace/_expected/amd.js000066400000000000000000000012171415504077600250210ustar00rootroot00000000000000define(['foo', 'bar'], (function (foo, bar) { 'use strict'; 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 foo__namespace = /*#__PURE__*/_interopNamespace(foo); var bar__namespace = /*#__PURE__*/_interopNamespace(bar); foo__namespace.x(); console.log(bar__namespace); })); rollup-2.61.1/test/form/samples/import-namespace/_expected/cjs.js000066400000000000000000000011731415504077600250400ustar00rootroot00000000000000'use strict'; var foo = require('foo'); var bar = require('bar'); 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 foo__namespace = /*#__PURE__*/_interopNamespace(foo); var bar__namespace = /*#__PURE__*/_interopNamespace(bar); foo__namespace.x(); console.log(bar__namespace); rollup-2.61.1/test/form/samples/import-namespace/_expected/es.js000066400000000000000000000001241415504077600246630ustar00rootroot00000000000000import * as foo from 'foo'; import * as bar from 'bar'; foo.x(); console.log(bar); rollup-2.61.1/test/form/samples/import-namespace/_expected/iife.js000066400000000000000000000012021415504077600251660ustar00rootroot00000000000000(function (foo, bar) { 'use strict'; 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 foo__namespace = /*#__PURE__*/_interopNamespace(foo); var bar__namespace = /*#__PURE__*/_interopNamespace(bar); foo__namespace.x(); console.log(bar__namespace); })(foo, bar); rollup-2.61.1/test/form/samples/import-namespace/_expected/system.js000066400000000000000000000004031415504077600256000ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/import-namespace/_expected/umd.js000066400000000000000000000017071415504077600250510ustar00rootroot00000000000000(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 _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 foo__namespace = /*#__PURE__*/_interopNamespace(foo); var bar__namespace = /*#__PURE__*/_interopNamespace(bar); foo__namespace.x(); console.log(bar__namespace); })); rollup-2.61.1/test/form/samples/import-namespace/main.js000066400000000000000000000001231415504077600232370ustar00rootroot00000000000000import * as foo from 'foo'; import * as bar from 'bar'; foo.x(); console.log(bar);rollup-2.61.1/test/form/samples/import-specifier-deshadowing/000077500000000000000000000000001415504077600242705ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/import-specifier-deshadowing/_config.js000066400000000000000000000003071415504077600262320ustar00rootroot00000000000000module.exports = { description: 'deshadows aliased import bindings', options: { external: ['react-sticky'], output: { globals: { 'react-sticky': 'reactSticky' }, name: 'Sticky' } } }; rollup-2.61.1/test/form/samples/import-specifier-deshadowing/_expected/000077500000000000000000000000001415504077600262305ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/import-specifier-deshadowing/_expected/amd.js000066400000000000000000000003101415504077600273210ustar00rootroot00000000000000define(['react-sticky'], (function (reactSticky) { 'use strict'; var Sticky = function () { function Sticky() {} Sticky.foo = reactSticky.Sticky; return Sticky; }(); return Sticky; })); rollup-2.61.1/test/form/samples/import-specifier-deshadowing/_expected/cjs.js000066400000000000000000000002771415504077600273530ustar00rootroot00000000000000'use strict'; var reactSticky = require('react-sticky'); var Sticky = function () { function Sticky() {} Sticky.foo = reactSticky.Sticky; return Sticky; }(); module.exports = Sticky; rollup-2.61.1/test/form/samples/import-specifier-deshadowing/_expected/es.js000066400000000000000000000002631415504077600271760ustar00rootroot00000000000000import { Sticky as Sticky$1 } from 'react-sticky'; var Sticky = function () { function Sticky() {} Sticky.foo = Sticky$1; return Sticky; }(); export { Sticky as default }; rollup-2.61.1/test/form/samples/import-specifier-deshadowing/_expected/iife.js000066400000000000000000000003111415504077600274750ustar00rootroot00000000000000var Sticky = (function (reactSticky) { 'use strict'; var Sticky = function () { function Sticky() {} Sticky.foo = reactSticky.Sticky; return Sticky; }(); return Sticky; })(reactSticky); rollup-2.61.1/test/form/samples/import-specifier-deshadowing/_expected/system.js000066400000000000000000000005321415504077600301120ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/import-specifier-deshadowing/_expected/umd.js000066400000000000000000000010261415504077600273520ustar00rootroot00000000000000(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-2.61.1/test/form/samples/import-specifier-deshadowing/main.js000066400000000000000000000002701415504077600255510ustar00rootroot00000000000000import { Sticky as ReactSticky } from 'react-sticky'; var Sticky = function () { function Sticky() {} Sticky.foo = ReactSticky; return Sticky; }(); export { Sticky as default };rollup-2.61.1/test/form/samples/include-recursive-call-arguments/000077500000000000000000000000001415504077600250615ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/include-recursive-call-arguments/_config.js000066400000000000000000000001051415504077600270170ustar00rootroot00000000000000module.exports = { description: 'handles recursive declarations' }; rollup-2.61.1/test/form/samples/include-recursive-call-arguments/_expected.js000066400000000000000000000001541415504077600273570ustar00rootroot00000000000000var isFinite = isFinite; function test(value) { return isFinite(value.length); } console.log(test('X')); rollup-2.61.1/test/form/samples/include-recursive-call-arguments/main.js000066400000000000000000000001541415504077600263430ustar00rootroot00000000000000var isFinite = isFinite; function test(value) { return isFinite(value.length); } console.log(test('X')); rollup-2.61.1/test/form/samples/includes-all-namespace-declarations/000077500000000000000000000000001415504077600254715ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/includes-all-namespace-declarations/_config.js000066400000000000000000000002061415504077600274310ustar00rootroot00000000000000module.exports = { description: 'includes all declarations referenced by reified namespaces', expectedWarnings: ['EMPTY_BUNDLE'] }; rollup-2.61.1/test/form/samples/includes-all-namespace-declarations/_expected/000077500000000000000000000000001415504077600274315ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/includes-all-namespace-declarations/_expected/amd.js000066400000000000000000000000541415504077600305270ustar00rootroot00000000000000define((function () { 'use strict'; })); rollup-2.61.1/test/form/samples/includes-all-namespace-declarations/_expected/cjs.js000066400000000000000000000000171415504077600305440ustar00rootroot00000000000000'use strict'; rollup-2.61.1/test/form/samples/includes-all-namespace-declarations/_expected/es.js000066400000000000000000000000011415504077600303650ustar00rootroot00000000000000 rollup-2.61.1/test/form/samples/includes-all-namespace-declarations/_expected/iife.js000066400000000000000000000000471415504077600307040ustar00rootroot00000000000000(function () { 'use strict'; })(); rollup-2.61.1/test/form/samples/includes-all-namespace-declarations/_expected/system.js000066400000000000000000000001471415504077600313150ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { }) }; })); rollup-2.61.1/test/form/samples/includes-all-namespace-declarations/_expected/umd.js000066400000000000000000000002121415504077600305470ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; })); rollup-2.61.1/test/form/samples/includes-all-namespace-declarations/indirection.js000066400000000000000000000001501415504077600303320ustar00rootroot00000000000000import * as unused from './unused.js'; var indirection = { unused: unused }; export { indirection }; rollup-2.61.1/test/form/samples/includes-all-namespace-declarations/main.js000066400000000000000000000000601415504077600267470ustar00rootroot00000000000000import { indirection } from './indirection.js'; rollup-2.61.1/test/form/samples/includes-all-namespace-declarations/unused.js000066400000000000000000000000441415504077600273300ustar00rootroot00000000000000function foo () {} export { foo }; rollup-2.61.1/test/form/samples/indent-false/000077500000000000000000000000001415504077600210665ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/indent-false/_config.js000066400000000000000000000002121415504077600230230ustar00rootroot00000000000000module.exports = { description: 'does not indent with indent: false', options: { output: { name: 'foo', indent: false } } }; rollup-2.61.1/test/form/samples/indent-false/_expected/000077500000000000000000000000001415504077600230265ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/indent-false/_expected/amd.js000066400000000000000000000001541415504077600241250ustar00rootroot00000000000000define((function () { 'use strict'; function foo () { console.log( 'not indented' ); } return foo; })); rollup-2.61.1/test/form/samples/indent-false/_expected/cjs.js000066400000000000000000000001321415504077600241370ustar00rootroot00000000000000'use strict'; function foo () { console.log( 'not indented' ); } module.exports = foo; rollup-2.61.1/test/form/samples/indent-false/_expected/es.js000066400000000000000000000001201415504077600237640ustar00rootroot00000000000000function foo () { console.log( 'not indented' ); } export { foo as default }; rollup-2.61.1/test/form/samples/indent-false/_expected/iife.js000066400000000000000000000001601415504077600242750ustar00rootroot00000000000000var foo = (function () { 'use strict'; function foo () { console.log( 'not indented' ); } return foo; })(); rollup-2.61.1/test/form/samples/indent-false/_expected/system.js000066400000000000000000000002731415504077600247120ustar00rootroot00000000000000System.register('foo', [], (function (exports) { 'use strict'; return { execute: (function () { exports('default', foo); function foo () { console.log( 'not indented' ); } }) }; })); rollup-2.61.1/test/form/samples/indent-false/_expected/umd.js000066400000000000000000000006131415504077600241510ustar00rootroot00000000000000(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-2.61.1/test/form/samples/indent-false/main.js000066400000000000000000000001031415504077600223420ustar00rootroot00000000000000export default function foo () { console.log( 'not indented' ); } rollup-2.61.1/test/form/samples/indent-spaces/000077500000000000000000000000001415504077600212525ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/indent-spaces/_config.js000066400000000000000000000002051415504077600232110ustar00rootroot00000000000000module.exports = { description: 'auto-indents with indent: true', options: { output: { name: 'foo', indent: ' ' } } }; rollup-2.61.1/test/form/samples/indent-spaces/_expected/000077500000000000000000000000001415504077600232125ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/indent-spaces/_expected/amd.js000066400000000000000000000001721415504077600243110ustar00rootroot00000000000000define((function () { 'use strict'; function foo () { console.log( 'indented with tabs' ); } return foo; })); rollup-2.61.1/test/form/samples/indent-spaces/_expected/cjs.js000066400000000000000000000001401415504077600243220ustar00rootroot00000000000000'use strict'; function foo () { console.log( 'indented with tabs' ); } module.exports = foo; rollup-2.61.1/test/form/samples/indent-spaces/_expected/es.js000066400000000000000000000001261415504077600241560ustar00rootroot00000000000000function foo () { console.log( 'indented with tabs' ); } export { foo as default }; rollup-2.61.1/test/form/samples/indent-spaces/_expected/iife.js000066400000000000000000000002001415504077600244540ustar00rootroot00000000000000var foo = (function () { 'use strict'; function foo () { console.log( 'indented with tabs' ); } return foo; })(); rollup-2.61.1/test/form/samples/indent-spaces/_expected/system.js000066400000000000000000000003471415504077600251000ustar00rootroot00000000000000System.register('foo', [], (function (exports) { 'use strict'; return { execute: (function () { exports('default', foo); function foo () { console.log( 'indented with tabs' ); } }) }; })); rollup-2.61.1/test/form/samples/indent-spaces/_expected/umd.js000066400000000000000000000006371415504077600243430ustar00rootroot00000000000000(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-2.61.1/test/form/samples/indent-spaces/main.js000066400000000000000000000001111415504077600225250ustar00rootroot00000000000000export default function foo () { console.log( 'indented with tabs' ); } rollup-2.61.1/test/form/samples/indent-true-spaces/000077500000000000000000000000001415504077600222275ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/indent-true-spaces/_config.js000066400000000000000000000002201415504077600241630ustar00rootroot00000000000000module.exports = { description: 'auto-indents with spaces and indent: true', options: { output: { name: 'foo', indent: true } } }; rollup-2.61.1/test/form/samples/indent-true-spaces/_expected/000077500000000000000000000000001415504077600241675ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/indent-true-spaces/_expected/amd.js000066400000000000000000000001751415504077600252710ustar00rootroot00000000000000define((function () { 'use strict'; function foo () { console.log( 'indented with spaces' ); } return foo; })); rollup-2.61.1/test/form/samples/indent-true-spaces/_expected/cjs.js000066400000000000000000000001431415504077600253020ustar00rootroot00000000000000'use strict'; function foo () { console.log( 'indented with spaces' ); } module.exports = foo; rollup-2.61.1/test/form/samples/indent-true-spaces/_expected/es.js000066400000000000000000000001311415504077600251270ustar00rootroot00000000000000function foo () { console.log( 'indented with spaces' ); } export { foo as default }; rollup-2.61.1/test/form/samples/indent-true-spaces/_expected/iife.js000066400000000000000000000002031415504077600254340ustar00rootroot00000000000000var foo = (function () { 'use strict'; function foo () { console.log( 'indented with spaces' ); } return foo; })(); rollup-2.61.1/test/form/samples/indent-true-spaces/_expected/system.js000066400000000000000000000003521415504077600260510ustar00rootroot00000000000000System.register('foo', [], (function (exports) { 'use strict'; return { execute: (function () { exports('default', foo); function foo () { console.log( 'indented with spaces' ); } }) }; })); rollup-2.61.1/test/form/samples/indent-true-spaces/_expected/umd.js000066400000000000000000000006421415504077600253140ustar00rootroot00000000000000(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-2.61.1/test/form/samples/indent-true-spaces/main.js000066400000000000000000000001141415504077600235050ustar00rootroot00000000000000export default function foo () { console.log( 'indented with spaces' ); } rollup-2.61.1/test/form/samples/indent-true/000077500000000000000000000000001415504077600207535ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/indent-true/_config.js000066400000000000000000000002051415504077600227120ustar00rootroot00000000000000module.exports = { description: 'auto-indents with indent: true', options: { output: { name: 'foo', indent: true } } }; rollup-2.61.1/test/form/samples/indent-true/_expected/000077500000000000000000000000001415504077600227135ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/indent-true/_expected/amd.js000066400000000000000000000001661415504077600240150ustar00rootroot00000000000000define((function () { 'use strict'; function foo () { console.log( 'indented with tabs' ); } return foo; })); rollup-2.61.1/test/form/samples/indent-true/_expected/cjs.js000066400000000000000000000001401415504077600240230ustar00rootroot00000000000000'use strict'; function foo () { console.log( 'indented with tabs' ); } module.exports = foo; rollup-2.61.1/test/form/samples/indent-true/_expected/es.js000066400000000000000000000001261415504077600236570ustar00rootroot00000000000000function foo () { console.log( 'indented with tabs' ); } export { foo as default }; rollup-2.61.1/test/form/samples/indent-true/_expected/iife.js000066400000000000000000000001731415504077600241660ustar00rootroot00000000000000var foo = (function () { 'use strict'; function foo () { console.log( 'indented with tabs' ); } return foo; })(); rollup-2.61.1/test/form/samples/indent-true/_expected/system.js000066400000000000000000000003241415504077600245740ustar00rootroot00000000000000System.register('foo', [], (function (exports) { 'use strict'; return { execute: (function () { exports('default', foo); function foo () { console.log( 'indented with tabs' ); } }) }; })); rollup-2.61.1/test/form/samples/indent-true/_expected/umd.js000066400000000000000000000006301415504077600240350ustar00rootroot00000000000000(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-2.61.1/test/form/samples/indent-true/main.js000066400000000000000000000001111415504077600222260ustar00rootroot00000000000000export default function foo () { console.log( 'indented with tabs' ); } rollup-2.61.1/test/form/samples/inlined-treeshaken-dynamic-import/000077500000000000000000000000001415504077600252205ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/inlined-treeshaken-dynamic-import/_config.js000066400000000000000000000002171415504077600271620ustar00rootroot00000000000000module.exports = { description: 'completely removes tree-shaken dynamic imports ', options: { output: { inlineDynamicImports: true } } }; rollup-2.61.1/test/form/samples/inlined-treeshaken-dynamic-import/_expected/000077500000000000000000000000001415504077600271605ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/inlined-treeshaken-dynamic-import/_expected/amd.js000066400000000000000000000001011415504077600302470ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main'); })); rollup-2.61.1/test/form/samples/inlined-treeshaken-dynamic-import/_expected/cjs.js000066400000000000000000000000441415504077600302730ustar00rootroot00000000000000'use strict'; console.log('main'); rollup-2.61.1/test/form/samples/inlined-treeshaken-dynamic-import/_expected/es.js000066400000000000000000000000251415504077600301220ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/form/samples/inlined-treeshaken-dynamic-import/_expected/iife.js000066400000000000000000000000741415504077600304330ustar00rootroot00000000000000(function () { 'use strict'; console.log('main'); })(); rollup-2.61.1/test/form/samples/inlined-treeshaken-dynamic-import/_expected/system.js000066400000000000000000000001761415504077600310460ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-2.61.1/test/form/samples/inlined-treeshaken-dynamic-import/_expected/umd.js000066400000000000000000000002371415504077600303050ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log('main'); })); rollup-2.61.1/test/form/samples/inlined-treeshaken-dynamic-import/dynamic.js000066400000000000000000000000611415504077600271770ustar00rootroot00000000000000console.log('dynamic'); export var dynamic = 42; rollup-2.61.1/test/form/samples/inlined-treeshaken-dynamic-import/main.js000066400000000000000000000001021415504077600264730ustar00rootroot00000000000000console.log('main'); const getFoo = () => import('./dynamic.js'); rollup-2.61.1/test/form/samples/internal-conflict-resolution/000077500000000000000000000000001415504077600243315ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/internal-conflict-resolution/_config.js000066400000000000000000000001221415504077600262660ustar00rootroot00000000000000module.exports = { description: 'internal name conflicts are resolved sanely' }; rollup-2.61.1/test/form/samples/internal-conflict-resolution/_expected/000077500000000000000000000000001415504077600262715ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/internal-conflict-resolution/_expected/amd.js000066400000000000000000000002251415504077600273670ustar00rootroot00000000000000define((function () { 'use strict'; var bar$1 = 42; function foo () { return bar$1; } function bar () { alert( foo() ); } bar(); })); rollup-2.61.1/test/form/samples/internal-conflict-resolution/_expected/cjs.js000066400000000000000000000001611415504077600274040ustar00rootroot00000000000000'use strict'; var bar$1 = 42; function foo () { return bar$1; } function bar () { alert( foo() ); } bar(); rollup-2.61.1/test/form/samples/internal-conflict-resolution/_expected/es.js000066400000000000000000000001421415504077600272330ustar00rootroot00000000000000var bar$1 = 42; function foo () { return bar$1; } function bar () { alert( foo() ); } bar(); rollup-2.61.1/test/form/samples/internal-conflict-resolution/_expected/iife.js000066400000000000000000000002201415504077600275350ustar00rootroot00000000000000(function () { 'use strict'; var bar$1 = 42; function foo () { return bar$1; } function bar () { alert( foo() ); } bar(); })(); rollup-2.61.1/test/form/samples/internal-conflict-resolution/_expected/system.js000066400000000000000000000003401415504077600301500ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var bar$1 = 42; function foo () { return bar$1; } function bar () { alert( foo() ); } bar(); }) }; })); rollup-2.61.1/test/form/samples/internal-conflict-resolution/_expected/umd.js000066400000000000000000000003631415504077600274160ustar00rootroot00000000000000(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-2.61.1/test/form/samples/internal-conflict-resolution/bar.js000066400000000000000000000000421415504077600254270ustar00rootroot00000000000000var bar = 42; export default bar; rollup-2.61.1/test/form/samples/internal-conflict-resolution/foo.js000066400000000000000000000001201415504077600254430ustar00rootroot00000000000000import bar from './bar'; function foo () { return bar; } export default foo; rollup-2.61.1/test/form/samples/internal-conflict-resolution/main.js000066400000000000000000000001071415504077600256110ustar00rootroot00000000000000import foo from './foo'; function bar () { alert( foo() ); } bar(); rollup-2.61.1/test/form/samples/interop-per-dependency-no-freeze/000077500000000000000000000000001415504077600247655ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/interop-per-dependency-no-freeze/_config.js000066400000000000000000000004121415504077600267240ustar00rootroot00000000000000module.exports = { description: 'respects the freeze option', options: { external: id => id.startsWith('external'), output: { freeze: false, interop(id) { return id.split('-')[1]; }, globals(id) { return id.replace('-', ''); } } } }; rollup-2.61.1/test/form/samples/interop-per-dependency-no-freeze/_expected/000077500000000000000000000000001415504077600267255ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/interop-per-dependency-no-freeze/_expected/amd.js000066400000000000000000000035701415504077600300310ustar00rootroot00000000000000define(['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-2.61.1/test/form/samples/interop-per-dependency-no-freeze/_expected/cjs.js000066400000000000000000000033451415504077600300470ustar00rootroot00000000000000'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-2.61.1/test/form/samples/interop-per-dependency-no-freeze/_expected/es.js000066400000000000000000000015401415504077600276720ustar00rootroot00000000000000import * 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-2.61.1/test/form/samples/interop-per-dependency-no-freeze/_expected/iife.js000066400000000000000000000026321415504077600302020ustar00rootroot00000000000000(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-2.61.1/test/form/samples/interop-per-dependency-no-freeze/_expected/system.js000066400000000000000000000024531415504077600306130ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/interop-per-dependency-no-freeze/_expected/umd.js000066400000000000000000000036071415504077600300560ustar00rootroot00000000000000(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-2.61.1/test/form/samples/interop-per-dependency-no-freeze/main.js000066400000000000000000000015001415504077600262430ustar00rootroot00000000000000import 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-2.61.1/test/form/samples/interop-per-dependency-no-live-binding/000077500000000000000000000000001415504077600260545ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/interop-per-dependency-no-live-binding/_config.js000066400000000000000000000006701415504077600300210ustar00rootroot00000000000000const checkedIds = new Set(); module.exports = { description: 'allows to configure the interop type per external dependency', options: { external: id => id.startsWith('external'), output: { externalLiveBindings: false, 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' } } }; rollup-2.61.1/test/form/samples/interop-per-dependency-no-live-binding/_expected.js000066400000000000000000000032701415504077600303540ustar00rootroot00000000000000'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-2.61.1/test/form/samples/interop-per-dependency-no-live-binding/main.js000066400000000000000000000015001415504077600273320ustar00rootroot00000000000000import 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-2.61.1/test/form/samples/interop-per-dependency/000077500000000000000000000000001415504077600230755ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/interop-per-dependency/_config.js000066400000000000000000000005131415504077600250360ustar00rootroot00000000000000module.exports = { description: 'allows to configure the interop type per external dependency', options: { external: id => id.startsWith('external'), output: { interop(id) { if (id === null) { return 'auto'; } return id.split('-')[1]; }, globals(id) { return id.replace('-', ''); } } } }; rollup-2.61.1/test/form/samples/interop-per-dependency/_expected/000077500000000000000000000000001415504077600250355ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/interop-per-dependency/_expected/amd.js000066400000000000000000000044401415504077600261360ustar00rootroot00000000000000define(['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-2.61.1/test/form/samples/interop-per-dependency/_expected/cjs.js000066400000000000000000000041011415504077600261460ustar00rootroot00000000000000'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-2.61.1/test/form/samples/interop-per-dependency/_expected/es.js000066400000000000000000000017001415504077600260000ustar00rootroot00000000000000import * 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-2.61.1/test/form/samples/interop-per-dependency/_expected/iife.js000066400000000000000000000030321415504077600263050ustar00rootroot00000000000000(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-2.61.1/test/form/samples/interop-per-dependency/_expected/system.js000066400000000000000000000026371415504077600267270ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/interop-per-dependency/_expected/umd.js000066400000000000000000000040071415504077600261610ustar00rootroot00000000000000(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-2.61.1/test/form/samples/interop-per-dependency/main.js000066400000000000000000000016401415504077600243600ustar00rootroot00000000000000import 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-2.61.1/test/form/samples/interop-per-reexported-dependency/000077500000000000000000000000001415504077600252545ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/interop-per-reexported-dependency/_config.js000066400000000000000000000004701415504077600272170ustar00rootroot00000000000000module.exports = { description: 'allows to configure the interop type per reexported external dependency', options: { external: id => id.startsWith('external'), output: { interop(id) { return id.split('-')[1]; }, globals(id) { return id.replace('-', ''); }, name: 'bundle' } } }; rollup-2.61.1/test/form/samples/interop-per-reexported-dependency/_expected/000077500000000000000000000000001415504077600272145ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/interop-per-reexported-dependency/_expected/amd.js000066400000000000000000000034451415504077600303210ustar00rootroot00000000000000define(['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"]; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/interop-per-reexported-dependency/_expected/cjs.js000066400000000000000000000034011415504077600303270ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/form/samples/interop-per-reexported-dependency/_expected/es.js000066400000000000000000000007731415504077600301700ustar00rootroot00000000000000import * 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-2.61.1/test/form/samples/interop-per-reexported-dependency/_expected/iife.js000066400000000000000000000034501415504077600304700ustar00rootroot00000000000000var 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"]; } }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, externalauto, externaldefault, externaldefaultOnly, externalesModule); rollup-2.61.1/test/form/samples/interop-per-reexported-dependency/_expected/system.js000066400000000000000000000012271415504077600311000ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/interop-per-reexported-dependency/_expected/umd.js000066400000000000000000000044321415504077600303420ustar00rootroot00000000000000(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"]; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/interop-per-reexported-dependency/main.js000066400000000000000000000006511415504077600265400ustar00rootroot00000000000000export { 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-2.61.1/test/form/samples/intro-and-outro/000077500000000000000000000000001415504077600215565ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/intro-and-outro/_config.js000066400000000000000000000012211415504077600235140ustar00rootroot00000000000000module.exports = { 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: [ { intro() { return '// intro 1'; }, outro() { return '// outro 1'; } }, { intro() { return '// intro 2'; }, outro() { return Promise.resolve('// outro 2'); } }, { intro() { return Promise.resolve('// intro 3'); }, outro() { return '// outro 3'; } }, { intro: '// intro 4', outro: '// outro 4' } ] } }; rollup-2.61.1/test/form/samples/intro-and-outro/_expected/000077500000000000000000000000001415504077600235165ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/intro-and-outro/_expected/amd.js000066400000000000000000000007371415504077600246240ustar00rootroot00000000000000define(['external'], (function (a) { 'use strict'; /* this is an intro */ // intro 1 // intro 2 // intro 3 // intro 4 function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var a__default = /*#__PURE__*/_interopDefaultLegacy(a); console.log( a__default["default"] ); console.log( a.b ); var main = 42; return main; /* this is an outro */ // outro 1 // outro 2 // outro 3 // outro 4 })); rollup-2.61.1/test/form/samples/intro-and-outro/_expected/cjs.js000066400000000000000000000007141415504077600246350ustar00rootroot00000000000000'use strict'; /* this is an intro */ // intro 1 // intro 2 // intro 3 // intro 4 var a = require('external'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var a__default = /*#__PURE__*/_interopDefaultLegacy(a); console.log( a__default["default"] ); console.log( a.b ); var main = 42; module.exports = main; /* this is an outro */ // outro 1 // outro 2 // outro 3 // outro 4 rollup-2.61.1/test/form/samples/intro-and-outro/_expected/es.js000066400000000000000000000004031415504077600244600ustar00rootroot00000000000000/* 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-2.61.1/test/form/samples/intro-and-outro/_expected/iife.js000066400000000000000000000007271415504077600247760ustar00rootroot00000000000000var foo = (function (a) { 'use strict'; /* this is an intro */ // intro 1 // intro 2 // intro 3 // intro 4 function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var a__default = /*#__PURE__*/_interopDefaultLegacy(a); console.log( a__default["default"] ); console.log( a.b ); var main = 42; return main; /* this is an outro */ // outro 1 // outro 2 // outro 3 // outro 4 })(a); rollup-2.61.1/test/form/samples/intro-and-outro/_expected/system.js000066400000000000000000000007311415504077600254010ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/intro-and-outro/_expected/umd.js000066400000000000000000000014341415504077600246430ustar00rootroot00000000000000(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 function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var a__default = /*#__PURE__*/_interopDefaultLegacy(a); console.log( a__default["default"] ); console.log( a.b ); var main = 42; return main; /* this is an outro */ // outro 1 // outro 2 // outro 3 // outro 4 })); rollup-2.61.1/test/form/samples/intro-and-outro/main.js000066400000000000000000000001311415504077600230330ustar00rootroot00000000000000import a, { b } from 'external' console.log( a ); console.log( b ); export default 42; rollup-2.61.1/test/form/samples/invalid-binary-expressions/000077500000000000000000000000001415504077600240055ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/invalid-binary-expressions/_config.js000066400000000000000000000002021415504077600257410ustar00rootroot00000000000000module.exports = { description: 'Does not fail when bundling code where the `in`-operator is used with invalid right sides' }; rollup-2.61.1/test/form/samples/invalid-binary-expressions/_expected.js000066400000000000000000000011051415504077600263000ustar00rootroot00000000000000if ('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-2.61.1/test/form/samples/invalid-binary-expressions/main.js000066400000000000000000000011051415504077600252640ustar00rootroot00000000000000if ('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-2.61.1/test/form/samples/json-parse-is-not-pure/000077500000000000000000000000001415504077600227565ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/json-parse-is-not-pure/_config.js000066400000000000000000000002211415504077600247130ustar00rootroot00000000000000module.exports = { description: 'JSON.parse is not pure as it can throw on invalid json strings', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/json-parse-is-not-pure/_expected/000077500000000000000000000000001415504077600247165ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/json-parse-is-not-pure/_expected/amd.js000066400000000000000000000002521415504077600260140ustar00rootroot00000000000000define((function () { 'use strict'; var main = (input) => { try { JSON.parse(input); return true; } catch (e) { return false; } }; return main; })); rollup-2.61.1/test/form/samples/json-parse-is-not-pure/_expected/cjs.js000066400000000000000000000002171415504077600260330ustar00rootroot00000000000000'use strict'; var main = (input) => { try { JSON.parse(input); return true; } catch (e) { return false; } }; module.exports = main; rollup-2.61.1/test/form/samples/json-parse-is-not-pure/_expected/es.js000066400000000000000000000002051415504077600256600ustar00rootroot00000000000000var main = (input) => { try { JSON.parse(input); return true; } catch (e) { return false; } }; export { main as default }; rollup-2.61.1/test/form/samples/json-parse-is-not-pure/_expected/iife.js000066400000000000000000000002641415504077600261720ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var main = (input) => { try { JSON.parse(input); return true; } catch (e) { return false; } }; return main; })(); rollup-2.61.1/test/form/samples/json-parse-is-not-pure/_expected/system.js000066400000000000000000000004151415504077600266000ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/json-parse-is-not-pure/_expected/umd.js000066400000000000000000000007211415504077600260410ustar00rootroot00000000000000(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-2.61.1/test/form/samples/json-parse-is-not-pure/main.js000066400000000000000000000001541415504077600242400ustar00rootroot00000000000000export default (input) => { try { JSON.parse(input); return true; } catch (e) { return false; } }; rollup-2.61.1/test/form/samples/json-stringify-is-not-pure/000077500000000000000000000000001415504077600236625ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/json-stringify-is-not-pure/_config.js000066400000000000000000000002241415504077600256220ustar00rootroot00000000000000module.exports = { description: 'JSON.stringify is not pure as it can throw on circular structures', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/json-stringify-is-not-pure/_expected/000077500000000000000000000000001415504077600256225ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/json-stringify-is-not-pure/_expected/amd.js000066400000000000000000000002561415504077600267240ustar00rootroot00000000000000define((function () { 'use strict'; var main = (input) => { try { JSON.stringify(input); return true; } catch (e) { return false; } }; return main; })); rollup-2.61.1/test/form/samples/json-stringify-is-not-pure/_expected/cjs.js000066400000000000000000000002231415504077600267340ustar00rootroot00000000000000'use strict'; var main = (input) => { try { JSON.stringify(input); return true; } catch (e) { return false; } }; module.exports = main; rollup-2.61.1/test/form/samples/json-stringify-is-not-pure/_expected/es.js000066400000000000000000000002111415504077600265610ustar00rootroot00000000000000var main = (input) => { try { JSON.stringify(input); return true; } catch (e) { return false; } }; export { main as default }; rollup-2.61.1/test/form/samples/json-stringify-is-not-pure/_expected/iife.js000066400000000000000000000002701415504077600270730ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var main = (input) => { try { JSON.stringify(input); return true; } catch (e) { return false; } }; return main; })(); rollup-2.61.1/test/form/samples/json-stringify-is-not-pure/_expected/system.js000066400000000000000000000004211415504077600275010ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/json-stringify-is-not-pure/_expected/umd.js000066400000000000000000000007251415504077600267510ustar00rootroot00000000000000(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-2.61.1/test/form/samples/json-stringify-is-not-pure/main.js000066400000000000000000000001601415504077600251410ustar00rootroot00000000000000export default (input) => { try { JSON.stringify(input); return true; } catch (e) { return false; } }; rollup-2.61.1/test/form/samples/keep-property-access-side-effects/000077500000000000000000000000001415504077600251215ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/keep-property-access-side-effects/_config.js000066400000000000000000000003051415504077600270610ustar00rootroot00000000000000module.exports = { description: 'keep side-effects when accessing properties if treeshake.propertyReadSideEffects is true', options: { treeshake: { propertyReadSideEffects: true } } }; rollup-2.61.1/test/form/samples/keep-property-access-side-effects/_expected.js000066400000000000000000000011231415504077600274140ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/keep-property-access-side-effects/main.js000066400000000000000000000012651415504077600264070ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/keep-tree-shaking-comments-no-asi/000077500000000000000000000000001415504077600250275ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/keep-tree-shaking-comments-no-asi/_config.js000066400000000000000000000002001415504077600267610ustar00rootroot00000000000000module.exports = { description: 'always keep leading comments when tree-shaking and no automatic semicolons are inserted' }; rollup-2.61.1/test/form/samples/keep-tree-shaking-comments-no-asi/_expected.js000066400000000000000000000002461415504077600273270ustar00rootroot00000000000000console.log(/* keep me */ 'expected'); console.log(/* keep me */ 'expected' ); console.log(/* keep me */ 'expected'); console.log((/* keep me */ 'expected')); rollup-2.61.1/test/form/samples/keep-tree-shaking-comments-no-asi/main.js000066400000000000000000000003461415504077600263140ustar00rootroot00000000000000console.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-2.61.1/test/form/samples/known-globals/000077500000000000000000000000001415504077600212725ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/known-globals/_config.js000066400000000000000000000001601415504077600232310ustar00rootroot00000000000000module.exports = { description: 'does not consider it a side-effect if a known global variable is accessed' }; rollup-2.61.1/test/form/samples/known-globals/_expected.js000066400000000000000000000000251415504077600235650ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/form/samples/known-globals/main.js000066400000000000000000000002131415504077600225500ustar00rootroot00000000000000console.log('main'); const a = setTimeout; const b = globalThis.setTimeout; const c = Math.max(1, 2); const d = globalThis.Math.max(1, 2); rollup-2.61.1/test/form/samples/labeled-break-statements/000077500000000000000000000000001415504077600233545ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/labeled-break-statements/_config.js000066400000000000000000000001271415504077600253160ustar00rootroot00000000000000module.exports = { description: 'keep break statements if their label is included' }; rollup-2.61.1/test/form/samples/labeled-break-statements/_expected.js000066400000000000000000000005521415504077600256540ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/labeled-break-statements/main.js000066400000000000000000000010201415504077600246270ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/labeled-continue-statements/000077500000000000000000000000001415504077600241145ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/labeled-continue-statements/_config.js000066400000000000000000000001321415504077600260520ustar00rootroot00000000000000module.exports = { description: 'keep continue statements if their label is included' }; rollup-2.61.1/test/form/samples/labeled-continue-statements/_expected.js000066400000000000000000000003771415504077600264210ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/labeled-continue-statements/main.js000066400000000000000000000005261415504077600254010ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/large-var-cnt-deduping/000077500000000000000000000000001415504077600227545ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/large-var-cnt-deduping/1.js000066400000000000000000000000551415504077600234520ustar00rootroot00000000000000var x = "a"; export var result = `1 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/10.js000066400000000000000000000000561415504077600235330ustar00rootroot00000000000000var x = "j"; export var result = `10 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/11.js000066400000000000000000000000561415504077600235340ustar00rootroot00000000000000var x = "k"; export var result = `11 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/12.js000066400000000000000000000000561415504077600235350ustar00rootroot00000000000000var x = "l"; export var result = `12 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/13.js000066400000000000000000000000561415504077600235360ustar00rootroot00000000000000var x = "m"; export var result = `13 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/14.js000066400000000000000000000000561415504077600235370ustar00rootroot00000000000000var x = "n"; export var result = `14 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/15.js000066400000000000000000000000561415504077600235400ustar00rootroot00000000000000var x = "o"; export var result = `15 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/16.js000066400000000000000000000000561415504077600235410ustar00rootroot00000000000000var x = "p"; export var result = `16 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/17.js000066400000000000000000000000561415504077600235420ustar00rootroot00000000000000var x = "q"; export var result = `17 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/18.js000066400000000000000000000000561415504077600235430ustar00rootroot00000000000000var x = "r"; export var result = `18 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/19.js000066400000000000000000000000561415504077600235440ustar00rootroot00000000000000var x = "s"; export var result = `19 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/2.js000066400000000000000000000000551415504077600234530ustar00rootroot00000000000000var x = "b"; export var result = `2 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/20.js000066400000000000000000000000561415504077600235340ustar00rootroot00000000000000var x = "t"; export var result = `20 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/21.js000066400000000000000000000000561415504077600235350ustar00rootroot00000000000000var x = "u"; export var result = `21 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/22.js000066400000000000000000000000561415504077600235360ustar00rootroot00000000000000var x = "v"; export var result = `22 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/23.js000066400000000000000000000000561415504077600235370ustar00rootroot00000000000000var x = "w"; export var result = `23 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/24.js000066400000000000000000000000561415504077600235400ustar00rootroot00000000000000var x = "x"; export var result = `24 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/25.js000066400000000000000000000000561415504077600235410ustar00rootroot00000000000000var x = "y"; export var result = `25 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/26.js000066400000000000000000000000561415504077600235420ustar00rootroot00000000000000var x = "z"; export var result = `26 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/27.js000066400000000000000000000000561415504077600235430ustar00rootroot00000000000000var x = "A"; export var result = `27 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/28.js000066400000000000000000000000561415504077600235440ustar00rootroot00000000000000var x = "B"; export var result = `28 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/29.js000066400000000000000000000000561415504077600235450ustar00rootroot00000000000000var x = "C"; export var result = `29 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/3.js000066400000000000000000000000551415504077600234540ustar00rootroot00000000000000var x = "c"; export var result = `3 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/30.js000066400000000000000000000000561415504077600235350ustar00rootroot00000000000000var x = "D"; export var result = `30 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/31.js000066400000000000000000000000561415504077600235360ustar00rootroot00000000000000var x = "E"; export var result = `31 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/32.js000066400000000000000000000000561415504077600235370ustar00rootroot00000000000000var x = "F"; export var result = `32 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/33.js000066400000000000000000000000561415504077600235400ustar00rootroot00000000000000var x = "G"; export var result = `33 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/34.js000066400000000000000000000000561415504077600235410ustar00rootroot00000000000000var x = "H"; export var result = `34 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/35.js000066400000000000000000000000561415504077600235420ustar00rootroot00000000000000var x = "I"; export var result = `35 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/36.js000066400000000000000000000000561415504077600235430ustar00rootroot00000000000000var x = "J"; export var result = `36 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/37.js000066400000000000000000000000561415504077600235440ustar00rootroot00000000000000var x = "K"; export var result = `37 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/38.js000066400000000000000000000000561415504077600235450ustar00rootroot00000000000000var x = "L"; export var result = `38 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/39.js000066400000000000000000000000561415504077600235460ustar00rootroot00000000000000var x = "M"; export var result = `39 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/4.js000066400000000000000000000000551415504077600234550ustar00rootroot00000000000000var x = "d"; export var result = `4 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/40.js000066400000000000000000000000561415504077600235360ustar00rootroot00000000000000var x = "N"; export var result = `40 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/41.js000066400000000000000000000000561415504077600235370ustar00rootroot00000000000000var x = "O"; export var result = `41 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/42.js000066400000000000000000000000561415504077600235400ustar00rootroot00000000000000var x = "P"; export var result = `42 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/43.js000066400000000000000000000000561415504077600235410ustar00rootroot00000000000000var x = "Q"; export var result = `43 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/44.js000066400000000000000000000000561415504077600235420ustar00rootroot00000000000000var x = "R"; export var result = `44 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/45.js000066400000000000000000000000561415504077600235430ustar00rootroot00000000000000var x = "S"; export var result = `45 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/46.js000066400000000000000000000000561415504077600235440ustar00rootroot00000000000000var x = "T"; export var result = `46 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/47.js000066400000000000000000000000561415504077600235450ustar00rootroot00000000000000var x = "U"; export var result = `47 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/48.js000066400000000000000000000000561415504077600235460ustar00rootroot00000000000000var x = "V"; export var result = `48 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/49.js000066400000000000000000000000561415504077600235470ustar00rootroot00000000000000var x = "W"; export var result = `49 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/5.js000066400000000000000000000000551415504077600234560ustar00rootroot00000000000000var x = "e"; export var result = `5 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/50.js000066400000000000000000000000561415504077600235370ustar00rootroot00000000000000var x = "X"; export var result = `50 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/51.js000066400000000000000000000000561415504077600235400ustar00rootroot00000000000000var x = "Y"; export var result = `51 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/52.js000066400000000000000000000000561415504077600235410ustar00rootroot00000000000000var x = "Z"; export var result = `52 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/53.js000066400000000000000000000000561415504077600235420ustar00rootroot00000000000000var x = "1"; export var result = `53 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/54.js000066400000000000000000000000561415504077600235430ustar00rootroot00000000000000var x = "2"; export var result = `54 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/55.js000066400000000000000000000000561415504077600235440ustar00rootroot00000000000000var x = "3"; export var result = `55 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/56.js000066400000000000000000000000561415504077600235450ustar00rootroot00000000000000var x = "4"; export var result = `56 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/57.js000066400000000000000000000000561415504077600235460ustar00rootroot00000000000000var x = "5"; export var result = `57 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/58.js000066400000000000000000000000561415504077600235470ustar00rootroot00000000000000var x = "6"; export var result = `58 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/59.js000066400000000000000000000000561415504077600235500ustar00rootroot00000000000000var x = "7"; export var result = `59 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/6.js000066400000000000000000000000551415504077600234570ustar00rootroot00000000000000var x = "f"; export var result = `6 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/60.js000066400000000000000000000000561415504077600235400ustar00rootroot00000000000000var x = "8"; export var result = `60 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/61.js000066400000000000000000000000561415504077600235410ustar00rootroot00000000000000var x = "9"; export var result = `61 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/62.js000066400000000000000000000000561415504077600235420ustar00rootroot00000000000000var x = "0"; export var result = `62 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/63.js000066400000000000000000000000561415504077600235430ustar00rootroot00000000000000var x = "_"; export var result = `63 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/64.js000066400000000000000000000000571415504077600235450ustar00rootroot00000000000000var x = "$"; export var result = `64 = ${x}`; rollup-2.61.1/test/form/samples/large-var-cnt-deduping/65.js000066400000000000000000000000571415504077600235460ustar00rootroot00000000000000var x = "0"; export var result = `65 = ${x}`; rollup-2.61.1/test/form/samples/large-var-cnt-deduping/7.js000066400000000000000000000000551415504077600234600ustar00rootroot00000000000000var x = "g"; export var result = `7 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/8.js000066400000000000000000000000551415504077600234610ustar00rootroot00000000000000var x = "h"; export var result = `8 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/9.js000066400000000000000000000000551415504077600234620ustar00rootroot00000000000000var x = "i"; export var result = `9 = ${x}`;rollup-2.61.1/test/form/samples/large-var-cnt-deduping/_config.js000066400000000000000000000001041415504077600247110ustar00rootroot00000000000000module.exports = { description: 'large variable count deduping' }; rollup-2.61.1/test/form/samples/large-var-cnt-deduping/_expected.js000066400000000000000000000072241415504077600252570ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/large-var-cnt-deduping/main.js000066400000000000000000000071061415504077600242420ustar00rootroot00000000000000import { 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-2.61.1/test/form/samples/lazy-assignment-deoptimization/000077500000000000000000000000001415504077600246775ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/lazy-assignment-deoptimization/_config.js000066400000000000000000000001521415504077600266370ustar00rootroot00000000000000module.exports = { description: 'only deoptimizes assigned variables when the assignment is included' }; rollup-2.61.1/test/form/samples/lazy-assignment-deoptimization/_expected.js000066400000000000000000000000631415504077600271740ustar00rootroot00000000000000console.log('retained'); console.log('retained'); rollup-2.61.1/test/form/samples/lazy-assignment-deoptimization/main.js000066400000000000000000000004301415504077600261560ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/literals-from-class-statics/000077500000000000000000000000001415504077600240505ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/literals-from-class-statics/_config.js000066400000000000000000000001231415504077600260060ustar00rootroot00000000000000module.exports = { description: 'tracks literal values in class static fields' }; rollup-2.61.1/test/form/samples/literals-from-class-statics/_expected.js000066400000000000000000000002261415504077600263460ustar00rootroot00000000000000log("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-2.61.1/test/form/samples/literals-from-class-statics/main.js000066400000000000000000000005121415504077600253300ustar00rootroot00000000000000class 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-2.61.1/test/form/samples/literals-from-return-expressions/000077500000000000000000000000001415504077600251725ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/literals-from-return-expressions/_config.js000066400000000000000000000001261415504077600271330ustar00rootroot00000000000000module.exports = { description: 'tracks literal values across return expressions' }; rollup-2.61.1/test/form/samples/literals-from-return-expressions/_expected.js000066400000000000000000000004211415504077600274650ustar00rootroot00000000000000function returnTrueWithEffect() { console.log('effect'); return true; } function returnFalseWithEffect() { console.log('effect'); return false; } { console.log('retained'); } if (returnTrueWithEffect()) { console.log('retained'); } if (returnFalseWithEffect()) ; rollup-2.61.1/test/form/samples/literals-from-return-expressions/main.js000066400000000000000000000007411415504077600264560ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/logical-expression/000077500000000000000000000000001415504077600223245ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/logical-expression/deopzimize-while-included/000077500000000000000000000000001415504077600273765ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/logical-expression/deopzimize-while-included/_config.js000066400000000000000000000001641415504077600313410ustar00rootroot00000000000000module.exports = { description: 'handles deoptimizations of logical expression while they are inlcuded (#3324)' }; rollup-2.61.1/test/form/samples/logical-expression/deopzimize-while-included/_expected.js000066400000000000000000000004521415504077600316750ustar00rootroot00000000000000let 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-2.61.1/test/form/samples/logical-expression/deopzimize-while-included/main.js000066400000000000000000000006401415504077600306600ustar00rootroot00000000000000let 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-2.61.1/test/form/samples/logical-expression/mutate-logical-expression/000077500000000000000000000000001415504077600274305ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/logical-expression/mutate-logical-expression/_config.js000066400000000000000000000002141415504077600313670ustar00rootroot00000000000000module.exports = { description: 'properly handle the results of mutating logical expressions', options: { output: { name: 'bundle' } } }; rollup-2.61.1/test/form/samples/logical-expression/mutate-logical-expression/_expected/000077500000000000000000000000001415504077600313705ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/logical-expression/mutate-logical-expression/_expected/amd.js000066400000000000000000000006101415504077600324640ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/logical-expression/mutate-logical-expression/_expected/cjs.js000066400000000000000000000005131415504077600325040ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/form/samples/logical-expression/mutate-logical-expression/_expected/es.js000066400000000000000000000003321415504077600323330ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/logical-expression/mutate-logical-expression/_expected/iife.js000066400000000000000000000006271415504077600326470ustar00rootroot00000000000000var 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; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/logical-expression/mutate-logical-expression/_expected/system.js000066400000000000000000000006011415504077600332470ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/logical-expression/mutate-logical-expression/_expected/umd.js000066400000000000000000000012451415504077600325150ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/logical-expression/mutate-logical-expression/main.js000066400000000000000000000006441415504077600307160ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/logical-expression/simplify-non-boolean/000077500000000000000000000000001415504077600263655ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/logical-expression/simplify-non-boolean/_config.js000066400000000000000000000001631415504077600303270ustar00rootroot00000000000000module.exports = { description: 'simplifies logical expressions that resolve statically to non-boolean values' }; rollup-2.61.1/test/form/samples/logical-expression/simplify-non-boolean/_expected.js000066400000000000000000000001371415504077600306640ustar00rootroot00000000000000console.log('keep' ); console.log('keep'); const x = 'keep'; console.log(x ); console.log(x); rollup-2.61.1/test/form/samples/logical-expression/simplify-non-boolean/main.js000066400000000000000000000002231415504077600276440ustar00rootroot00000000000000console.log('keep' || 'remove'); console.log('remove' && 'keep'); const x = 'keep'; const y = 'remove'; console.log(x || y); console.log(y && x); rollup-2.61.1/test/form/samples/make-absolute-externals-relative/000077500000000000000000000000001415504077600250625ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/make-absolute-externals-relative/make-relative-false/000077500000000000000000000000001415504077600307005ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/make-absolute-externals-relative/make-relative-false/_config.js000066400000000000000000000030511415504077600326410ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = { 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: { async buildStart() { 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-2.61.1/test/form/samples/make-absolute-externals-relative/make-relative-false/_expected.js000066400000000000000000000016451415504077600332040ustar00rootroot00000000000000import { 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-2.61.1/test/form/samples/make-absolute-externals-relative/make-relative-false/main.js000066400000000000000000000011531415504077600321620ustar00rootroot00000000000000import { 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-2.61.1/test/form/samples/make-absolute-externals-relative/make-relative-false/nested/000077500000000000000000000000001415504077600321625ustar00rootroot00000000000000nested.js000066400000000000000000000011251415504077600337220ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/form/samples/make-absolute-externals-relative/make-relative-relative/000077500000000000000000000000001415504077600314215ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/make-absolute-externals-relative/make-relative-relative/_config.js000066400000000000000000000035041415504077600333650ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = { 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: { async buildStart() { 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-2.61.1/test/form/samples/make-absolute-externals-relative/make-relative-relative/_expected.js000066400000000000000000000015701415504077600337220ustar00rootroot00000000000000import { 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-2.61.1/test/form/samples/make-absolute-externals-relative/make-relative-relative/main.js000066400000000000000000000013351415504077600327050ustar00rootroot00000000000000import { 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-2.61.1/test/form/samples/make-absolute-externals-relative/make-relative-relative/nested/000077500000000000000000000000001415504077600327035ustar00rootroot00000000000000nested.js000066400000000000000000000013111415504077600344400ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000000001415504077600352140ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/make-absolute-externals-relative/make-relative-relativerollup-2.61.1/test/form/samples/make-absolute-externals-relative/make-relative-true/000077500000000000000000000000001415504077600305655ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/make-absolute-externals-relative/make-relative-true/_config.js000066400000000000000000000036451415504077600325370ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = { 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: { async buildStart() { 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-2.61.1/test/form/samples/make-absolute-externals-relative/make-relative-true/_expected.js000066400000000000000000000015721415504077600330700ustar00rootroot00000000000000import { 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-2.61.1/test/form/samples/make-absolute-externals-relative/make-relative-true/main.js000066400000000000000000000013351415504077600320510ustar00rootroot00000000000000import { 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-2.61.1/test/form/samples/make-absolute-externals-relative/make-relative-true/nested/000077500000000000000000000000001415504077600320475ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/make-absolute-externals-relative/make-relative-true/nested/nested.js000066400000000000000000000013111415504077600336630ustar00rootroot00000000000000import { 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.js000066400000000000000000000000001415504077600343600ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/make-absolute-externals-relative/make-relative-truerollup-2.61.1/test/form/samples/merge-namespaces-non-live/000077500000000000000000000000001415504077600234565ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/merge-namespaces-non-live/_config.js000066400000000000000000000004321415504077600254170ustar00rootroot00000000000000module.exports = { description: 'merges namespaces without live-bindings', options: { external: ['external1', 'external2'], output: { externalLiveBindings: false }, plugins: [ { transform() { return { syntheticNamedExports: '__synthetic' }; } } ] } }; rollup-2.61.1/test/form/samples/merge-namespaces-non-live/_expected.js000066400000000000000000000010111415504077600257450ustar00rootroot00000000000000import * 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 = { foo: 'foo' }; var ns = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null }, [__synthetic, external1, external2])); console.log(ns); rollup-2.61.1/test/form/samples/merge-namespaces-non-live/main.js000066400000000000000000000000631415504077600247370ustar00rootroot00000000000000import * as ns from './reexport'; console.log(ns); rollup-2.61.1/test/form/samples/merge-namespaces-non-live/reexport.js000066400000000000000000000001231415504077600256600ustar00rootroot00000000000000export * from 'external1'; export * from './synthetic'; export * from 'external2'; rollup-2.61.1/test/form/samples/merge-namespaces-non-live/synthetic.js000066400000000000000000000000531415504077600260240ustar00rootroot00000000000000export const __synthetic = { foo: 'foo' }; rollup-2.61.1/test/form/samples/merge-namespaces/000077500000000000000000000000001415504077600217315ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/merge-namespaces/_config.js000066400000000000000000000003541415504077600236750ustar00rootroot00000000000000module.exports = { description: 'merges namespaces with live-bindings', options: { external: ['external1', 'external2'], plugins: [ { transform() { return { syntheticNamedExports: '__synthetic' }; } } ] } }; rollup-2.61.1/test/form/samples/merge-namespaces/_expected.js000066400000000000000000000012311415504077600242240ustar00rootroot00000000000000import * 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 = { foo: 'foo' }; var ns = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null }, [__synthetic, external1, external2])); console.log(ns); rollup-2.61.1/test/form/samples/merge-namespaces/main.js000066400000000000000000000000631415504077600232120ustar00rootroot00000000000000import * as ns from './reexport'; console.log(ns); rollup-2.61.1/test/form/samples/merge-namespaces/reexport.js000066400000000000000000000001231415504077600241330ustar00rootroot00000000000000export * from 'external1'; export * from './synthetic'; export * from 'external2'; rollup-2.61.1/test/form/samples/merge-namespaces/synthetic.js000066400000000000000000000000531415504077600242770ustar00rootroot00000000000000export const __synthetic = { foo: 'foo' }; rollup-2.61.1/test/form/samples/minimal-this-mutation/000077500000000000000000000000001415504077600227465ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/minimal-this-mutation/_config.js000066400000000000000000000001311415504077600247030ustar00rootroot00000000000000module.exports = { description: 'mutates "this" only if necessary on function calls' }; rollup-2.61.1/test/form/samples/minimal-this-mutation/_expected.js000066400000000000000000000014311415504077600252430ustar00rootroot00000000000000console.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'); const obj6 = { prop: true }; obj6.doesNotExist(); console.log('retained'); rollup-2.61.1/test/form/samples/minimal-this-mutation/main.js000066400000000000000000000017401415504077600242320ustar00rootroot00000000000000const 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'); const obj6 = { prop: true }; obj6.doesNotExist(); if (obj6.prop) console.log('retained'); else console.log('removed'); rollup-2.61.1/test/form/samples/mjs/000077500000000000000000000000001415504077600173065ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/mjs/_config.js000066400000000000000000000001721415504077600212500ustar00rootroot00000000000000module.exports = { description: 'supports loading mjs with precedence', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/mjs/_expected/000077500000000000000000000000001415504077600212465ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/mjs/_expected/amd.js000066400000000000000000000003261415504077600223460ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var dep$1 = 'js'; var dep = 'mjs'; exports.depJs = dep$1; exports.depMjs = dep; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/mjs/_expected/cjs.js000066400000000000000000000002411415504077600223600ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var dep$1 = 'js'; var dep = 'mjs'; exports.depJs = dep$1; exports.depMjs = dep; rollup-2.61.1/test/form/samples/mjs/_expected/es.js000066400000000000000000000001171415504077600222120ustar00rootroot00000000000000var dep$1 = 'js'; var dep = 'mjs'; export { dep$1 as depJs, dep as depMjs }; rollup-2.61.1/test/form/samples/mjs/_expected/iife.js000066400000000000000000000003471415504077600225240ustar00rootroot00000000000000var myBundle = (function (exports) { 'use strict'; var dep$1 = 'js'; var dep = 'mjs'; exports.depJs = dep$1; exports.depMjs = dep; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/mjs/_expected/system.js000066400000000000000000000003101415504077600231220ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var dep$1 = exports('depJs', 'js'); var dep = exports('depMjs', 'mjs'); }) }; })); rollup-2.61.1/test/form/samples/mjs/_expected/umd.js000066400000000000000000000007651415504077600224010ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/mjs/dep.js000066400000000000000000000000241415504077600204100ustar00rootroot00000000000000export default 'js';rollup-2.61.1/test/form/samples/mjs/dep.mjs000066400000000000000000000000251415504077600205660ustar00rootroot00000000000000export default 'mjs';rollup-2.61.1/test/form/samples/mjs/main.js000066400000000000000000000001271415504077600205700ustar00rootroot00000000000000export { default as depJs } from './dep.js'; export { default as depMjs } from './dep';rollup-2.61.1/test/form/samples/modify-class-prototype/000077500000000000000000000000001415504077600231525ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/modify-class-prototype/_config.js000066400000000000000000000001251415504077600251120ustar00rootroot00000000000000module.exports = { description: 'tree-shakes prototype modifications of classes' }; rollup-2.61.1/test/form/samples/modify-class-prototype/_expected.js000066400000000000000000000004551415504077600254540ustar00rootroot00000000000000class 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-2.61.1/test/form/samples/modify-class-prototype/main.js000066400000000000000000000010611415504077600244320ustar00rootroot00000000000000class 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-2.61.1/test/form/samples/modify-export-semi/000077500000000000000000000000001415504077600222565ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/modify-export-semi/_config.js000066400000000000000000000001711415504077600242170ustar00rootroot00000000000000module.exports = { description: 'inserts semicolons correctly when modifying SystemJS exports', formats: ['system'] }; rollup-2.61.1/test/form/samples/modify-export-semi/_expected/000077500000000000000000000000001415504077600242165ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/modify-export-semi/_expected/system.js000066400000000000000000000002621415504077600261000ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { let foo = exports('foo', 'foo'); exports('foo', foo = 'bar'); }) }; })); rollup-2.61.1/test/form/samples/modify-export-semi/main.js000066400000000000000000000000431415504077600235350ustar00rootroot00000000000000export let foo = 'foo' foo = 'bar'rollup-2.61.1/test/form/samples/module-name-scoped-package/000077500000000000000000000000001415504077600235645ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/module-name-scoped-package/_config.js000066400000000000000000000002661415504077600255320ustar00rootroot00000000000000module.exports = { description: 'allows module name with dashes to be added to the global object', options: { output: { extend: true, name: '@scoped/npm-package' } } }; rollup-2.61.1/test/form/samples/module-name-scoped-package/_expected/000077500000000000000000000000001415504077600255245ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/module-name-scoped-package/_expected/amd.js000066400000000000000000000002471415504077600266260ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; let foo = 'foo'; exports.foo = foo; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/module-name-scoped-package/_expected/cjs.js000066400000000000000000000001641415504077600266420ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); let foo = 'foo'; exports.foo = foo; rollup-2.61.1/test/form/samples/module-name-scoped-package/_expected/es.js000066400000000000000000000000421415504077600264650ustar00rootroot00000000000000let foo = 'foo'; export { foo }; rollup-2.61.1/test/form/samples/module-name-scoped-package/_expected/iife.js000066400000000000000000000003241415504077600267750ustar00rootroot00000000000000(function (exports) { 'use strict'; let foo = 'foo'; exports.foo = foo; Object.defineProperty(exports, '__esModule', { value: true }); })(this["@scoped/npm-package"] = this["@scoped/npm-package"] || {}); rollup-2.61.1/test/form/samples/module-name-scoped-package/_expected/system.js000066400000000000000000000002501415504077600274030ustar00rootroot00000000000000System.register('@scoped/npm-package', [], (function (exports) { 'use strict'; return { execute: (function () { let foo = exports('foo', 'foo'); }) }; })); rollup-2.61.1/test/form/samples/module-name-scoped-package/_expected/umd.js000066400000000000000000000007651415504077600266570ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/module-name-scoped-package/main.js000066400000000000000000000000301415504077600250370ustar00rootroot00000000000000export let foo = 'foo'; rollup-2.61.1/test/form/samples/module-name-wat/000077500000000000000000000000001415504077600215115ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/module-name-wat/_config.js000066400000000000000000000003121415504077600234470ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/form/samples/module-name-wat/_expected/000077500000000000000000000000001415504077600234515ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/module-name-wat/_expected/amd.js000066400000000000000000000002471415504077600245530ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; let foo = 'foo'; exports.foo = foo; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/module-name-wat/_expected/cjs.js000066400000000000000000000001641415504077600245670ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); let foo = 'foo'; exports.foo = foo; rollup-2.61.1/test/form/samples/module-name-wat/_expected/es.js000066400000000000000000000000421415504077600244120ustar00rootroot00000000000000let foo = 'foo'; export { foo }; rollup-2.61.1/test/form/samples/module-name-wat/_expected/iife.js000066400000000000000000000006351415504077600247270ustar00rootroot00000000000000this.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; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/module-name-wat/_expected/system.js000066400000000000000000000003061415504077600253320ustar00rootroot00000000000000System.register('foo.@scoped/npm-package.bar.why-would-you-do-this', [], (function (exports) { 'use strict'; return { execute: (function () { let foo = exports('foo', 'foo'); }) }; })); rollup-2.61.1/test/form/samples/module-name-wat/_expected/umd.js000066400000000000000000000012701415504077600245740ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/module-name-wat/main.js000066400000000000000000000000301415504077600227640ustar00rootroot00000000000000export let foo = 'foo'; rollup-2.61.1/test/form/samples/module-name-with-dashes/000077500000000000000000000000001415504077600231365ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/module-name-with-dashes/_config.js000066400000000000000000000002721415504077600251010ustar00rootroot00000000000000module.exports = { description: 'allows module name with dashes to be added to the global object', options: { output: { extend: true, name: 'module-name-with-dashes' } } }; rollup-2.61.1/test/form/samples/module-name-with-dashes/_expected/000077500000000000000000000000001415504077600250765ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/module-name-with-dashes/_expected/amd.js000066400000000000000000000002471415504077600262000ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; let foo = 'foo'; exports.foo = foo; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/module-name-with-dashes/_expected/cjs.js000066400000000000000000000001641415504077600262140ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); let foo = 'foo'; exports.foo = foo; rollup-2.61.1/test/form/samples/module-name-with-dashes/_expected/es.js000066400000000000000000000000421415504077600260370ustar00rootroot00000000000000let foo = 'foo'; export { foo }; rollup-2.61.1/test/form/samples/module-name-with-dashes/_expected/iife.js000066400000000000000000000003341415504077600263500ustar00rootroot00000000000000(function (exports) { 'use strict'; let foo = 'foo'; exports.foo = foo; Object.defineProperty(exports, '__esModule', { value: true }); })(this["module-name-with-dashes"] = this["module-name-with-dashes"] || {}); rollup-2.61.1/test/form/samples/module-name-with-dashes/_expected/system.js000066400000000000000000000002541415504077600267610ustar00rootroot00000000000000System.register('module-name-with-dashes', [], (function (exports) { 'use strict'; return { execute: (function () { let foo = exports('foo', 'foo'); }) }; })); rollup-2.61.1/test/form/samples/module-name-with-dashes/_expected/umd.js000066400000000000000000000007751415504077600262320ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/module-name-with-dashes/main.js000066400000000000000000000000301415504077600244110ustar00rootroot00000000000000export let foo = 'foo'; rollup-2.61.1/test/form/samples/module-no-treeshake/000077500000000000000000000000001415504077600223655ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/module-no-treeshake/_config.js000066400000000000000000000013551415504077600243330ustar00rootroot00000000000000function getCode(id) { return `const unused = 'unused in ${id}';`; } module.exports = { 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-2.61.1/test/form/samples/module-no-treeshake/_expected.js000066400000000000000000000001771415504077600246700ustar00rootroot00000000000000const unused$2 = 'unused in depResolved'; const unused$1 = 'unused in depLoaded'; const unused = 'unused in depTransformed'; rollup-2.61.1/test/form/samples/module-no-treeshake/main.js000066400000000000000000000001651415504077600236510ustar00rootroot00000000000000import 'dep'; import 'depResolved'; import 'depLoaded'; import 'depTransformed'; const unused = "unused in 'main'"; rollup-2.61.1/test/form/samples/multi-expression-calls/000077500000000000000000000000001415504077600231405ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/multi-expression-calls/_config.js000066400000000000000000000001211415504077600250740ustar00rootroot00000000000000module.exports = { description: 'handles side-effect-free multi-expressions' }; rollup-2.61.1/test/form/samples/multi-expression-calls/_expected.js000066400000000000000000000000311415504077600254300ustar00rootroot00000000000000console.log('retained'); rollup-2.61.1/test/form/samples/multi-expression-calls/main.js000066400000000000000000000002461415504077600244240ustar00rootroot00000000000000function noEffect1(x, y) { return () => x; } function noEffect2() { return () => {}; } (globalThis.unknown ? noEffect1 : noEffect2)()(); console.log('retained'); rollup-2.61.1/test/form/samples/multiple-exports/000077500000000000000000000000001415504077600220525ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/multiple-exports/_config.js000066400000000000000000000001511415504077600240110ustar00rootroot00000000000000module.exports = { description: 'multiple named exports', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/multiple-exports/_expected/000077500000000000000000000000001415504077600240125ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/multiple-exports/_expected/amd.js000066400000000000000000000003051415504077600251070ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var foo = 1; var bar = 2; exports.bar = bar; exports.foo = foo; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/multiple-exports/_expected/cjs.js000066400000000000000000000002201415504077600251210ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var foo = 1; var bar = 2; exports.bar = bar; exports.foo = foo; rollup-2.61.1/test/form/samples/multiple-exports/_expected/es.js000066400000000000000000000000601415504077600247530ustar00rootroot00000000000000var foo = 1; var bar = 2; export { bar, foo }; rollup-2.61.1/test/form/samples/multiple-exports/_expected/iife.js000066400000000000000000000003261415504077600252650ustar00rootroot00000000000000var myBundle = (function (exports) { 'use strict'; var foo = 1; var bar = 2; exports.bar = bar; exports.foo = foo; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/multiple-exports/_expected/system.js000066400000000000000000000002711415504077600256740ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var foo = exports('foo', 1); var bar = exports('bar', 2); }) }; })); rollup-2.61.1/test/form/samples/multiple-exports/_expected/umd.js000066400000000000000000000007441415504077600251420ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/multiple-exports/main.js000066400000000000000000000000501415504077600233270ustar00rootroot00000000000000export var foo = 1; export var bar = 2; rollup-2.61.1/test/form/samples/mutations-in-imports/000077500000000000000000000000001415504077600226375ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/mutations-in-imports/_config.js000066400000000000000000000001011415504077600245710ustar00rootroot00000000000000module.exports = { description: 'track mutations of imports' }; rollup-2.61.1/test/form/samples/mutations-in-imports/_expected.js000066400000000000000000000005211415504077600251330ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/mutations-in-imports/lib1.js000066400000000000000000000001571415504077600240270ustar00rootroot00000000000000export const x = { a: { b: () => {} } }; export const y = { a: x.a }; export const z = { a: { b: () => {} } }; rollup-2.61.1/test/form/samples/mutations-in-imports/lib2.js000066400000000000000000000001571415504077600240300ustar00rootroot00000000000000export const x = { a: { b: () => {} } }; export const y = { a: x.a }; export const z = { a: { b: () => {} } }; rollup-2.61.1/test/form/samples/mutations-in-imports/lib3.js000066400000000000000000000001571415504077600240310ustar00rootroot00000000000000export const x = { a: { b: () => {} } }; export const y = { a: x.a }; export const z = { a: { b: () => {} } }; rollup-2.61.1/test/form/samples/mutations-in-imports/lib3a.js000066400000000000000000000000571415504077600241710ustar00rootroot00000000000000import { x } from './lib3'; export default x; rollup-2.61.1/test/form/samples/mutations-in-imports/lib3b.js000066400000000000000000000000571415504077600241720ustar00rootroot00000000000000import { y } from './lib3'; export default y; rollup-2.61.1/test/form/samples/mutations-in-imports/lib3c.js000066400000000000000000000000571415504077600241730ustar00rootroot00000000000000import { z } from './lib3'; export default z; rollup-2.61.1/test/form/samples/mutations-in-imports/main.js000066400000000000000000000005531415504077600241240ustar00rootroot00000000000000import * 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-2.61.1/test/form/samples/namespace-conflict/000077500000000000000000000000001415504077600222505ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-conflict/_config.js000066400000000000000000000002341415504077600242110ustar00rootroot00000000000000module.exports = { description: 'replaces conflicting namespace properties with undefined', expectedWarnings: ['NAMESPACE_CONFLICT', 'MISSING_EXPORT'] }; rollup-2.61.1/test/form/samples/namespace-conflict/_expected.js000066400000000000000000000000301415504077600245370ustar00rootroot00000000000000console.log(undefined); rollup-2.61.1/test/form/samples/namespace-conflict/first.js000066400000000000000000000000261415504077600237330ustar00rootroot00000000000000export const foo = 1; rollup-2.61.1/test/form/samples/namespace-conflict/main.js000066400000000000000000000000701415504077600235270ustar00rootroot00000000000000import * as ns from './reexport'; console.log(ns.foo); rollup-2.61.1/test/form/samples/namespace-conflict/reexport.js000066400000000000000000000000631415504077600244550ustar00rootroot00000000000000export * from './first'; export * from './second'; rollup-2.61.1/test/form/samples/namespace-conflict/second.js000066400000000000000000000000261415504077600240570ustar00rootroot00000000000000export const foo = 2; rollup-2.61.1/test/form/samples/namespace-import-reexport-2/000077500000000000000000000000001415504077600237665ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-import-reexport-2/_config.js000066400000000000000000000003751415504077600257350ustar00rootroot00000000000000module.exports = { description: 'properly associate or shadow variables in and around functions', options: { external: ['external1', 'external2'], output: { globals: { external1: 'external1', external2: 'external2' }, name: 'iife' } } }; rollup-2.61.1/test/form/samples/namespace-import-reexport-2/_expected/000077500000000000000000000000001415504077600257265ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-import-reexport-2/_expected/amd.js000066400000000000000000000014541415504077600270310ustar00rootroot00000000000000define(['exports', 'external1', 'external2'], (function (exports, external1, external2) { 'use strict'; 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 external2__namespace = /*#__PURE__*/_interopNamespace(external2); Object.defineProperty(exports, 'x', { enumerable: true, get: function () { return external1.x; } }); exports.ext = external2__namespace; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/namespace-import-reexport-2/_expected/cjs.js000066400000000000000000000014011415504077600270370ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var external1 = require('external1'); var external2 = require('external2'); 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 external2__namespace = /*#__PURE__*/_interopNamespace(external2); Object.defineProperty(exports, 'x', { enumerable: true, get: function () { return external1.x; } }); exports.ext = external2__namespace; rollup-2.61.1/test/form/samples/namespace-import-reexport-2/_expected/es.js000066400000000000000000000001441415504077600266720ustar00rootroot00000000000000export { x } from 'external1'; import * as external2 from 'external2'; export { external2 as ext }; rollup-2.61.1/test/form/samples/namespace-import-reexport-2/_expected/iife.js000066400000000000000000000014651415504077600272060ustar00rootroot00000000000000var iife = (function (exports, external1, external2) { 'use strict'; 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 external2__namespace = /*#__PURE__*/_interopNamespace(external2); Object.defineProperty(exports, 'x', { enumerable: true, get: function () { return external1.x; } }); exports.ext = external2__namespace; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, external1, external2); rollup-2.61.1/test/form/samples/namespace-import-reexport-2/_expected/system.js000066400000000000000000000004031415504077600276050ustar00rootroot00000000000000System.register('iife', ['external1', 'external2'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('x', module.x); }, function (module) { exports('ext', module); }], execute: (function () { }) }; })); rollup-2.61.1/test/form/samples/namespace-import-reexport-2/_expected/umd.js000066400000000000000000000022271415504077600270540ustar00rootroot00000000000000(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 _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 external2__namespace = /*#__PURE__*/_interopNamespace(external2); Object.defineProperty(exports, 'x', { enumerable: true, get: function () { return external1.x; } }); exports.ext = external2__namespace; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/namespace-import-reexport-2/main.js000066400000000000000000000001211415504077600252420ustar00rootroot00000000000000export { x } from 'external1'; import * as ext from 'external2'; export { ext }; rollup-2.61.1/test/form/samples/namespace-import-reexport/000077500000000000000000000000001415504077600236275ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-import-reexport/_config.js000066400000000000000000000003561415504077600255750ustar00rootroot00000000000000module.exports = { description: 'properly associate or shadow variables in and around functions', options: { external: ['external-package'], output: { globals: { 'external-package': 'externalPackage' }, name: 'iife' } } }; rollup-2.61.1/test/form/samples/namespace-import-reexport/_expected/000077500000000000000000000000001415504077600255675ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-import-reexport/_expected/amd.js000066400000000000000000000013101415504077600266610ustar00rootroot00000000000000define(['exports', 'external-package'], (function (exports, externalPackage) { 'use strict'; 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 externalPackage__namespace = /*#__PURE__*/_interopNamespace(externalPackage); exports.ext = externalPackage__namespace; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/namespace-import-reexport/_expected/cjs.js000066400000000000000000000012231415504077600267020ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var externalPackage = require('external-package'); 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 externalPackage__namespace = /*#__PURE__*/_interopNamespace(externalPackage); exports.ext = externalPackage__namespace; rollup-2.61.1/test/form/samples/namespace-import-reexport/_expected/es.js000066400000000000000000000001301415504077600265260ustar00rootroot00000000000000import * as externalPackage from 'external-package'; export { externalPackage as ext }; rollup-2.61.1/test/form/samples/namespace-import-reexport/_expected/iife.js000066400000000000000000000013221415504077600270370ustar00rootroot00000000000000var iife = (function (exports, externalPackage) { 'use strict'; 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 externalPackage__namespace = /*#__PURE__*/_interopNamespace(externalPackage); exports.ext = externalPackage__namespace; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, externalPackage); rollup-2.61.1/test/form/samples/namespace-import-reexport/_expected/system.js000066400000000000000000000003111415504077600274440ustar00rootroot00000000000000System.register('iife', ['external-package'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('ext', module); }], execute: (function () { }) }; })); rollup-2.61.1/test/form/samples/namespace-import-reexport/_expected/umd.js000066400000000000000000000020301415504077600267050ustar00rootroot00000000000000(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 _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 externalPackage__namespace = /*#__PURE__*/_interopNamespace(externalPackage); exports.ext = externalPackage__namespace; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/namespace-import-reexport/main.js000066400000000000000000000000701415504077600251060ustar00rootroot00000000000000import * as ext from 'external-package'; export { ext };rollup-2.61.1/test/form/samples/namespace-missing-export-effects/000077500000000000000000000000001415504077600250545ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-missing-export-effects/_config.js000066400000000000000000000002001415504077600270060ustar00rootroot00000000000000module.exports = { description: 'handles interacting with missing namespace members', expectedWarnings: ['MISSING_EXPORT'] }; rollup-2.61.1/test/form/samples/namespace-missing-export-effects/_expected.js000066400000000000000000000001631415504077600273520ustar00rootroot00000000000000if (!undefined) console.log(1); if (undefined()) console.log(2); const foo = undefined; foo.bar; (0, undefined)(); rollup-2.61.1/test/form/samples/namespace-missing-export-effects/main.js000066400000000000000000000002171415504077600263360ustar00rootroot00000000000000import * 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-2.61.1/test/form/samples/namespace-missing-export-effects/other.js000066400000000000000000000000001415504077600265210ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-object-import/000077500000000000000000000000001415504077600232255ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-object-import/_config.js000066400000000000000000000002071415504077600251660ustar00rootroot00000000000000module.exports = { description: 'properly encodes reserved names if namespace import is used', options: { input: ['main.js'] } }; rollup-2.61.1/test/form/samples/namespace-object-import/_expected/000077500000000000000000000000001415504077600251655ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-object-import/_expected/amd.js000066400000000000000000000002531415504077600262640ustar00rootroot00000000000000define((function () { 'use strict'; var dep = "default"; var dep$1 = /*#__PURE__*/Object.freeze({ __proto__: null, 'default': dep }); console.log(dep$1); })); rollup-2.61.1/test/form/samples/namespace-object-import/_expected/cjs.js000066400000000000000000000002111415504077600262740ustar00rootroot00000000000000'use strict'; var dep = "default"; var dep$1 = /*#__PURE__*/Object.freeze({ __proto__: null, 'default': dep }); console.log(dep$1); rollup-2.61.1/test/form/samples/namespace-object-import/_expected/es.js000066400000000000000000000001721415504077600261320ustar00rootroot00000000000000var dep = "default"; var dep$1 = /*#__PURE__*/Object.freeze({ __proto__: null, 'default': dep }); console.log(dep$1); rollup-2.61.1/test/form/samples/namespace-object-import/_expected/iife.js000066400000000000000000000002461415504077600264410ustar00rootroot00000000000000(function () { 'use strict'; var dep = "default"; var dep$1 = /*#__PURE__*/Object.freeze({ __proto__: null, 'default': dep }); console.log(dep$1); })(); rollup-2.61.1/test/form/samples/namespace-object-import/_expected/system.js000066400000000000000000000003621415504077600270500ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/namespace-object-import/_expected/umd.js000066400000000000000000000004111415504077600263040ustar00rootroot00000000000000(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-2.61.1/test/form/samples/namespace-object-import/dep.js000066400000000000000000000000311415504077600243250ustar00rootroot00000000000000export default "default" rollup-2.61.1/test/form/samples/namespace-object-import/main.js000066400000000000000000000000631415504077600245060ustar00rootroot00000000000000import * as dep from './dep.js'; console.log(dep);rollup-2.61.1/test/form/samples/namespace-optimization-b/000077500000000000000000000000001415504077600234145ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-optimization-b/_config.js000066400000000000000000000002231415504077600253530ustar00rootroot00000000000000module.exports = { description: 'it does static lookup optimization of internal namespaces, coping with multiple namespaces in one function' }; rollup-2.61.1/test/form/samples/namespace-optimization-b/_expected/000077500000000000000000000000001415504077600253545ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-optimization-b/_expected/amd.js000066400000000000000000000002401415504077600264470ustar00rootroot00000000000000define((function () { 'use strict'; function foo () { console.log( 'foo' ); } function a () { foo(); foo(); var a; if ( a.b ) ; } a(); })); rollup-2.61.1/test/form/samples/namespace-optimization-b/_expected/cjs.js000066400000000000000000000001721415504077600264710ustar00rootroot00000000000000'use strict'; function foo () { console.log( 'foo' ); } function a () { foo(); foo(); var a; if ( a.b ) ; } a(); rollup-2.61.1/test/form/samples/namespace-optimization-b/_expected/es.js000066400000000000000000000001531415504077600263200ustar00rootroot00000000000000function foo () { console.log( 'foo' ); } function a () { foo(); foo(); var a; if ( a.b ) ; } a(); rollup-2.61.1/test/form/samples/namespace-optimization-b/_expected/iife.js000066400000000000000000000002331415504077600266240ustar00rootroot00000000000000(function () { 'use strict'; function foo () { console.log( 'foo' ); } function a () { foo(); foo(); var a; if ( a.b ) ; } a(); })(); rollup-2.61.1/test/form/samples/namespace-optimization-b/_expected/system.js000066400000000000000000000003571415504077600272430ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function foo () { console.log( 'foo' ); } function a () { foo(); foo(); var a; if ( a.b ) ; } a(); }) }; })); rollup-2.61.1/test/form/samples/namespace-optimization-b/_expected/umd.js000066400000000000000000000003761415504077600265050ustar00rootroot00000000000000(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-2.61.1/test/form/samples/namespace-optimization-b/foo.js000066400000000000000000000000621415504077600245330ustar00rootroot00000000000000export function foo () { console.log( 'foo' ); } rollup-2.61.1/test/form/samples/namespace-optimization-b/main.js000066400000000000000000000001641415504077600246770ustar00rootroot00000000000000import * as foo from './foo'; function a () { foo.foo(); foo.foo(); var a; if ( a.b ) { // empty } } a(); rollup-2.61.1/test/form/samples/namespace-optimization-computed-string/000077500000000000000000000000001415504077600263175ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-optimization-computed-string/_config.js000066400000000000000000000001711415504077600302600ustar00rootroot00000000000000module.exports = { description: 'it does dynamic lookup optimization of internal namespaces for string-literal keys' }; rollup-2.61.1/test/form/samples/namespace-optimization-computed-string/_expected/000077500000000000000000000000001415504077600302575ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-optimization-computed-string/_expected/amd.js000066400000000000000000000001371415504077600313570ustar00rootroot00000000000000define((function () { 'use strict'; function a () { console.log('effect'); } a(); })); rollup-2.61.1/test/form/samples/namespace-optimization-computed-string/_expected/cjs.js000066400000000000000000000000771415504077600314000ustar00rootroot00000000000000'use strict'; function a () { console.log('effect'); } a(); rollup-2.61.1/test/form/samples/namespace-optimization-computed-string/_expected/es.js000066400000000000000000000000601415504077600312200ustar00rootroot00000000000000function a () { console.log('effect'); } a(); rollup-2.61.1/test/form/samples/namespace-optimization-computed-string/_expected/iife.js000066400000000000000000000001321415504077600315250ustar00rootroot00000000000000(function () { 'use strict'; function a () { console.log('effect'); } a(); })(); rollup-2.61.1/test/form/samples/namespace-optimization-computed-string/_expected/system.js000066400000000000000000000002421415504077600321370ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function a () { console.log('effect'); } a(); }) }; })); rollup-2.61.1/test/form/samples/namespace-optimization-computed-string/_expected/umd.js000066400000000000000000000002751415504077600314060ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function a () { console.log('effect'); } a(); })); rollup-2.61.1/test/form/samples/namespace-optimization-computed-string/bar.js000066400000000000000000000000661415504077600274230ustar00rootroot00000000000000import * as quux from './quux.js'; export { quux }; rollup-2.61.1/test/form/samples/namespace-optimization-computed-string/foo.js000066400000000000000000000000631415504077600274370ustar00rootroot00000000000000import * as bar from './bar.js'; export { bar }; rollup-2.61.1/test/form/samples/namespace-optimization-computed-string/main.js000066400000000000000000000001301415504077600275730ustar00rootroot00000000000000import * as foo from './foo.js'; foo['bar']['quux']['a'](); foo['bar']['quux']['b'](); rollup-2.61.1/test/form/samples/namespace-optimization-computed-string/quux.js000066400000000000000000000001121415504077600276510ustar00rootroot00000000000000export function a () { console.log('effect'); } export function b () {} rollup-2.61.1/test/form/samples/namespace-optimization/000077500000000000000000000000001415504077600231755ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-optimization/_config.js000066400000000000000000000001401415504077600251320ustar00rootroot00000000000000module.exports = { description: 'it does static lookup optimization of internal namespaces' }; rollup-2.61.1/test/form/samples/namespace-optimization/_expected.js000066400000000000000000000000461415504077600254730ustar00rootroot00000000000000function a () {} console.log( a() ); rollup-2.61.1/test/form/samples/namespace-optimization/bar.js000066400000000000000000000000621415504077600242750ustar00rootroot00000000000000import * as quux from './quux'; export { quux }; rollup-2.61.1/test/form/samples/namespace-optimization/foo.js000066400000000000000000000000571415504077600243200ustar00rootroot00000000000000import * as bar from './bar'; export { bar }; rollup-2.61.1/test/form/samples/namespace-optimization/main.js000066400000000000000000000001001415504077600244460ustar00rootroot00000000000000import * as foo from './foo'; console.log( foo.bar.quux.a() ); rollup-2.61.1/test/form/samples/namespace-optimization/quux.js000066400000000000000000000000301415504077600245260ustar00rootroot00000000000000export function a () {} rollup-2.61.1/test/form/samples/namespace-reexport-name/000077500000000000000000000000001415504077600232355ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-reexport-name/_config.js000066400000000000000000000002531415504077600251770ustar00rootroot00000000000000module.exports = { description: 'uses correct names when reexporting from namespace reexports (#4049)', options: { external: 'external', output: { name: 'bundle' } } }; rollup-2.61.1/test/form/samples/namespace-reexport-name/_expected/000077500000000000000000000000001415504077600251755ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-reexport-name/_expected/amd.js000066400000000000000000000011551415504077600262760ustar00rootroot00000000000000define(['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' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/namespace-reexport-name/_expected/cjs.js000066400000000000000000000010771415504077600263170ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); rollup-2.61.1/test/form/samples/namespace-reexport-name/_expected/es.js000066400000000000000000000003431415504077600261420ustar00rootroot00000000000000import { indirectOverride } from 'external'; export * from 'external'; export { directOverride as renamedDirectOverride } from 'external'; const renamedIndirectOverride = indirectOverride; export { renamedIndirectOverride }; rollup-2.61.1/test/form/samples/namespace-reexport-name/_expected/iife.js000066400000000000000000000011721415504077600264500ustar00rootroot00000000000000var 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' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, external); rollup-2.61.1/test/form/samples/namespace-reexport-name/_expected/system.js000066400000000000000000000011361415504077600270600ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/namespace-reexport-name/_expected/umd.js000066400000000000000000000016601415504077600263230ustar00rootroot00000000000000(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' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/namespace-reexport-name/external-reexport.js000066400000000000000000000001071415504077600272610ustar00rootroot00000000000000export * from 'external'; export { conflictOverride } from 'external'; rollup-2.61.1/test/form/samples/namespace-reexport-name/main.js000066400000000000000000000001021415504077600245100ustar00rootroot00000000000000export * from './external-reexport'; export * from './overrides'; rollup-2.61.1/test/form/samples/namespace-reexport-name/overrides.js000066400000000000000000000004031415504077600255720ustar00rootroot00000000000000import { indirectOverride, ignoredOverride } from './external-reexport'; export { directOverride as renamedDirectOverride } from './external-reexport'; export const renamedIndirectOverride = indirectOverride; export const conflictOverride = ignoredOverride; rollup-2.61.1/test/form/samples/namespace-self-import/000077500000000000000000000000001415504077600227105ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-self-import/_config.js000066400000000000000000000002421415504077600246500ustar00rootroot00000000000000module.exports = { description: 'namespace early import hoisting', expectedWarnings: ['CIRCULAR_DEPENDENCY'], options: { output: { name: 'iife' } } }; rollup-2.61.1/test/form/samples/namespace-self-import/_expected/000077500000000000000000000000001415504077600246505ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-self-import/_expected/amd.js000066400000000000000000000004321415504077600257460ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/namespace-self-import/_expected/cjs.js000066400000000000000000000003421415504077600257640ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var self = /*#__PURE__*/Object.freeze({ __proto__: null, get p () { return p; } }); console.log(Object.keys(self)); var p = 5; exports.p = p; rollup-2.61.1/test/form/samples/namespace-self-import/_expected/es.js000066400000000000000000000002221415504077600256110ustar00rootroot00000000000000var self = /*#__PURE__*/Object.freeze({ __proto__: null, get p () { return p; } }); console.log(Object.keys(self)); var p = 5; export { p }; rollup-2.61.1/test/form/samples/namespace-self-import/_expected/iife.js000066400000000000000000000004471415504077600261270ustar00rootroot00000000000000var 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; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/namespace-self-import/_expected/system.js000066400000000000000000000004301415504077600265270ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/namespace-self-import/_expected/umd.js000066400000000000000000000010651415504077600257750ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/namespace-self-import/main.js000066400000000000000000000001261415504077600241710ustar00rootroot00000000000000import * as self from './main.js'; console.log(Object.keys(self)); export var p = 5;rollup-2.61.1/test/form/samples/namespace-tostring/000077500000000000000000000000001415504077600223205ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-tostring/entry-default/000077500000000000000000000000001415504077600251035ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-tostring/entry-default/_config.js000066400000000000000000000003401415504077600270420ustar00rootroot00000000000000module.exports = { description: 'does not add Symbol.toStringTag property to entry chunks with default export mode', options: { output: { namespaceToStringTag: true, exports: 'default', name: 'bundle' } } }; rollup-2.61.1/test/form/samples/namespace-tostring/entry-default/_expected/000077500000000000000000000000001415504077600270435ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-tostring/entry-default/_expected/amd.js000066400000000000000000000001231415504077600301360ustar00rootroot00000000000000define((function () { 'use strict'; var main = { foo: 42 }; return main; })); rollup-2.61.1/test/form/samples/namespace-tostring/entry-default/_expected/cjs.js000066400000000000000000000000771415504077600301640ustar00rootroot00000000000000'use strict'; var main = { foo: 42 }; module.exports = main; rollup-2.61.1/test/form/samples/namespace-tostring/entry-default/_expected/es.js000066400000000000000000000000651415504077600300110ustar00rootroot00000000000000var main = { foo: 42 }; export { main as default }; rollup-2.61.1/test/form/samples/namespace-tostring/entry-default/_expected/iife.js000066400000000000000000000001331415504077600303120ustar00rootroot00000000000000var bundle = (function () { 'use strict'; var main = { foo: 42 }; return main; })(); rollup-2.61.1/test/form/samples/namespace-tostring/entry-default/_expected/system.js000066400000000000000000000002461415504077600307270ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', { foo: 42 }); }) }; })); rollup-2.61.1/test/form/samples/namespace-tostring/entry-default/_expected/umd.js000066400000000000000000000005701415504077600301700ustar00rootroot00000000000000(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-2.61.1/test/form/samples/namespace-tostring/entry-default/main.js000066400000000000000000000000341415504077600263620ustar00rootroot00000000000000export default { foo: 42 }; rollup-2.61.1/test/form/samples/namespace-tostring/entry-named/000077500000000000000000000000001415504077600245435ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-tostring/entry-named/_config.js000066400000000000000000000003201415504077600265000ustar00rootroot00000000000000module.exports = { description: 'adds Symbol.toStringTag property to entry chunks with named exports', options: { output: { namespaceToStringTag: true, exports: 'named', name: 'bundle' } } }; rollup-2.61.1/test/form/samples/namespace-tostring/entry-named/_expected/000077500000000000000000000000001415504077600265035ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-tostring/entry-named/_expected/amd.js000066400000000000000000000003171415504077600276030ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const foo = 42; exports.foo = foo; Object.defineProperty(exports, '__esModule', { value: true }); exports[Symbol.toStringTag] = 'Module'; })); rollup-2.61.1/test/form/samples/namespace-tostring/entry-named/_expected/cjs.js000066400000000000000000000002331415504077600276160ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); exports[Symbol.toStringTag] = 'Module'; const foo = 42; exports.foo = foo; rollup-2.61.1/test/form/samples/namespace-tostring/entry-named/_expected/es.js000066400000000000000000000000411415504077600274430ustar00rootroot00000000000000const foo = 42; export { foo }; rollup-2.61.1/test/form/samples/namespace-tostring/entry-named/_expected/iife.js000066400000000000000000000003361415504077600277570ustar00rootroot00000000000000var bundle = (function (exports) { 'use strict'; const foo = 42; exports.foo = foo; Object.defineProperty(exports, '__esModule', { value: true }); exports[Symbol.toStringTag] = 'Module'; return exports; })({}); rollup-2.61.1/test/form/samples/namespace-tostring/entry-named/_expected/system.js000066400000000000000000000002321415504077600303620ustar00rootroot00000000000000System.register('bundle', [], (function (exports) { 'use strict'; return { execute: (function () { const foo = exports('foo', 42); }) }; })); rollup-2.61.1/test/form/samples/namespace-tostring/entry-named/_expected/umd.js000066400000000000000000000007541415504077600276340ustar00rootroot00000000000000(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, '__esModule', { value: true }); exports[Symbol.toStringTag] = 'Module'; })); rollup-2.61.1/test/form/samples/namespace-tostring/entry-named/main.js000066400000000000000000000000271415504077600260240ustar00rootroot00000000000000export const foo = 42; rollup-2.61.1/test/form/samples/namespace-tostring/external-namespaces/000077500000000000000000000000001415504077600262575ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-tostring/external-namespaces/_config.js000066400000000000000000000012031415504077600302150ustar00rootroot00000000000000module.exports = { description: 'adds Symbol.toStringTag property to external namespaces', options: { 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}"`); } } } } }; rollup-2.61.1/test/form/samples/namespace-tostring/external-namespaces/_expected/000077500000000000000000000000001415504077600302175ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-tostring/external-namespaces/_expected/amd.js000066400000000000000000000034221415504077600313170ustar00rootroot00000000000000define(['external-auto', 'external-default', 'external-defaultOnly'], (function (externalAuto, externalDefault, externalDefaultOnly) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, [Symbol.toStringTag]: 'Module', 'default': e }); } function _interopNamespaceDefault(e) { var n = {__proto__: null, [Symbol.toStringTag]: '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-2.61.1/test/form/samples/namespace-tostring/external-namespaces/_expected/cjs.js000066400000000000000000000034031415504077600313340ustar00rootroot00000000000000'use strict'; var externalAuto = require('external-auto'); var externalDefault = require('external-default'); var externalDefaultOnly = require('external-defaultOnly'); function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, [Symbol.toStringTag]: 'Module', 'default': e }); } function _interopNamespaceDefault(e) { var n = {__proto__: null, [Symbol.toStringTag]: '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-2.61.1/test/form/samples/namespace-tostring/external-namespaces/_expected/es.js000066400000000000000000000014201415504077600311610ustar00rootroot00000000000000import * 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-2.61.1/test/form/samples/namespace-tostring/external-namespaces/_expected/iife.js000066400000000000000000000034001415504077600314660ustar00rootroot00000000000000(function (externalAuto, externalDefault, externalDefaultOnly) { 'use strict'; function _interopNamespaceDefaultOnly (e) { return Object.freeze({ __proto__: null, [Symbol.toStringTag]: 'Module', 'default': e }); } function _interopNamespaceDefault(e) { var n = {__proto__: null, [Symbol.toStringTag]: '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-2.61.1/test/form/samples/namespace-tostring/external-namespaces/_expected/system.js000066400000000000000000000020231415504077600320760ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/namespace-tostring/external-namespaces/_expected/umd.js000066400000000000000000000042631415504077600313470ustar00rootroot00000000000000(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({ __proto__: null, [Symbol.toStringTag]: 'Module', 'default': e }); } function _interopNamespaceDefault(e) { var n = {__proto__: null, [Symbol.toStringTag]: '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-2.61.1/test/form/samples/namespace-tostring/external-namespaces/main.js000066400000000000000000000014201415504077600275360ustar00rootroot00000000000000import * 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-2.61.1/test/form/samples/namespace-tostring/inlined-namespace/000077500000000000000000000000001415504077600256745ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-tostring/inlined-namespace/_config.js000066400000000000000000000002331415504077600276340ustar00rootroot00000000000000module.exports = { description: 'adds Symbol.toStringTag property to inlined namespaces', options: { output: { namespaceToStringTag: true } } }; rollup-2.61.1/test/form/samples/namespace-tostring/inlined-namespace/_expected/000077500000000000000000000000001415504077600276345ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespace-tostring/inlined-namespace/_expected/amd.js000066400000000000000000000005161415504077600307350ustar00rootroot00000000000000define((function () { 'use strict'; const bar = 42; var foo = /*#__PURE__*/Object.freeze({ __proto__: null, [Symbol.toStringTag]: 'Module', bar: bar }); assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(bar, 42); })); rollup-2.61.1/test/form/samples/namespace-tostring/inlined-namespace/_expected/cjs.js000066400000000000000000000004511415504077600307510ustar00rootroot00000000000000'use strict'; const bar = 42; var foo = /*#__PURE__*/Object.freeze({ __proto__: null, [Symbol.toStringTag]: 'Module', bar: bar }); assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(bar, 42); rollup-2.61.1/test/form/samples/namespace-tostring/inlined-namespace/_expected/es.js000066400000000000000000000004321415504077600306000ustar00rootroot00000000000000const bar = 42; var foo = /*#__PURE__*/Object.freeze({ __proto__: null, [Symbol.toStringTag]: 'Module', bar: bar }); assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(bar, 42); rollup-2.61.1/test/form/samples/namespace-tostring/inlined-namespace/_expected/iife.js000066400000000000000000000005111415504077600311030ustar00rootroot00000000000000(function () { 'use strict'; const bar = 42; var foo = /*#__PURE__*/Object.freeze({ __proto__: null, [Symbol.toStringTag]: 'Module', bar: bar }); assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(bar, 42); })(); rollup-2.61.1/test/form/samples/namespace-tostring/inlined-namespace/_expected/system.js000066400000000000000000000006331415504077600315200ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { const bar = 42; var foo = /*#__PURE__*/Object.freeze({ __proto__: null, [Symbol.toStringTag]: 'Module', bar: bar }); assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(bar, 42); }) }; })); rollup-2.61.1/test/form/samples/namespace-tostring/inlined-namespace/_expected/umd.js000066400000000000000000000006541415504077600307640ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; const bar = 42; var foo = /*#__PURE__*/Object.freeze({ __proto__: null, [Symbol.toStringTag]: 'Module', bar: bar }); assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(bar, 42); })); rollup-2.61.1/test/form/samples/namespace-tostring/inlined-namespace/foo.js000066400000000000000000000000271415504077600270140ustar00rootroot00000000000000export const bar = 42; rollup-2.61.1/test/form/samples/namespace-tostring/inlined-namespace/main.js000066400000000000000000000003031415504077600271520ustar00rootroot00000000000000import * 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-2.61.1/test/form/samples/namespaced-default-exports/000077500000000000000000000000001415504077600237415ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespaced-default-exports/_config.js000066400000000000000000000001651415504077600257050ustar00rootroot00000000000000module.exports = { description: 'creates namespaced module names', options: { output: { name: 'foo.bar.baz' } } }; rollup-2.61.1/test/form/samples/namespaced-default-exports/_expected/000077500000000000000000000000001415504077600257015ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespaced-default-exports/_expected/amd.js000066400000000000000000000001121415504077600267720ustar00rootroot00000000000000define((function () { 'use strict'; var main = 42; return main; })); rollup-2.61.1/test/form/samples/namespaced-default-exports/_expected/cjs.js000066400000000000000000000000661415504077600270200ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-2.61.1/test/form/samples/namespaced-default-exports/_expected/es.js000066400000000000000000000000541415504077600266450ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-2.61.1/test/form/samples/namespaced-default-exports/_expected/iife.js000066400000000000000000000002261415504077600271530ustar00rootroot00000000000000this.foo = this.foo || {}; this.foo.bar = this.foo.bar || {}; this.foo.bar.baz = (function () { 'use strict'; var main = 42; return main; })(); rollup-2.61.1/test/form/samples/namespaced-default-exports/_expected/system.js000066400000000000000000000002421415504077600275610ustar00rootroot00000000000000System.register('foo.bar.baz', [], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', 42); }) }; })); rollup-2.61.1/test/form/samples/namespaced-default-exports/_expected/umd.js000066400000000000000000000006741415504077600270330ustar00rootroot00000000000000(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-2.61.1/test/form/samples/namespaced-default-exports/main.js000066400000000000000000000000231415504077600252160ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/form/samples/namespaced-named-exports/000077500000000000000000000000001415504077600234015ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespaced-named-exports/_config.js000066400000000000000000000001651415504077600253450ustar00rootroot00000000000000module.exports = { description: 'creates namespaced module names', options: { output: { name: 'foo.bar.baz' } } }; rollup-2.61.1/test/form/samples/namespaced-named-exports/_expected/000077500000000000000000000000001415504077600253415ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespaced-named-exports/_expected/amd.js000066400000000000000000000002551415504077600264420ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var answer = 42; exports.answer = answer; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/namespaced-named-exports/_expected/cjs.js000066400000000000000000000001721415504077600264560ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var answer = 42; exports.answer = answer; rollup-2.61.1/test/form/samples/namespaced-named-exports/_expected/es.js000066400000000000000000000000451415504077600263050ustar00rootroot00000000000000var answer = 42; export { answer }; rollup-2.61.1/test/form/samples/namespaced-named-exports/_expected/iife.js000066400000000000000000000004001415504077600266050ustar00rootroot00000000000000this.foo = this.foo || {}; this.foo.bar = this.foo.bar || {}; this.foo.bar.baz = (function (exports) { 'use strict'; var answer = 42; exports.answer = answer; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/namespaced-named-exports/_expected/system.js000066400000000000000000000002431415504077600272220ustar00rootroot00000000000000System.register('foo.bar.baz', [], (function (exports) { 'use strict'; return { execute: (function () { var answer = exports('answer', 42); }) }; })); rollup-2.61.1/test/form/samples/namespaced-named-exports/_expected/umd.js000066400000000000000000000010271415504077600264640ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/namespaced-named-exports/main.js000066400000000000000000000000301415504077600246540ustar00rootroot00000000000000export var answer = 42; rollup-2.61.1/test/form/samples/namespaces-have-null-prototype/000077500000000000000000000000001415504077600245705ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespaces-have-null-prototype/_config.js000066400000000000000000000001751415504077600265350ustar00rootroot00000000000000module.exports = { description: 'creates namespaces with null prototypes', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/namespaces-have-null-prototype/_expected/000077500000000000000000000000001415504077600265305ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/namespaces-have-null-prototype/_expected/amd.js000066400000000000000000000005471415504077600276350ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const foo = 1; const bar = 2; var namespace = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo, bar: bar }); console.log( Object.keys( namespace ) ); const a = 1; const b = 2; exports.a = a; exports.b = b; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/namespaces-have-null-prototype/_expected/cjs.js000066400000000000000000000004521415504077600276460ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const foo = 1; const bar = 2; var namespace = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo, bar: bar }); console.log( Object.keys( namespace ) ); const a = 1; const b = 2; exports.a = a; exports.b = b; rollup-2.61.1/test/form/samples/namespaces-have-null-prototype/_expected/es.js000066400000000000000000000003161415504077600274750ustar00rootroot00000000000000const foo = 1; const bar = 2; var namespace = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo, bar: bar }); console.log( Object.keys( namespace ) ); const a = 1; const b = 2; export { a, b }; rollup-2.61.1/test/form/samples/namespaces-have-null-prototype/_expected/iife.js000066400000000000000000000005701415504077600300040ustar00rootroot00000000000000var myBundle = (function (exports) { 'use strict'; const foo = 1; const bar = 2; var namespace = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo, bar: bar }); console.log( Object.keys( namespace ) ); const a = 1; const b = 2; exports.a = a; exports.b = b; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/namespaces-have-null-prototype/_expected/system.js000066400000000000000000000005571415504077600304210ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { const foo = 1; const bar = 2; var namespace = /*#__PURE__*/Object.freeze({ __proto__: null, foo: foo, bar: bar }); console.log( Object.keys( namespace ) ); const a = exports('a', 1); const b = exports('b', 2); }) }; })); rollup-2.61.1/test/form/samples/namespaces-have-null-prototype/_expected/umd.js000066400000000000000000000012061415504077600276520ustar00rootroot00000000000000(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, foo: foo, bar: bar }); console.log( Object.keys( namespace ) ); const a = 1; const b = 2; exports.a = a; exports.b = b; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/namespaces-have-null-prototype/main.js000066400000000000000000000002001415504077600260420ustar00rootroot00000000000000import * as namespace from './namespace.js'; console.log( Object.keys( namespace ) ); export const a = 1; export const b = 2; rollup-2.61.1/test/form/samples/namespaces-have-null-prototype/namespace.js000066400000000000000000000000531415504077600270600ustar00rootroot00000000000000export const foo = 1; export const bar = 2;rollup-2.61.1/test/form/samples/nested-deoptimization/000077500000000000000000000000001415504077600230345ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/nested-deoptimization/_config.js000066400000000000000000000001221415504077600247710ustar00rootroot00000000000000module.exports = { description: 'handles deoptimization of nested properties' }; rollup-2.61.1/test/form/samples/nested-deoptimization/_expected.js000066400000000000000000000003651415504077600253360ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/nested-deoptimization/main.js000066400000000000000000000005241415504077600243170ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/nested-inlined-dynamic-import/000077500000000000000000000000001415504077600243515ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/nested-inlined-dynamic-import/_config.js000066400000000000000000000002351415504077600263130ustar00rootroot00000000000000module.exports = { description: 'deconflicts variables when nested dynamic imports are inlined', options: { output: { inlineDynamicImports: true } } }; rollup-2.61.1/test/form/samples/nested-inlined-dynamic-import/_expected/000077500000000000000000000000001415504077600263115ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/nested-inlined-dynamic-import/_expected/amd.js000066400000000000000000000004611415504077600274110ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/nested-inlined-dynamic-import/_expected/cjs.js000066400000000000000000000004121415504077600274230ustar00rootroot00000000000000'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-2.61.1/test/form/samples/nested-inlined-dynamic-import/_expected/es.js000066400000000000000000000003731415504077600272610ustar00rootroot00000000000000async 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-2.61.1/test/form/samples/nested-inlined-dynamic-import/_expected/iife.js000066400000000000000000000004541415504077600275660ustar00rootroot00000000000000(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-2.61.1/test/form/samples/nested-inlined-dynamic-import/_expected/system.js000066400000000000000000000006021415504077600301710ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/nested-inlined-dynamic-import/_expected/umd.js000066400000000000000000000006171415504077600274400ustar00rootroot00000000000000(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-2.61.1/test/form/samples/nested-inlined-dynamic-import/foo.js000066400000000000000000000000311415504077600254640ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/form/samples/nested-inlined-dynamic-import/main.js000066400000000000000000000001671415504077600256370ustar00rootroot00000000000000async function main() { const foo = 1; const ns = await import('./foo.js'); console.log(ns.value + foo); } main(); rollup-2.61.1/test/form/samples/nested-member-access/000077500000000000000000000000001415504077600225035ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/nested-member-access/_config.js000066400000000000000000000001411415504077600244410ustar00rootroot00000000000000module.exports = { description: 'throw an error when accessing members of null or undefined' }; rollup-2.61.1/test/form/samples/nested-member-access/_expected.js000066400000000000000000000005361415504077600250050ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/nested-member-access/main.js000066400000000000000000000016561415504077600237750ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/nested-pure-comments/000077500000000000000000000000001415504077600225735ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/nested-pure-comments/_config.js000066400000000000000000000001521415504077600245330ustar00rootroot00000000000000module.exports = { description: 'correctly associates pure comments before sequence expressions etc.' }; rollup-2.61.1/test/form/samples/nested-pure-comments/_expected.js000066400000000000000000000003611415504077600250710ustar00rootroot00000000000000// 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-2.61.1/test/form/samples/nested-pure-comments/main.js000066400000000000000000000013571415504077600240630ustar00rootroot00000000000000// 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-2.61.1/test/form/samples/nested-this-expressions/000077500000000000000000000000001415504077600233245ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/nested-this-expressions/_config.js000066400000000000000000000001301415504077600252600ustar00rootroot00000000000000module.exports = { description: 'properly keep or ignore nested "this"-expressions' }; rollup-2.61.1/test/form/samples/nested-this-expressions/_expected.js000066400000000000000000000006451415504077600256270ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/nested-this-expressions/main.js000066400000000000000000000015121415504077600246050ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/nested-tree-shaking/000077500000000000000000000000001415504077600223565ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/nested-tree-shaking/_config.js000066400000000000000000000001071415504077600243160ustar00rootroot00000000000000module.exports = { description: 'removes unused nested statements' }; rollup-2.61.1/test/form/samples/nested-tree-shaking/_expected.js000066400000000000000000000001741415504077600246560ustar00rootroot00000000000000function withEffects() { console.log('effect'); } if (globalThis.unknown > 0) { console.log('effect'); withEffects(); } rollup-2.61.1/test/form/samples/nested-tree-shaking/foo.js000066400000000000000000000002101415504077600234700ustar00rootroot00000000000000export function noEffects() { const foo = () => {}; foo(); } export function withEffects() { noEffects(); console.log('effect'); } rollup-2.61.1/test/form/samples/nested-tree-shaking/main.js000066400000000000000000000002671415504077600236450ustar00rootroot00000000000000import {noEffects, withEffects} from './foo.js'; if (globalThis.unknown > 0) { noEffects(); } if (globalThis.unknown > 0) { console.log('effect'); noEffects(); withEffects(); } rollup-2.61.1/test/form/samples/new-target-meta-property/000077500000000000000000000000001415504077600234005ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/new-target-meta-property/_config.js000066400000000000000000000001141415504077600253360ustar00rootroot00000000000000module.exports = { description: 'supports the new.target meta property' }; rollup-2.61.1/test/form/samples/new-target-meta-property/_expected.js000066400000000000000000000001161415504077600256740ustar00rootroot00000000000000class Foo { constructor() { console.log(new.target.name); } } new Foo(); rollup-2.61.1/test/form/samples/new-target-meta-property/main.js000066400000000000000000000001721415504077600246620ustar00rootroot00000000000000class Foo { constructor() { console.log(new.target.name); const unused = new.target.name; } } const x = new Foo(); rollup-2.61.1/test/form/samples/no-external-live-bindings-compact/000077500000000000000000000000001415504077600251255ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/no-external-live-bindings-compact/_config.js000066400000000000000000000004721415504077600270720ustar00rootroot00000000000000module.exports = { 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' } } }; rollup-2.61.1/test/form/samples/no-external-live-bindings-compact/_expected/000077500000000000000000000000001415504077600270655ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/no-external-live-bindings-compact/_expected/amd.js000066400000000000000000000011351415504077600301640ustar00rootroot00000000000000define(['require','exports','external1','external2'],(function(require,exports,external1,external2){'use strict';function _interopNamespace(e){if(e&&e.__esModule)return 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__*/_interopNamespace(m))},e)});exports.external1=external1.external1;exports.dynamic=dynamic;for(var k in external2){if(k!=='default'&&!exports.hasOwnProperty(k))exports[k]=external2[k]}Object.defineProperty(exports,'__esModule',{value:true});}));rollup-2.61.1/test/form/samples/no-external-live-bindings-compact/_expected/cjs.js000066400000000000000000000010601415504077600301770ustar00rootroot00000000000000'use strict';Object.defineProperty(exports,'__esModule',{value:true});var external1=require('external1'),external2=require('external2');function _interopNamespace(e){if(e&&e.__esModule)return 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__*/_interopNamespace(require('external3'))});exports.external1=external1.external1;exports.dynamic=dynamic;for(var k in external2){if(k!=='default'&&!exports.hasOwnProperty(k))exports[k]=external2[k]}rollup-2.61.1/test/form/samples/no-external-live-bindings-compact/_expected/es.js000066400000000000000000000001541415504077600300320ustar00rootroot00000000000000export{external1}from'external1';export*from'external2';const dynamic = import('external3');export{dynamic};rollup-2.61.1/test/form/samples/no-external-live-bindings-compact/_expected/iife.js000066400000000000000000000005411415504077600303370ustar00rootroot00000000000000var bundle=(function(exports,external1,external2){'use strict';const dynamic = import('external3');exports.external1=external1.external1;exports.dynamic=dynamic;for(var k in external2){if(k!=='default'&&!exports.hasOwnProperty(k))exports[k]=external2[k]}Object.defineProperty(exports,'__esModule',{value:true});return exports;})({},external1,external2);rollup-2.61.1/test/form/samples/no-external-live-bindings-compact/_expected/system.js000066400000000000000000000006571415504077600307570ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/no-external-live-bindings-compact/_expected/umd.js000066400000000000000000000011461415504077600302120ustar00rootroot00000000000000(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;for(var k in external2){if(k!=='default'&&!exports.hasOwnProperty(k))exports[k]=external2[k]}Object.defineProperty(exports,'__esModule',{value:true});}));rollup-2.61.1/test/form/samples/no-external-live-bindings-compact/main.js000066400000000000000000000001561415504077600264110ustar00rootroot00000000000000export { external1 } from 'external1'; export * from 'external2'; export const dynamic = import('external3'); rollup-2.61.1/test/form/samples/no-external-live-bindings/000077500000000000000000000000001415504077600235015ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/no-external-live-bindings/_config.js000066400000000000000000000004301415504077600254400ustar00rootroot00000000000000module.exports = { description: 'Allows omitting the code that handles external live bindings', options: { external: () => true, output: { globals: { external1: 'external1', external2: 'external2' }, externalLiveBindings: false, name: 'bundle' } } }; rollup-2.61.1/test/form/samples/no-external-live-bindings/_expected/000077500000000000000000000000001415504077600254415ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/no-external-live-bindings/_expected/amd.js000066400000000000000000000013471415504077600265450ustar00rootroot00000000000000define(['require', 'exports', 'external1', 'external2'], (function (require, exports, external1, external2) { 'use strict'; function _interopNamespace(e) { if (e && e.__esModule) return 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__*/_interopNamespace(m)); }, reject); }); exports.external1 = external1.external1; exports.dynamic = dynamic; for (var k in external2) { if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = external2[k]; } Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/no-external-live-bindings/_expected/cjs.js000066400000000000000000000012111415504077600265510ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var external1 = require('external1'); var external2 = require('external2'); function _interopNamespace(e) { if (e && e.__esModule) return 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__*/_interopNamespace(require('external3')); }); exports.external1 = external1.external1; exports.dynamic = dynamic; for (var k in external2) { if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = external2[k]; } rollup-2.61.1/test/form/samples/no-external-live-bindings/_expected/es.js000066400000000000000000000001751415504077600264110ustar00rootroot00000000000000export { external1 } from 'external1'; export * from 'external2'; const dynamic = import('external3'); export { dynamic }; rollup-2.61.1/test/form/samples/no-external-live-bindings/_expected/iife.js000066400000000000000000000006271415504077600267200ustar00rootroot00000000000000var bundle = (function (exports, external1, external2) { 'use strict'; const dynamic = import('external3'); exports.external1 = external1.external1; exports.dynamic = dynamic; for (var k in external2) { if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = external2[k]; } Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, external1, external2); rollup-2.61.1/test/form/samples/no-external-live-bindings/_expected/system.js000066400000000000000000000010221415504077600273160ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/no-external-live-bindings/_expected/umd.js000066400000000000000000000013711415504077600265660ustar00rootroot00000000000000(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; for (var k in external2) { if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = external2[k]; } Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/no-external-live-bindings/main.js000066400000000000000000000001561415504077600247650ustar00rootroot00000000000000export { external1 } from 'external1'; export * from 'external2'; export const dynamic = import('external3'); rollup-2.61.1/test/form/samples/no-imports-or-exports/000077500000000000000000000000001415504077600227445ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/no-imports-or-exports/_config.js000066400000000000000000000001131415504077600247010ustar00rootroot00000000000000module.exports = { description: 'single module, no imports or exports' }; rollup-2.61.1/test/form/samples/no-imports-or-exports/_expected/000077500000000000000000000000001415504077600247045ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/no-imports-or-exports/_expected/amd.js000066400000000000000000000001111415504077600257740ustar00rootroot00000000000000define((function () { 'use strict'; console.log( 'this is it' ); })); rollup-2.61.1/test/form/samples/no-imports-or-exports/_expected/cjs.js000066400000000000000000000000541415504077600260200ustar00rootroot00000000000000'use strict'; console.log( 'this is it' ); rollup-2.61.1/test/form/samples/no-imports-or-exports/_expected/es.js000066400000000000000000000000351415504077600256470ustar00rootroot00000000000000console.log( 'this is it' ); rollup-2.61.1/test/form/samples/no-imports-or-exports/_expected/iife.js000066400000000000000000000001041415504077600261510ustar00rootroot00000000000000(function () { 'use strict'; console.log( 'this is it' ); })(); rollup-2.61.1/test/form/samples/no-imports-or-exports/_expected/system.js000066400000000000000000000002061415504077600265640ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log( 'this is it' ); }) }; })); rollup-2.61.1/test/form/samples/no-imports-or-exports/_expected/umd.js000066400000000000000000000002471415504077600260320ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log( 'this is it' ); })); rollup-2.61.1/test/form/samples/no-imports-or-exports/main.js000066400000000000000000000000351415504077600242240ustar00rootroot00000000000000console.log( 'this is it' ); rollup-2.61.1/test/form/samples/no-treeshake-conflict/000077500000000000000000000000001415504077600227015ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/no-treeshake-conflict/_config.js000066400000000000000000000002751415504077600246470ustar00rootroot00000000000000module.exports = { description: 'does not introduce conflicting variables with treeshake: false', options: { output: { name: /* not shaken, but */ 'stirred' }, treeshake: false } }; rollup-2.61.1/test/form/samples/no-treeshake-conflict/_expected/000077500000000000000000000000001415504077600246415ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/no-treeshake-conflict/_expected/amd.js000066400000000000000000000002041415504077600257340ustar00rootroot00000000000000define((function () { 'use strict'; const other$1 = { something: 'here' }; const other = { somethingElse: 'here' }; })); rollup-2.61.1/test/form/samples/no-treeshake-conflict/_expected/cjs.js000066400000000000000000000001421415504077600257530ustar00rootroot00000000000000'use strict'; const other$1 = { something: 'here' }; const other = { somethingElse: 'here' }; rollup-2.61.1/test/form/samples/no-treeshake-conflict/_expected/es.js000066400000000000000000000001231415504077600256020ustar00rootroot00000000000000const other$1 = { something: 'here' }; const other = { somethingElse: 'here' }; rollup-2.61.1/test/form/samples/no-treeshake-conflict/_expected/iife.js000066400000000000000000000001771415504077600261200ustar00rootroot00000000000000(function () { 'use strict'; const other$1 = { something: 'here' }; const other = { somethingElse: 'here' }; })(); rollup-2.61.1/test/form/samples/no-treeshake-conflict/_expected/system.js000066400000000000000000000003261415504077600265240ustar00rootroot00000000000000System.register('stirred', [], (function () { 'use strict'; return { execute: (function () { const other$1 = { something: 'here' }; const other = { somethingElse: 'here' }; }) }; })); rollup-2.61.1/test/form/samples/no-treeshake-conflict/_expected/umd.js000066400000000000000000000003421415504077600257630ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; const other$1 = { something: 'here' }; const other = { somethingElse: 'here' }; })); rollup-2.61.1/test/form/samples/no-treeshake-conflict/main.js000066400000000000000000000001201415504077600241540ustar00rootroot00000000000000import somethingElse from './other'; const other = { somethingElse: 'here' }; rollup-2.61.1/test/form/samples/no-treeshake-conflict/other.js000066400000000000000000000000741415504077600243610ustar00rootroot00000000000000const other = { something: 'here' }; export default other;rollup-2.61.1/test/form/samples/no-treeshake-default-export-conflict/000077500000000000000000000000001415504077600256425ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/no-treeshake-default-export-conflict/_config.js000066400000000000000000000002041415504077600276000ustar00rootroot00000000000000module.exports = { description: 'properly deconflicts default exports when not tree-shaking', options: { treeshake: false } }; rollup-2.61.1/test/form/samples/no-treeshake-default-export-conflict/_expected.js000066400000000000000000000001131415504077600301330ustar00rootroot00000000000000function foo() { return 'foo'; } function foo$1() { return 'default'; } rollup-2.61.1/test/form/samples/no-treeshake-default-export-conflict/foo.js000066400000000000000000000001331415504077600267600ustar00rootroot00000000000000export function foo() { return 'foo'; } export default function() { return 'default'; } rollup-2.61.1/test/form/samples/no-treeshake-default-export-conflict/main.js000066400000000000000000000000201415504077600271140ustar00rootroot00000000000000import './foo'; rollup-2.61.1/test/form/samples/no-treeshake-include-labels/000077500000000000000000000000001415504077600237635ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/no-treeshake-include-labels/_config.js000066400000000000000000000002641415504077600257270ustar00rootroot00000000000000module.exports = { description: 'always includes labels when tree-shaking is turned off (#3473)', expectedWarnings: ['CIRCULAR_DEPENDENCY'], options: { treeshake: false } }; rollup-2.61.1/test/form/samples/no-treeshake-include-labels/_expected.js000066400000000000000000000003061415504077600262600ustar00rootroot00000000000000function foo() { loop: while (unknown) { if (unknown) { break loop; } bar(); } } function bar() { loop: while (unknown) { if (unknown) { break loop; } foo(); } } unused: { } rollup-2.61.1/test/form/samples/no-treeshake-include-labels/dep1.js000066400000000000000000000002111415504077600251440ustar00rootroot00000000000000import foo from './dep2.js'; export default function bar() { loop: while (unknown) { if (unknown) { break loop; } foo(); } } rollup-2.61.1/test/form/samples/no-treeshake-include-labels/dep2.js000066400000000000000000000002111415504077600251450ustar00rootroot00000000000000import bar from './dep1.js'; export default function foo() { loop: while (unknown) { if (unknown) { break loop; } bar(); } } rollup-2.61.1/test/form/samples/no-treeshake-include-labels/main.js000066400000000000000000000000411415504077600252400ustar00rootroot00000000000000import './dep1.js'; unused: { } rollup-2.61.1/test/form/samples/no-treeshake-namespace-object/000077500000000000000000000000001415504077600243005ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/no-treeshake-namespace-object/_config.js000066400000000000000000000001731415504077600262430ustar00rootroot00000000000000module.exports = { description: 'generates namespace objects when not tree-shaking', options: { treeshake: false } }; rollup-2.61.1/test/form/samples/no-treeshake-namespace-object/_expected.js000066400000000000000000000002611415504077600265750ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/no-treeshake-namespace-object/main.js000066400000000000000000000002031415504077600255550ustar00rootroot00000000000000import * as ns1 from './namespace'; export { ns1 }; export * as ns2 from './namespace'; export const a = 1; export const b = 2; rollup-2.61.1/test/form/samples/no-treeshake-namespace-object/namespace.js000066400000000000000000000000311415504077600265640ustar00rootroot00000000000000export function foo() {} rollup-2.61.1/test/form/samples/no-treeshake/000077500000000000000000000000001415504077600211025ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/no-treeshake/_config.js000066400000000000000000000003731415504077600230470ustar00rootroot00000000000000module.exports = { 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' } } }; rollup-2.61.1/test/form/samples/no-treeshake/_expected.js000066400000000000000000000014451415504077600234040ustar00rootroot00000000000000import * 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 {} export { create, getPrototypeOf, quux, quux as strange }; rollup-2.61.1/test/form/samples/no-treeshake/foo.js000066400000000000000000000000231415504077600222160ustar00rootroot00000000000000export default 13; rollup-2.61.1/test/form/samples/no-treeshake/main.js000066400000000000000000000014331415504077600223650ustar00rootroot00000000000000import * 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 {} rollup-2.61.1/test/form/samples/no-treeshake/quux.js000066400000000000000000000000621415504077600224400ustar00rootroot00000000000000export const quux = 1; const other = () => quux; rollup-2.61.1/test/form/samples/non-empty-block-statement/000077500000000000000000000000001415504077600235355ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/non-empty-block-statement/_config.js000066400000000000000000000001211415504077600254710ustar00rootroot00000000000000module.exports = { description: 'do not remove non an empty block statement' }; rollup-2.61.1/test/form/samples/non-empty-block-statement/_expected/000077500000000000000000000000001415504077600254755ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/non-empty-block-statement/_expected/amd.js000066400000000000000000000001511415504077600265710ustar00rootroot00000000000000define((function () { 'use strict'; console.log( 1 ); { var tmp = 10; } console.log( tmp ); })); rollup-2.61.1/test/form/samples/non-empty-block-statement/_expected/cjs.js000066400000000000000000000001101415504077600266020ustar00rootroot00000000000000'use strict'; console.log( 1 ); { var tmp = 10; } console.log( tmp ); rollup-2.61.1/test/form/samples/non-empty-block-statement/_expected/es.js000066400000000000000000000000711415504077600264400ustar00rootroot00000000000000console.log( 1 ); { var tmp = 10; } console.log( tmp ); rollup-2.61.1/test/form/samples/non-empty-block-statement/_expected/iife.js000066400000000000000000000001441415504077600267460ustar00rootroot00000000000000(function () { 'use strict'; console.log( 1 ); { var tmp = 10; } console.log( tmp ); })(); rollup-2.61.1/test/form/samples/non-empty-block-statement/_expected/system.js000066400000000000000000000002561415504077600273620ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log( 1 ); { var tmp = 10; } console.log( tmp ); }) }; })); rollup-2.61.1/test/form/samples/non-empty-block-statement/_expected/umd.js000066400000000000000000000003071415504077600266200ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log( 1 ); { var tmp = 10; } console.log( tmp ); })); rollup-2.61.1/test/form/samples/non-empty-block-statement/main.js000066400000000000000000000000711415504077600250150ustar00rootroot00000000000000console.log( 1 ); { var tmp = 10; } console.log( tmp ); rollup-2.61.1/test/form/samples/ns-external-star-reexport/000077500000000000000000000000001415504077600235725ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/ns-external-star-reexport/_config.js000066400000000000000000000006551415504077600255420ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/form/samples/ns-external-star-reexport/_expected/000077500000000000000000000000001415504077600255325ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/ns-external-star-reexport/_expected/amd.js000066400000000000000000000033731415504077600266370ustar00rootroot00000000000000define(['exports', 'external1', 'external2'], (function (exports, external1, external2) { 'use strict'; 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 external1__namespace = /*#__PURE__*/_interopNamespace(external1); var external2__namespace = /*#__PURE__*/_interopNamespace(external2); var reexportExternal = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null }, [external1__namespace])); const extra = 'extra'; const override = 'override'; var reexportExternalsWithOverride = { synthetic: 'synthetic' }; var reexportExternalsWithOverride$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, override: override, 'default': reexportExternalsWithOverride, extra: extra }, [reexportExternalsWithOverride, external1__namespace, external2__namespace])); exports.external = reexportExternal; exports.externalOverride = reexportExternalsWithOverride$1; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/ns-external-star-reexport/_expected/cjs.js000066400000000000000000000032701415504077600266510ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var external1 = require('external1'); var external2 = require('external2'); 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 external1__namespace = /*#__PURE__*/_interopNamespace(external1); var external2__namespace = /*#__PURE__*/_interopNamespace(external2); var reexportExternal = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null }, [external1__namespace])); const extra = 'extra'; const override = 'override'; var reexportExternalsWithOverride = { synthetic: 'synthetic' }; var reexportExternalsWithOverride$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, override: override, 'default': reexportExternalsWithOverride, extra: extra }, [reexportExternalsWithOverride, external1__namespace, external2__namespace])); exports.external = reexportExternal; exports.externalOverride = reexportExternalsWithOverride$1; rollup-2.61.1/test/form/samples/ns-external-star-reexport/_expected/es.js000066400000000000000000000020531415504077600264770ustar00rootroot00000000000000import * 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__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null }, [external1])); const extra = 'extra'; const override = 'override'; var reexportExternalsWithOverride = { synthetic: 'synthetic' }; var reexportExternalsWithOverride$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, override: override, 'default': reexportExternalsWithOverride, extra: extra }, [reexportExternalsWithOverride, external1, external2])); export { reexportExternal as external, reexportExternalsWithOverride$1 as externalOverride }; rollup-2.61.1/test/form/samples/ns-external-star-reexport/_expected/iife.js000066400000000000000000000034061415504077600270070ustar00rootroot00000000000000var bundle = (function (exports, external1, external2) { 'use strict'; 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 external1__namespace = /*#__PURE__*/_interopNamespace(external1); var external2__namespace = /*#__PURE__*/_interopNamespace(external2); var reexportExternal = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null }, [external1__namespace])); const extra = 'extra'; const override = 'override'; var reexportExternalsWithOverride = { synthetic: 'synthetic' }; var reexportExternalsWithOverride$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, override: override, 'default': reexportExternalsWithOverride, extra: extra }, [reexportExternalsWithOverride, external1__namespace, external2__namespace])); exports.external = reexportExternal; exports.externalOverride = reexportExternalsWithOverride$1; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, external1, external2); rollup-2.61.1/test/form/samples/ns-external-star-reexport/_expected/system.js000066400000000000000000000025131415504077600274150ustar00rootroot00000000000000System.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__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null }, [external1])); exports('external', reexportExternal); const extra = 'extra'; const override = 'override'; var reexportExternalsWithOverride = { synthetic: 'synthetic' }; var reexportExternalsWithOverride$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, override: override, 'default': reexportExternalsWithOverride, extra: extra }, [reexportExternalsWithOverride, external1, external2])); exports('externalOverride', reexportExternalsWithOverride$1); }) }; })); rollup-2.61.1/test/form/samples/ns-external-star-reexport/_expected/umd.js000066400000000000000000000041501415504077600266550ustar00rootroot00000000000000(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 _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 external1__namespace = /*#__PURE__*/_interopNamespace(external1); var external2__namespace = /*#__PURE__*/_interopNamespace(external2); var reexportExternal = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null }, [external1__namespace])); const extra = 'extra'; const override = 'override'; var reexportExternalsWithOverride = { synthetic: 'synthetic' }; var reexportExternalsWithOverride$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/_mergeNamespaces({ __proto__: null, override: override, 'default': reexportExternalsWithOverride, extra: extra }, [reexportExternalsWithOverride, external1__namespace, external2__namespace])); exports.external = reexportExternal; exports.externalOverride = reexportExternalsWithOverride$1; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/ns-external-star-reexport/extra.js000066400000000000000000000000361415504077600252520ustar00rootroot00000000000000export const extra = 'extra'; rollup-2.61.1/test/form/samples/ns-external-star-reexport/main.js000066400000000000000000000001771415504077600250610ustar00rootroot00000000000000export * as external from './reexport-external.js'; export * as externalOverride from './reexport-externals-with-override.js'; rollup-2.61.1/test/form/samples/ns-external-star-reexport/reexport-external.js000066400000000000000000000000331415504077600276140ustar00rootroot00000000000000export * from 'external1'; rollup-2.61.1/test/form/samples/ns-external-star-reexport/reexport-externals-with-override.js000066400000000000000000000002421415504077600325670ustar00rootroot00000000000000export * from 'external1'; export * from 'external2'; export * from './extra.js'; export const override = 'override'; export default { synthetic: 'synthetic' }; rollup-2.61.1/test/form/samples/nullish-coalescing/000077500000000000000000000000001415504077600223005ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/nullish-coalescing/_config.js000066400000000000000000000001241415504077600242370ustar00rootroot00000000000000module.exports = { description: 'supports tree-shaking with nullish-coalescing' }; rollup-2.61.1/test/form/samples/nullish-coalescing/_expected.js000066400000000000000000000004221415504077600245740ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/nullish-coalescing/main.js000066400000000000000000000005731415504077600235670ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/numeric_separators/000077500000000000000000000000001415504077600224225ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/numeric_separators/_config.js000066400000000000000000000001021415504077600243550ustar00rootroot00000000000000module.exports = { description: 'supports numeric separators' }; rollup-2.61.1/test/form/samples/numeric_separators/_expected.js000066400000000000000000000000421415504077600247140ustar00rootroot00000000000000const x = 123_456; export { x }; rollup-2.61.1/test/form/samples/numeric_separators/main.js000066400000000000000000000000321415504077600236770ustar00rootroot00000000000000export const x = 123_456; rollup-2.61.1/test/form/samples/object-destructuring-default-values/000077500000000000000000000000001415504077600256025ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/object-destructuring-default-values/_config.js000066400000000000000000000001301415504077600275360ustar00rootroot00000000000000module.exports = { description: 'object destructuring default values are preserved' }; rollup-2.61.1/test/form/samples/object-destructuring-default-values/_expected/000077500000000000000000000000001415504077600275425ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/object-destructuring-default-values/_expected/amd.js000066400000000000000000000002111415504077600306330ustar00rootroot00000000000000define((function () { 'use strict'; const a = 1; const b = 2; const { c = a } = {}; const [ d = b ] = []; console.log(c, d); })); rollup-2.61.1/test/form/samples/object-destructuring-default-values/_expected/cjs.js000066400000000000000000000001501415504077600306530ustar00rootroot00000000000000'use strict'; const a = 1; const b = 2; const { c = a } = {}; const [ d = b ] = []; console.log(c, d); rollup-2.61.1/test/form/samples/object-destructuring-default-values/_expected/es.js000066400000000000000000000001311415504077600305020ustar00rootroot00000000000000const a = 1; const b = 2; const { c = a } = {}; const [ d = b ] = []; console.log(c, d); rollup-2.61.1/test/form/samples/object-destructuring-default-values/_expected/iife.js000066400000000000000000000002041415504077600310100ustar00rootroot00000000000000(function () { 'use strict'; const a = 1; const b = 2; const { c = a } = {}; const [ d = b ] = []; console.log(c, d); })(); rollup-2.61.1/test/form/samples/object-destructuring-default-values/_expected/system.js000066400000000000000000000003161415504077600314240ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { const a = 1; const b = 2; const { c = a } = {}; const [ d = b ] = []; console.log(c, d); }) }; })); rollup-2.61.1/test/form/samples/object-destructuring-default-values/_expected/umd.js000066400000000000000000000003471415504077600306710ustar00rootroot00000000000000(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-2.61.1/test/form/samples/object-destructuring-default-values/main.js000066400000000000000000000001311415504077600270570ustar00rootroot00000000000000const a = 1; const b = 2; const { c = a } = {}; const [ d = b ] = []; console.log(c, d); rollup-2.61.1/test/form/samples/object-expression/000077500000000000000000000000001415504077600221605ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/object-expression/computed-properties/000077500000000000000000000000001415504077600261725ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/object-expression/computed-properties/_config.js000066400000000000000000000001221415504077600301270ustar00rootroot00000000000000module.exports = { description: 'Associates non-string keys with string keys' }; rollup-2.61.1/test/form/samples/object-expression/computed-properties/_expected.js000066400000000000000000000001531415504077600304670ustar00rootroot00000000000000{ console.log('kept'); } { console.log('kept'); } { console.log('kept'); } { console.log('kept'); } rollup-2.61.1/test/form/samples/object-expression/computed-properties/main.js000066400000000000000000000005201415504077600274510ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/object-expression/method-side-effects/000077500000000000000000000000001415504077600257775ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/object-expression/method-side-effects/_config.js000066400000000000000000000001111415504077600277320ustar00rootroot00000000000000module.exports = { description: 'Track side-effects of method calls' }; rollup-2.61.1/test/form/samples/object-expression/method-side-effects/_expected.js000066400000000000000000000002651415504077600303000ustar00rootroot00000000000000const y = { a() {}, b: () => {}, [globalThis.unknown]() { console.log('effect'); } }; y.a(); y.b(); const z = { [globalThis.unknown]() {} }; z.a(); z.hasOwnProperty('a'); rollup-2.61.1/test/form/samples/object-expression/method-side-effects/main.js000066400000000000000000000004411415504077600272600ustar00rootroot00000000000000const 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'); rollup-2.61.1/test/form/samples/object-expression/proto-property/000077500000000000000000000000001415504077600252055ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/object-expression/proto-property/_config.js000066400000000000000000000001101415504077600271370ustar00rootroot00000000000000module.exports = { description: 'Deoptimize when __proto__ is used' }; rollup-2.61.1/test/form/samples/object-expression/proto-property/_expected.js000066400000000000000000000003111415504077600274760ustar00rootroot00000000000000let proto = { get a() { log(); } }; let plainProto = { __proto__: proto }; if (plainProto.a) log("plainProto"); let quotedProto = { "__proto__": proto }; if (quotedProto.a) log("quotedProto"); rollup-2.61.1/test/form/samples/object-expression/proto-property/main.js000066400000000000000000000004011415504077600264620ustar00rootroot00000000000000let 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-2.61.1/test/form/samples/object-expression/reassign-prop-without-proto/000077500000000000000000000000001415504077600276135ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/object-expression/reassign-prop-without-proto/_config.js000066400000000000000000000001231415504077600315510ustar00rootroot00000000000000module.exports = { description: 'correctly deoptimizes when there is no proto' }; rollup-2.61.1/test/form/samples/object-expression/reassign-prop-without-proto/_expected.js000066400000000000000000000001371415504077600321120ustar00rootroot00000000000000const obj = { __proto__: null }; obj.flag = true; if (obj.flag) { console.log('mutated'); } rollup-2.61.1/test/form/samples/object-expression/reassign-prop-without-proto/main.js000066400000000000000000000001371415504077600310760ustar00rootroot00000000000000const obj = { __proto__: null }; obj.flag = true; if (obj.flag) { console.log('mutated'); } rollup-2.61.1/test/form/samples/object-expression/return-expressions/000077500000000000000000000000001415504077600260575ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/object-expression/return-expressions/_config.js000066400000000000000000000001211415504077600300130ustar00rootroot00000000000000module.exports = { description: 'Track side-effects of method return values' }; rollup-2.61.1/test/form/samples/object-expression/return-expressions/_expected.js000066400000000000000000000005261415504077600303600ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/object-expression/return-expressions/main.js000066400000000000000000000007451415504077600273470ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/object-expression/unknown-getter-no-side-effect/000077500000000000000000000000001415504077600277355ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/object-expression/unknown-getter-no-side-effect/_config.js000066400000000000000000000001761415504077600317030ustar00rootroot00000000000000module.exports = { description: 'removes unknown getter access without side effect', options: { external: ['external'] } }; rollup-2.61.1/test/form/samples/object-expression/unknown-getter-no-side-effect/_expected.js000066400000000000000000000000231415504077600322260ustar00rootroot00000000000000import 'external'; rollup-2.61.1/test/form/samples/object-expression/unknown-getter-no-side-effect/main.js000066400000000000000000000001251415504077600312150ustar00rootroot00000000000000import { unknown } from 'external'; const obj = { get [unknown]() {} }; obj.prop; rollup-2.61.1/test/form/samples/object-expression/unknown-setter-no-side-effect/000077500000000000000000000000001415504077600277515ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/object-expression/unknown-setter-no-side-effect/_config.js000066400000000000000000000001761415504077600317170ustar00rootroot00000000000000module.exports = { description: 'removes unknown setter access without side effect', options: { external: ['external'] } }; rollup-2.61.1/test/form/samples/object-expression/unknown-setter-no-side-effect/_expected.js000066400000000000000000000000231415504077600322420ustar00rootroot00000000000000import 'external'; rollup-2.61.1/test/form/samples/object-expression/unknown-setter-no-side-effect/main.js000066400000000000000000000001411415504077600312270ustar00rootroot00000000000000import { unknown } from 'external'; const obj = { set [unknown](value) {} }; obj.prop = true; rollup-2.61.1/test/form/samples/object-literal-property-overwrites/000077500000000000000000000000001415504077600255065ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/object-literal-property-overwrites/_config.js000066400000000000000000000001471415504077600274520ustar00rootroot00000000000000module.exports = { description: 'detect side-effects in overwritten properties of object literals' }; rollup-2.61.1/test/form/samples/object-literal-property-overwrites/_expected.js000066400000000000000000000011021415504077600277760ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/object-literal-property-overwrites/main.js000066400000000000000000000023071415504077600267720ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/optional-chaining/000077500000000000000000000000001415504077600221205ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/optional-chaining/_config.js000066400000000000000000000001011415504077600240520ustar00rootroot00000000000000module.exports = { description: 'supports optional chaining' }; rollup-2.61.1/test/form/samples/optional-chaining/_expected.js000066400000000000000000000000531415504077600244140ustar00rootroot00000000000000const obj = {}; obj.foo?.bar; obj.foo?.(); rollup-2.61.1/test/form/samples/optional-chaining/main.js000066400000000000000000000000641415504077600234020ustar00rootroot00000000000000const obj = {}; obj?.foo obj.foo?.bar; obj.foo?.(); rollup-2.61.1/test/form/samples/output-named-library/000077500000000000000000000000001415504077600226015ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/output-named-library/_config.js000066400000000000000000000001651415504077600245450ustar00rootroot00000000000000module.exports = { description: 'names bundles correctly', options: { output: { name: 'libraryName' } } }; rollup-2.61.1/test/form/samples/output-named-library/_expected/000077500000000000000000000000001415504077600245415ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/output-named-library/_expected/amd.js000066400000000000000000000002731415504077600256420ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; const valueOnLib = 42; exports.valueOnLib = valueOnLib; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/output-named-library/_expected/cjs.js000066400000000000000000000002101415504077600256470ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const valueOnLib = 42; exports.valueOnLib = valueOnLib; rollup-2.61.1/test/form/samples/output-named-library/_expected/es.js000066400000000000000000000000571415504077600255100ustar00rootroot00000000000000const valueOnLib = 42; export { valueOnLib }; rollup-2.61.1/test/form/samples/output-named-library/_expected/iife.js000066400000000000000000000003171415504077600260140ustar00rootroot00000000000000var libraryName = (function (exports) { 'use strict'; const valueOnLib = 42; exports.valueOnLib = valueOnLib; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/output-named-library/_expected/system.js000066400000000000000000000002551415504077600264250ustar00rootroot00000000000000System.register('libraryName', [], (function (exports) { 'use strict'; return { execute: (function () { const valueOnLib = exports('valueOnLib', 42); }) }; })); rollup-2.61.1/test/form/samples/output-named-library/_expected/umd.js000066400000000000000000000007351415504077600256710ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/output-named-library/main.js000066400000000000000000000000351415504077600240610ustar00rootroot00000000000000export const valueOnLib = 42 rollup-2.61.1/test/form/samples/override-external-namespace/000077500000000000000000000000001415504077600241065ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/override-external-namespace/_config.js000066400000000000000000000003201415504077600260430ustar00rootroot00000000000000module.exports = { description: 'allows overriding imports of external namespace reexports', options: { external: 'external', output: { name: 'bundle', globals: { external: 'external' } } } }; rollup-2.61.1/test/form/samples/override-external-namespace/_expected/000077500000000000000000000000001415504077600260465ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/override-external-namespace/_expected/amd.js000066400000000000000000000010141415504077600271410ustar00rootroot00000000000000define(['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' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/override-external-namespace/_expected/cjs.js000066400000000000000000000007351415504077600271700ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); rollup-2.61.1/test/form/samples/override-external-namespace/_expected/es.js000066400000000000000000000002051415504077600270100ustar00rootroot00000000000000export * from 'external'; const a = 'defined'; let b; var c; const reassign = () => (b = 'defined'); export { a, b, c, reassign }; rollup-2.61.1/test/form/samples/override-external-namespace/_expected/iife.js000066400000000000000000000010311415504077600273130ustar00rootroot00000000000000var 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' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, external); rollup-2.61.1/test/form/samples/override-external-namespace/_expected/system.js000066400000000000000000000010501415504077600277240ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/override-external-namespace/_expected/umd.js000066400000000000000000000015171415504077600271750ustar00rootroot00000000000000(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' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/override-external-namespace/main.js000066400000000000000000000002011415504077600253610ustar00rootroot00000000000000export * from 'external'; export const a = 'defined'; export let b; export var c; export const reassign = () => (b = 'defined'); rollup-2.61.1/test/form/samples/paths-function/000077500000000000000000000000001415504077600214575ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/paths-function/_config.js000066400000000000000000000002671415504077600234260ustar00rootroot00000000000000module.exports = { description: 'external paths (#754)', options: { external: ['foo'], output: { globals: { foo: 'foo' }, paths: id => `https://unpkg.com/${id}` } } }; rollup-2.61.1/test/form/samples/paths-function/_expected/000077500000000000000000000000001415504077600234175ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/paths-function/_expected/amd.js000066400000000000000000000016511415504077600245210ustar00rootroot00000000000000define(['require', 'https://unpkg.com/foo'], (function (require, foo) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? 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 foo__default = /*#__PURE__*/_interopDefaultLegacy(foo); assert.equal(foo__default["default"], 42); new Promise(function (resolve, reject) { require(['https://unpkg.com/foo'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }).then(({ default: foo }) => assert.equal(foo, 42)); })); rollup-2.61.1/test/form/samples/paths-function/_expected/cjs.js000066400000000000000000000015161415504077600245370ustar00rootroot00000000000000'use strict'; var foo = require('https://unpkg.com/foo'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? 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 foo__default = /*#__PURE__*/_interopDefaultLegacy(foo); assert.equal(foo__default["default"], 42); Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('https://unpkg.com/foo')); }).then(({ default: foo }) => assert.equal(foo, 42)); rollup-2.61.1/test/form/samples/paths-function/_expected/es.js000066400000000000000000000002251415504077600243630ustar00rootroot00000000000000import foo from 'https://unpkg.com/foo'; assert.equal(foo, 42); import('https://unpkg.com/foo').then(({ default: foo }) => assert.equal(foo, 42)); rollup-2.61.1/test/form/samples/paths-function/_expected/iife.js000066400000000000000000000005401415504077600246700ustar00rootroot00000000000000(function (foo) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var foo__default = /*#__PURE__*/_interopDefaultLegacy(foo); assert.equal(foo__default["default"], 42); import('https://unpkg.com/foo').then(({ default: foo }) => assert.equal(foo, 42)); })(foo); rollup-2.61.1/test/form/samples/paths-function/_expected/system.js000066400000000000000000000005201415504077600252760ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/paths-function/_expected/umd.js000066400000000000000000000012531415504077600245430ustar00rootroot00000000000000(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'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var foo__default = /*#__PURE__*/_interopDefaultLegacy(foo); assert.equal(foo__default["default"], 42); import('https://unpkg.com/foo').then(({ default: foo }) => assert.equal(foo, 42)); })); rollup-2.61.1/test/form/samples/paths-function/main.js000066400000000000000000000001611415504077600227370ustar00rootroot00000000000000import foo from 'foo'; assert.equal(foo, 42); import('foo').then(({ default: foo }) => assert.equal(foo, 42)); rollup-2.61.1/test/form/samples/paths-relative/000077500000000000000000000000001415504077600214455ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/paths-relative/_config.js000066400000000000000000000004201415504077600234030ustar00rootroot00000000000000const { resolve } = require('path'); const resolved = resolve(__dirname, 'foo.js'); module.exports = { description: 'external paths (#754)', options: { external: [resolved], output: { globals: { [resolved]: 'foo' }, paths: { [resolved]: '../foo' } } } }; rollup-2.61.1/test/form/samples/paths-relative/_expected/000077500000000000000000000000001415504077600234055ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/paths-relative/_expected/amd.js000066400000000000000000000004331415504077600245040ustar00rootroot00000000000000define(['../foo'], (function (foo) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var foo__default = /*#__PURE__*/_interopDefaultLegacy(foo); assert.equal( foo__default["default"], 42 ); })); rollup-2.61.1/test/form/samples/paths-relative/_expected/cjs.js000066400000000000000000000004131415504077600245200ustar00rootroot00000000000000'use strict'; var foo = require('../foo'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var foo__default = /*#__PURE__*/_interopDefaultLegacy(foo); assert.equal( foo__default["default"], 42 ); rollup-2.61.1/test/form/samples/paths-relative/_expected/es.js000066400000000000000000000000641415504077600243520ustar00rootroot00000000000000import foo from '../foo'; assert.equal( foo, 42 ); rollup-2.61.1/test/form/samples/paths-relative/_expected/iife.js000066400000000000000000000004151415504077600246570ustar00rootroot00000000000000(function (foo) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var foo__default = /*#__PURE__*/_interopDefaultLegacy(foo); assert.equal( foo__default["default"], 42 ); })(foo); rollup-2.61.1/test/form/samples/paths-relative/_expected/system.js000066400000000000000000000003261415504077600252700ustar00rootroot00000000000000System.register(['../foo'], (function () { 'use strict'; var foo; return { setters: [function (module) { foo = module["default"]; }], execute: (function () { assert.equal( foo, 42 ); }) }; })); rollup-2.61.1/test/form/samples/paths-relative/_expected/umd.js000066400000000000000000000010721415504077600245300ustar00rootroot00000000000000(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 _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var foo__default = /*#__PURE__*/_interopDefaultLegacy(foo); assert.equal( foo__default["default"], 42 ); })); rollup-2.61.1/test/form/samples/paths-relative/main.js000066400000000000000000000000661415504077600227310ustar00rootroot00000000000000import foo from './foo.js'; assert.equal( foo, 42 ); rollup-2.61.1/test/form/samples/paths/000077500000000000000000000000001415504077600176345ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/paths/_config.js000066400000000000000000000002701415504077600215750ustar00rootroot00000000000000module.exports = { description: 'external paths (#754)', options: { external: ['foo'], output: { globals: { foo: 'foo' }, paths: { foo: 'https://unpkg.com/foo' } } } }; rollup-2.61.1/test/form/samples/paths/_expected/000077500000000000000000000000001415504077600215745ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/paths/_expected/amd.js000066400000000000000000000004521415504077600226740ustar00rootroot00000000000000define(['https://unpkg.com/foo'], (function (foo) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var foo__default = /*#__PURE__*/_interopDefaultLegacy(foo); assert.equal( foo__default["default"], 42 ); })); rollup-2.61.1/test/form/samples/paths/_expected/cjs.js000066400000000000000000000004321415504077600227100ustar00rootroot00000000000000'use strict'; var foo = require('https://unpkg.com/foo'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var foo__default = /*#__PURE__*/_interopDefaultLegacy(foo); assert.equal( foo__default["default"], 42 ); rollup-2.61.1/test/form/samples/paths/_expected/es.js000066400000000000000000000001031415504077600225330ustar00rootroot00000000000000import foo from 'https://unpkg.com/foo'; assert.equal( foo, 42 ); rollup-2.61.1/test/form/samples/paths/_expected/iife.js000066400000000000000000000004151415504077600230460ustar00rootroot00000000000000(function (foo) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var foo__default = /*#__PURE__*/_interopDefaultLegacy(foo); assert.equal( foo__default["default"], 42 ); })(foo); rollup-2.61.1/test/form/samples/paths/_expected/system.js000066400000000000000000000003451415504077600234600ustar00rootroot00000000000000System.register(['https://unpkg.com/foo'], (function () { 'use strict'; var foo; return { setters: [function (module) { foo = module["default"]; }], execute: (function () { assert.equal( foo, 42 ); }) }; })); rollup-2.61.1/test/form/samples/paths/_expected/umd.js000066400000000000000000000011301415504077600227120ustar00rootroot00000000000000(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'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var foo__default = /*#__PURE__*/_interopDefaultLegacy(foo); assert.equal( foo__default["default"], 42 ); })); rollup-2.61.1/test/form/samples/paths/main.js000066400000000000000000000000611415504077600211130ustar00rootroot00000000000000import foo from 'foo'; assert.equal( foo, 42 ); rollup-2.61.1/test/form/samples/pattern-assignments/000077500000000000000000000000001415504077600225235ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/pattern-assignments/_config.js000066400000000000000000000002221415504077600244610ustar00rootroot00000000000000module.exports = { description: 'Make sure side-effects are passed along destructuring assignments', options: { output: { name: 'bundle' } } }; rollup-2.61.1/test/form/samples/pattern-assignments/_expected/000077500000000000000000000000001415504077600244635ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/pattern-assignments/_expected/amd.js000066400000000000000000000011521415504077600255610ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/pattern-assignments/_expected/cjs.js000066400000000000000000000010341415504077600255760ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/form/samples/pattern-assignments/_expected/es.js000066400000000000000000000006501415504077600254310ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/pattern-assignments/_expected/iife.js000066400000000000000000000011711415504077600257350ustar00rootroot00000000000000var 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; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/pattern-assignments/_expected/system.js000066400000000000000000000012121415504077600263410ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/pattern-assignments/_expected/umd.js000066400000000000000000000016071415504077600256120ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/pattern-assignments/main.js000066400000000000000000000006541415504077600240120ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/pattern-member-expressions/000077500000000000000000000000001415504077600240175ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/pattern-member-expressions/_config.js000066400000000000000000000001251415504077600257570ustar00rootroot00000000000000module.exports = { description: 'handles member expressions in patterns (#2750)' }; rollup-2.61.1/test/form/samples/pattern-member-expressions/_expected.js000066400000000000000000000005511415504077600263160ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/pattern-member-expressions/main.js000066400000000000000000000005511415504077600253020ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/per-output-plugins/000077500000000000000000000000001415504077600223205ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/per-output-plugins/_config.js000066400000000000000000000006131415504077600242620ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/form/samples/per-output-plugins/_expected/000077500000000000000000000000001415504077600242605ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/per-output-plugins/_expected/amd.js000066400000000000000000000001111415504077600253500ustar00rootroot00000000000000define((function () { 'use strict'; console.log('amd', '!amd!'); })); rollup-2.61.1/test/form/samples/per-output-plugins/_expected/cjs.js000066400000000000000000000000541415504077600253740ustar00rootroot00000000000000'use strict'; console.log('cjs', '!cjs!'); rollup-2.61.1/test/form/samples/per-output-plugins/_expected/es.js000066400000000000000000000000331415504077600252210ustar00rootroot00000000000000console.log('es', '!es!'); rollup-2.61.1/test/form/samples/per-output-plugins/_expected/iife.js000066400000000000000000000001061415504077600255270ustar00rootroot00000000000000(function () { 'use strict'; console.log('iife', '!iife!'); })(); rollup-2.61.1/test/form/samples/per-output-plugins/_expected/system.js000066400000000000000000000002141415504077600261370ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('system', '!system!'); }) }; })); rollup-2.61.1/test/form/samples/per-output-plugins/_expected/umd.js000066400000000000000000000002471415504077600254060ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log('umd', '!umd!'); })); rollup-2.61.1/test/form/samples/per-output-plugins/main.js000066400000000000000000000000251415504077600235770ustar00rootroot00000000000000console.log(42, 43); rollup-2.61.1/test/form/samples/preserve-asm-js/000077500000000000000000000000001415504077600215405ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/preserve-asm-js/_config.js000066400000000000000000000001041415504077600234750ustar00rootroot00000000000000module.exports = { description: 'Preserves asm.js code (#3360)' }; rollup-2.61.1/test/form/samples/preserve-asm-js/_expected.js000066400000000000000000000006651415504077600240450ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/preserve-asm-js/main.js000066400000000000000000000010351415504077600230210ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/preserve-debugger/000077500000000000000000000000001415504077600221325ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/preserve-debugger/_config.js000066400000000000000000000001171415504077600240730ustar00rootroot00000000000000module.exports = { description: 'debugger statements are preserved (#664)' }; rollup-2.61.1/test/form/samples/preserve-debugger/_expected/000077500000000000000000000000001415504077600240725ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/preserve-debugger/_expected/amd.js000066400000000000000000000001131415504077600251640ustar00rootroot00000000000000define((function () { 'use strict'; before(); debugger; after(); })); rollup-2.61.1/test/form/samples/preserve-debugger/_expected/cjs.js000066400000000000000000000000541415504077600252060ustar00rootroot00000000000000'use strict'; before(); debugger; after(); rollup-2.61.1/test/form/samples/preserve-debugger/_expected/es.js000066400000000000000000000000351415504077600250350ustar00rootroot00000000000000before(); debugger; after(); rollup-2.61.1/test/form/samples/preserve-debugger/_expected/iife.js000066400000000000000000000001061415504077600253410ustar00rootroot00000000000000(function () { 'use strict'; before(); debugger; after(); })(); rollup-2.61.1/test/form/samples/preserve-debugger/_expected/system.js000066400000000000000000000002141415504077600257510ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { before(); debugger; after(); }) }; })); rollup-2.61.1/test/form/samples/preserve-debugger/_expected/umd.js000066400000000000000000000002511415504077600252130ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; before(); debugger; after(); })); rollup-2.61.1/test/form/samples/preserve-debugger/main.js000066400000000000000000000000351415504077600234120ustar00rootroot00000000000000before(); debugger; after(); rollup-2.61.1/test/form/samples/preserves-comments-after-imports/000077500000000000000000000000001415504077600251505ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/preserves-comments-after-imports/_config.js000066400000000000000000000003011415504077600271040ustar00rootroot00000000000000module.exports = { description: 'preserves comments between imports and first statement', options: { output: { name: 'myBundle' } } }; // https://github.com/esperantojs/esperanto/issues/187 rollup-2.61.1/test/form/samples/preserves-comments-after-imports/_expected/000077500000000000000000000000001415504077600271105ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/preserves-comments-after-imports/_expected/amd.js000066400000000000000000000003671415504077600302150ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; /** A comment for a number */ var number = 5; /** A comment for obj */ var obj = { number }; exports.obj = obj; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/preserves-comments-after-imports/_expected/cjs.js000066400000000000000000000003011415504077600302170ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); /** A comment for a number */ var number = 5; /** A comment for obj */ var obj = { number }; exports.obj = obj; rollup-2.61.1/test/form/samples/preserves-comments-after-imports/_expected/es.js000066400000000000000000000001571415504077600300600ustar00rootroot00000000000000/** A comment for a number */ var number = 5; /** A comment for obj */ var obj = { number }; export { obj }; rollup-2.61.1/test/form/samples/preserves-comments-after-imports/_expected/iife.js000066400000000000000000000004101415504077600303550ustar00rootroot00000000000000var myBundle = (function (exports) { 'use strict'; /** A comment for a number */ var number = 5; /** A comment for obj */ var obj = { number }; exports.obj = obj; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/preserves-comments-after-imports/_expected/system.js000066400000000000000000000003631415504077600307740ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/preserves-comments-after-imports/_expected/umd.js000066400000000000000000000010261415504077600302320ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/preserves-comments-after-imports/main.js000066400000000000000000000001501415504077600264260ustar00rootroot00000000000000import { number } from './number.js'; /** A comment for obj */ var obj = { number }; export { obj }; rollup-2.61.1/test/form/samples/preserves-comments-after-imports/number.js000066400000000000000000000001031415504077600267700ustar00rootroot00000000000000/** A comment for a number */ var number = 5; export { number }; rollup-2.61.1/test/form/samples/probe-external-namespace/000077500000000000000000000000001415504077600233765ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/probe-external-namespace/_config.js000066400000000000000000000002351415504077600253400ustar00rootroot00000000000000module.exports = { description: 'allow probing external namespaces without causing errors due to missing imports', options: { external: 'external' } }; rollup-2.61.1/test/form/samples/probe-external-namespace/_expected/000077500000000000000000000000001415504077600253365ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/probe-external-namespace/_expected/amd.js000066400000000000000000000011551415504077600264370ustar00rootroot00000000000000define(['external'], (function (external) { 'use strict'; 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__namespace = /*#__PURE__*/_interopNamespace(external); console.log(external__namespace.default, external__namespace.foo); })); rollup-2.61.1/test/form/samples/probe-external-namespace/_expected/cjs.js000066400000000000000000000011151415504077600264510ustar00rootroot00000000000000'use strict'; var external = require('external'); 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__namespace = /*#__PURE__*/_interopNamespace(external); console.log(external__namespace.default, external__namespace.foo); rollup-2.61.1/test/form/samples/probe-external-namespace/_expected/es.js000066400000000000000000000001241415504077600263000ustar00rootroot00000000000000import * as external from 'external'; console.log(external.default, external.foo); rollup-2.61.1/test/form/samples/probe-external-namespace/_expected/iife.js000066400000000000000000000011421415504077600266060ustar00rootroot00000000000000(function (external) { 'use strict'; 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__namespace = /*#__PURE__*/_interopNamespace(external); console.log(external__namespace.default, external__namespace.foo); })(external); rollup-2.61.1/test/form/samples/probe-external-namespace/_expected/system.js000066400000000000000000000003531415504077600272210ustar00rootroot00000000000000System.register(['external'], (function () { 'use strict'; var external; return { setters: [function (module) { external = module; }], execute: (function () { console.log(external.default, external.foo); }) }; })); rollup-2.61.1/test/form/samples/probe-external-namespace/_expected/umd.js000066400000000000000000000016231415504077600264630ustar00rootroot00000000000000(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 _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__namespace = /*#__PURE__*/_interopNamespace(external); console.log(external__namespace.default, external__namespace.foo); })); rollup-2.61.1/test/form/samples/probe-external-namespace/main.js000066400000000000000000000001241415504077600246550ustar00rootroot00000000000000import * as external from 'external'; console.log(external.default, external.foo); rollup-2.61.1/test/form/samples/promises/000077500000000000000000000000001415504077600203565ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/promises/_config.js000066400000000000000000000001061415504077600223150ustar00rootroot00000000000000module.exports = { description: 'do not remove promise creations' }; rollup-2.61.1/test/form/samples/promises/_expected.js000066400000000000000000000007431415504077600226600ustar00rootroot00000000000000Promise.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-2.61.1/test/form/samples/promises/main.js000066400000000000000000000007431415504077600216440ustar00rootroot00000000000000Promise.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-2.61.1/test/form/samples/proper-this-context/000077500000000000000000000000001415504077600224535ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/proper-this-context/_config.js000066400000000000000000000002121415504077600244100ustar00rootroot00000000000000module.exports = { description: 'make sure "this" respects the context for arrow functions', expectedWarnings: ['THIS_IS_UNDEFINED'] }; rollup-2.61.1/test/form/samples/proper-this-context/_expected.js000066400000000000000000000001421415504077600247460ustar00rootroot00000000000000const mutateThis = () => { undefined.x = 1; }; function Test () { mutateThis(); } new Test(); rollup-2.61.1/test/form/samples/proper-this-context/main.js000066400000000000000000000001521415504077600237330ustar00rootroot00000000000000const mutateThis = () => { this.x = 1; }; function Test () { mutateThis(); } const test = new Test(); rollup-2.61.1/test/form/samples/property-setters-and-getters/000077500000000000000000000000001415504077600243035ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/property-setters-and-getters/access-when-called-effect/000077500000000000000000000000001415504077600311575ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/property-setters-and-getters/access-when-called-effect/_config.js000066400000000000000000000001311415504077600331140ustar00rootroot00000000000000module.exports = { description: 'respects access side-effects when calling a getter' }; rollup-2.61.1/test/form/samples/property-setters-and-getters/access-when-called-effect/_expected.js000066400000000000000000000007521415504077600334610ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/property-setters-and-getters/access-when-called-effect/main.js000066400000000000000000000007521415504077600324450ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/property-setters-and-getters/early-access-getter-return/000077500000000000000000000000001415504077600314635ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/property-setters-and-getters/early-access-getter-return/_config.js000066400000000000000000000001631415504077600334250ustar00rootroot00000000000000module.exports = { description: 'handles accessing the return expression of a getter before it has been bound' }; rollup-2.61.1/test/form/samples/property-setters-and-getters/early-access-getter-return/_expected.js000066400000000000000000000001601415504077600337560ustar00rootroot00000000000000function getReturnExpressionBeforeInit() { { console.log('retained'); } } getReturnExpressionBeforeInit(); rollup-2.61.1/test/form/samples/property-setters-and-getters/early-access-getter-return/main.js000066400000000000000000000003401415504077600327420ustar00rootroot00000000000000function getReturnExpressionBeforeInit() { const bar = { [foo.value()]: true }; if (bar.baz) { console.log('retained'); } } const foo = { get value() { return () => 'baz'; } }; getReturnExpressionBeforeInit(); rollup-2.61.1/test/form/samples/property-setters-and-getters/early-access-getter-value/000077500000000000000000000000001415504077600312605ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/property-setters-and-getters/early-access-getter-value/_config.js000066400000000000000000000001471415504077600332240ustar00rootroot00000000000000module.exports = { description: 'handles accessing the value of a getter before it has been bound' }; rollup-2.61.1/test/form/samples/property-setters-and-getters/early-access-getter-value/_expected.js000066400000000000000000000001501415504077600335520ustar00rootroot00000000000000function getLiteralValueBeforeInit() { { console.log('retained'); } } getLiteralValueBeforeInit(); rollup-2.61.1/test/form/samples/property-setters-and-getters/early-access-getter-value/main.js000066400000000000000000000003201415504077600325350ustar00rootroot00000000000000function getLiteralValueBeforeInit() { const bar = { [foo.value]: true }; if (bar.baz) { console.log('retained'); } } const foo = { get value() { return 'baz'; } }; getLiteralValueBeforeInit(); rollup-2.61.1/test/form/samples/property-setters-and-getters/shadowed-setters/000077500000000000000000000000001415504077600275705ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/property-setters-and-getters/shadowed-setters/_config.js000066400000000000000000000001231415504077600315260ustar00rootroot00000000000000module.exports = { description: 'handles setters shadowed by computed setters' }; rollup-2.61.1/test/form/samples/property-setters-and-getters/shadowed-setters/_expected.js000066400000000000000000000002071415504077600320650ustar00rootroot00000000000000const objRetained = { set value(v) {}, set [globalThis.unknown](v) { console.log('effect'); } }; objRetained.value = 'retained'; rollup-2.61.1/test/form/samples/property-setters-and-getters/shadowed-setters/main.js000066400000000000000000000003771415504077600310610ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/protect-cjs-globals/000077500000000000000000000000001415504077600223735ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/protect-cjs-globals/_config.js000066400000000000000000000001751415504077600243400ustar00rootroot00000000000000module.exports = { description: 'prevent conflicts with cjs module globals', options: { output: { name: 'bundle' } } }; rollup-2.61.1/test/form/samples/protect-cjs-globals/_expected/000077500000000000000000000000001415504077600243335ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/protect-cjs-globals/_expected/amd.js000066400000000000000000000006011415504077600254270ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/protect-cjs-globals/_expected/cjs.js000066400000000000000000000005261415504077600254530ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/form/samples/protect-cjs-globals/_expected/es.js000066400000000000000000000002401415504077600252740ustar00rootroot00000000000000const exports = 1; const require = 2; const module = 3; const __filename = 4; const __dirname = 5; export { __dirname, __filename, exports, module, require }; rollup-2.61.1/test/form/samples/protect-cjs-globals/_expected/iife.js000066400000000000000000000006201415504077600256030ustar00rootroot00000000000000var 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; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/protect-cjs-globals/_expected/system.js000066400000000000000000000005251415504077600262170ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/protect-cjs-globals/_expected/umd.js000066400000000000000000000012361415504077600254600ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/protect-cjs-globals/main.js000066400000000000000000000002061415504077600236530ustar00rootroot00000000000000export const exports = 1; export const require = 2; export const module = 3; export const __filename = 4; export const __dirname = 5; rollup-2.61.1/test/form/samples/proto-null/000077500000000000000000000000001415504077600206305ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/proto-null/_config.js000066400000000000000000000001321415504077600225660ustar00rootroot00000000000000module.exports = { description: 'handles getters and setters on __proto__ properties' }; rollup-2.61.1/test/form/samples/proto-null/_expected.js000066400000000000000000000000621415504077600231240ustar00rootroot00000000000000console.log('retained'); console.log('retained'); rollup-2.61.1/test/form/samples/proto-null/main.js000066400000000000000000000002541415504077600221130ustar00rootroot00000000000000const a = { __proto__: null }; if (a.hasOwnProperty) console.log('removed'); else console.log('retained'); if (a.foo) console.log('removed'); else console.log('retained'); rollup-2.61.1/test/form/samples/prototype-functions/000077500000000000000000000000001415504077600225705ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/prototype-functions/_config.js000066400000000000000000000001141415504077600245260ustar00rootroot00000000000000module.exports = { description: 'properly includes prototype functions' }; rollup-2.61.1/test/form/samples/prototype-functions/_expected.js000066400000000000000000000002351415504077600250660ustar00rootroot00000000000000function Foo () { this.doIt(); } Foo.prototype.doIt = function () { this.foo.tooDeep = 1; this.foo['b' + 'ar'] = 2; this.doesNotExist(); }; new Foo(); rollup-2.61.1/test/form/samples/prototype-functions/main.js000066400000000000000000000002511415504077600240500ustar00rootroot00000000000000function Foo () { this.doIt(); } Foo.prototype.doIt = function () { this.foo.tooDeep = 1; this.foo['b' + 'ar'] = 2; this.doesNotExist(); }; const foo = new Foo(); rollup-2.61.1/test/form/samples/prune-pure-unused-import-array/000077500000000000000000000000001415504077600245445ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/prune-pure-unused-import-array/_config.js000066400000000000000000000003451415504077600265100ustar00rootroot00000000000000module.exports = { description: 'prunes pure unused external imports ([#1352])', options: { external: ['external', 'other'], treeshake: { moduleSideEffects: ['other'] }, output: { globals: { other: 'other' } } } }; rollup-2.61.1/test/form/samples/prune-pure-unused-import-array/_expected/000077500000000000000000000000001415504077600265045ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/prune-pure-unused-import-array/_expected/amd.js000066400000000000000000000000741415504077600276040ustar00rootroot00000000000000define(['other'], (function (other) { 'use strict'; })); rollup-2.61.1/test/form/samples/prune-pure-unused-import-array/_expected/cjs.js000066400000000000000000000000421415504077600276150ustar00rootroot00000000000000'use strict'; require('other'); rollup-2.61.1/test/form/samples/prune-pure-unused-import-array/_expected/es.js000066400000000000000000000000201415504077600274410ustar00rootroot00000000000000import 'other'; rollup-2.61.1/test/form/samples/prune-pure-unused-import-array/_expected/iife.js000066400000000000000000000000471415504077600277570ustar00rootroot00000000000000(function () { 'use strict'; })(); rollup-2.61.1/test/form/samples/prune-pure-unused-import-array/_expected/system.js000066400000000000000000000002131415504077600303620ustar00rootroot00000000000000System.register(['other'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { }) }; })); rollup-2.61.1/test/form/samples/prune-pure-unused-import-array/_expected/umd.js000066400000000000000000000002251415504077600276260ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(['other'], factory) : factory(); })((function () { 'use strict'; })); rollup-2.61.1/test/form/samples/prune-pure-unused-import-array/main.js000066400000000000000000000001671415504077600260320ustar00rootroot00000000000000import { unused } from 'external'; import { notused } from 'other'; function alsoUnused () { unused(); notused(); } rollup-2.61.1/test/form/samples/prune-pure-unused-import-function/000077500000000000000000000000001415504077600252535ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/prune-pure-unused-import-function/_config.js000066400000000000000000000004301415504077600272120ustar00rootroot00000000000000module.exports = { description: 'prunes pure unused external imports ([#1352])', expectedWarnings: ['EMPTY_BUNDLE'], options: { external: ['external', 'other'], treeshake: { moduleSideEffects: id => id !== 'external' }, output: { globals: { other: 'other' } } } }; rollup-2.61.1/test/form/samples/prune-pure-unused-import-function/_expected/000077500000000000000000000000001415504077600272135ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/prune-pure-unused-import-function/_expected/amd.js000066400000000000000000000000741415504077600303130ustar00rootroot00000000000000define(['other'], (function (other) { 'use strict'; })); rollup-2.61.1/test/form/samples/prune-pure-unused-import-function/_expected/cjs.js000066400000000000000000000000421415504077600303240ustar00rootroot00000000000000'use strict'; require('other'); rollup-2.61.1/test/form/samples/prune-pure-unused-import-function/_expected/es.js000066400000000000000000000000201415504077600301500ustar00rootroot00000000000000import 'other'; rollup-2.61.1/test/form/samples/prune-pure-unused-import-function/_expected/iife.js000066400000000000000000000000471415504077600304660ustar00rootroot00000000000000(function () { 'use strict'; })(); rollup-2.61.1/test/form/samples/prune-pure-unused-import-function/_expected/system.js000066400000000000000000000002131415504077600310710ustar00rootroot00000000000000System.register(['other'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { }) }; })); rollup-2.61.1/test/form/samples/prune-pure-unused-import-function/_expected/umd.js000066400000000000000000000002251415504077600303350ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(['other'], factory) : factory(); })((function () { 'use strict'; })); rollup-2.61.1/test/form/samples/prune-pure-unused-import-function/main.js000066400000000000000000000001671415504077600265410ustar00rootroot00000000000000import { unused } from 'external'; import { notused } from 'other'; function alsoUnused () { unused(); notused(); } rollup-2.61.1/test/form/samples/prune-pure-unused-import/000077500000000000000000000000001415504077600234305ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/prune-pure-unused-import/_config.js000066400000000000000000000003361415504077600253740ustar00rootroot00000000000000module.exports = { description: 'prunes pure unused external imports ([#1352])', expectedWarnings: ['EMPTY_BUNDLE'], options: { external: ['external', 'other'], treeshake: { moduleSideEffects: 'no-external' } } }; rollup-2.61.1/test/form/samples/prune-pure-unused-import/_expected/000077500000000000000000000000001415504077600253705ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/prune-pure-unused-import/_expected/amd.js000066400000000000000000000000541415504077600264660ustar00rootroot00000000000000define((function () { 'use strict'; })); rollup-2.61.1/test/form/samples/prune-pure-unused-import/_expected/cjs.js000066400000000000000000000000171415504077600265030ustar00rootroot00000000000000'use strict'; rollup-2.61.1/test/form/samples/prune-pure-unused-import/_expected/es.js000066400000000000000000000000011415504077600263240ustar00rootroot00000000000000 rollup-2.61.1/test/form/samples/prune-pure-unused-import/_expected/iife.js000066400000000000000000000000471415504077600266430ustar00rootroot00000000000000(function () { 'use strict'; })(); rollup-2.61.1/test/form/samples/prune-pure-unused-import/_expected/system.js000066400000000000000000000001471415504077600272540ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { }) }; })); rollup-2.61.1/test/form/samples/prune-pure-unused-import/_expected/umd.js000066400000000000000000000002121415504077600265060ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; })); rollup-2.61.1/test/form/samples/prune-pure-unused-import/main.js000066400000000000000000000001121415504077600247040ustar00rootroot00000000000000import { unused } from 'external'; function alsoUnused () { unused(); } rollup-2.61.1/test/form/samples/pure-class-field/000077500000000000000000000000001415504077600216545ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/pure-class-field/_config.js000066400000000000000000000001171415504077600236150ustar00rootroot00000000000000module.exports = { description: 'retains pure annotations in class fields' }; rollup-2.61.1/test/form/samples/pure-class-field/_expected.js000066400000000000000000000001501415504077600241460ustar00rootroot00000000000000class main { static k = /*#__PURE__*/ V(); static [/*#__PURE__*/ W()]; } export { main as default }; rollup-2.61.1/test/form/samples/pure-class-field/main.js000066400000000000000000000001251415504077600231340ustar00rootroot00000000000000export default class { static k = /*#__PURE__*/ V(); static [/*#__PURE__*/ W()]; } rollup-2.61.1/test/form/samples/pure-comment-line-break/000077500000000000000000000000001415504077600231375ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/pure-comment-line-break/_config.js000066400000000000000000000001441415504077600251000ustar00rootroot00000000000000module.exports = { description: 'adjust line-break handling when dealing with pure annotations' }; rollup-2.61.1/test/form/samples/pure-comment-line-break/_expected.js000066400000000000000000000017051415504077600254400ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/pure-comment-line-break/dep.js000066400000000000000000000001241415504077600242420ustar00rootroot00000000000000const x = 'code';//@__PURE__ export default x; console.log('should remain impure'); rollup-2.61.1/test/form/samples/pure-comment-line-break/main.js000066400000000000000000000031561415504077600244260ustar00rootroot00000000000000/*@__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-2.61.1/test/form/samples/pure-comment-scenarios-complex/000077500000000000000000000000001415504077600245615ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/pure-comment-scenarios-complex/_config.js000066400000000000000000000003461415504077600265260ustar00rootroot00000000000000// tests compiled from https://github.com/mishoo/UglifyJS2/blob/bcebacbb9e7ddac7d9c0e4ca2c7e0faf0e0bca7c/test/compress/issue-1261.js module.exports = { description: 'correctly handles various advanced pure comment scenarios' }; rollup-2.61.1/test/form/samples/pure-comment-scenarios-complex/_expected.js000066400000000000000000000012151415504077600270560ustar00rootroot00000000000000// 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-2.61.1/test/form/samples/pure-comment-scenarios-complex/main.js000066400000000000000000000026361415504077600260520ustar00rootroot00000000000000// 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-2.61.1/test/form/samples/pure-comment-scenarios-simple/000077500000000000000000000000001415504077600244035ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/pure-comment-scenarios-simple/_config.js000066400000000000000000000003351415504077600263460ustar00rootroot00000000000000// tests compiled from https://github.com/mishoo/UglifyJS2/blob/88c8f4e363e0d585b33ea29df560243d3dc74ce1/test/compress/pure_funcs.js module.exports = { description: 'correctly handles various pure comment scenarios' }; rollup-2.61.1/test/form/samples/pure-comment-scenarios-simple/_expected.js000066400000000000000000000015661415504077600267110ustar00rootroot00000000000000// 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-2.61.1/test/form/samples/pure-comment-scenarios-simple/main.js000066400000000000000000000042001415504077600256610ustar00rootroot00000000000000// 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-2.61.1/test/form/samples/pure-comments-disabled/000077500000000000000000000000001415504077600230605ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/pure-comments-disabled/_config.js000066400000000000000000000002261415504077600250220ustar00rootroot00000000000000module.exports = { description: 'does not rely on pure annotations if they are disabled', options: { treeshake: { annotations: false } } }; rollup-2.61.1/test/form/samples/pure-comments-disabled/_expected.js000066400000000000000000000010071415504077600253540ustar00rootroot00000000000000// 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-2.61.1/test/form/samples/pure-comments-disabled/main.js000066400000000000000000000012271415504077600243440ustar00rootroot00000000000000// 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-2.61.1/test/form/samples/pure-comments-multiple/000077500000000000000000000000001415504077600231445ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/pure-comments-multiple/_config.js000066400000000000000000000001701415504077600251040ustar00rootroot00000000000000module.exports = { description: 'does not associate multiple "pure" comments before a token with subsequent tokens' }; rollup-2.61.1/test/form/samples/pure-comments-multiple/_expected.js000066400000000000000000000000141415504077600254350ustar00rootroot00000000000000retained(); rollup-2.61.1/test/form/samples/pure-comments-multiple/main.js000066400000000000000000000001311415504077600244210ustar00rootroot00000000000000/*#__PURE__*//*#__PURE__*//*#__PURE__*//*#__PURE__*//*#__PURE__*/ removed(); retained(); rollup-2.61.1/test/form/samples/quote-id/000077500000000000000000000000001415504077600202445ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/quote-id/_config.js000066400000000000000000000015361415504077600222130ustar00rootroot00000000000000const path = require('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 = { description: 'handles escaping for external ids', options: { output: { paths: id => { if (id.startsWith('C:')) 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-2.61.1/test/form/samples/quote-id/_expected/000077500000000000000000000000001415504077600222045ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/quote-id/_expected/amd.js000066400000000000000000000004051415504077600233020ustar00rootroot00000000000000define(['quoted\'\ \ \
\
external1', './quoted\'\ \ \
\
external2', './C:/File/Path'], (function (quoted_____external1, quoted_____external2, Path_js) { 'use strict'; console.log(quoted_____external1.foo, quoted_____external2.bar, Path_js.baz); })); rollup-2.61.1/test/form/samples/quote-id/_expected/cjs.js000066400000000000000000000004261415504077600233230ustar00rootroot00000000000000'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-2.61.1/test/form/samples/quote-id/_expected/es.js000066400000000000000000000002621415504077600231510ustar00rootroot00000000000000import { foo } from 'quoted\'\ \ \
\
external1'; import { bar } from './quoted\'\ \ \
\
external2'; import { baz } from './C:/File/Path.js'; console.log(foo, bar, baz); rollup-2.61.1/test/form/samples/quote-id/_expected/iife.js000066400000000000000000000003311415504077600234530ustar00rootroot00000000000000(function (quoted_____external1, quoted_____external2, Path_js) { 'use strict'; console.log(quoted_____external1.foo, quoted_____external2.bar, Path_js.baz); })(quotedExternal1, quotedExternal2, quotedExternal3); rollup-2.61.1/test/form/samples/quote-id/_expected/system.js000066400000000000000000000006141415504077600240670ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/quote-id/_expected/umd.js000066400000000000000000000013011415504077600233220ustar00rootroot00000000000000(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'], 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-2.61.1/test/form/samples/quote-id/main.js000066400000000000000000000001771415504077600215330ustar00rootroot00000000000000import { foo } from 'external1'; import { bar } from 'external2'; import { baz } from 'external3'; console.log(foo, bar, baz); rollup-2.61.1/test/form/samples/re-export-aliasing/000077500000000000000000000000001415504077600222275ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/re-export-aliasing/_config.js000066400000000000000000000002631415504077600241720ustar00rootroot00000000000000module.exports = { description: 'external re-exports aliasing', options: { output: { globals: { d: 'd' }, name: 'reexportsAliasingExternal' }, external: ['d'] } }; rollup-2.61.1/test/form/samples/re-export-aliasing/_expected/000077500000000000000000000000001415504077600241675ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/re-export-aliasing/_expected/amd.js000066400000000000000000000003551415504077600252710ustar00rootroot00000000000000define(['exports', 'd'], (function (exports, d) { 'use strict'; Object.defineProperty(exports, 'b', { enumerable: true, get: function () { return d.d; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/re-export-aliasing/_expected/cjs.js000066400000000000000000000003071415504077600253040ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var d = require('d'); Object.defineProperty(exports, 'b', { enumerable: true, get: function () { return d.d; } }); rollup-2.61.1/test/form/samples/re-export-aliasing/_expected/es.js000066400000000000000000000000341415504077600251310ustar00rootroot00000000000000export { d as b } from 'd'; rollup-2.61.1/test/form/samples/re-export-aliasing/_expected/iife.js000066400000000000000000000004151415504077600254410ustar00rootroot00000000000000var reexportsAliasingExternal = (function (exports, d) { 'use strict'; Object.defineProperty(exports, 'b', { enumerable: true, get: function () { return d.d; } }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, d); rollup-2.61.1/test/form/samples/re-export-aliasing/_expected/system.js000066400000000000000000000003171415504077600260520ustar00rootroot00000000000000System.register('reexportsAliasingExternal', ['d'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('b', module.d); }], execute: (function () { }) }; })); rollup-2.61.1/test/form/samples/re-export-aliasing/_expected/umd.js000066400000000000000000000010631415504077600253120ustar00rootroot00000000000000(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; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/re-export-aliasing/first.js000066400000000000000000000000341415504077600237110ustar00rootroot00000000000000export { d as a } from 'd'; rollup-2.61.1/test/form/samples/re-export-aliasing/main.js000066400000000000000000000000451415504077600235100ustar00rootroot00000000000000export { a as b } from './first.js'; rollup-2.61.1/test/form/samples/reassigned-exported-functions-and-classes/000077500000000000000000000000001415504077600266725ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reassigned-exported-functions-and-classes/_config.js000066400000000000000000000002131415504077600306300ustar00rootroot00000000000000module.exports = { description: 'use legal names for exported functions and classed (#1943)', options: { output: { name: 'bundle' } } }; rollup-2.61.1/test/form/samples/reassigned-exported-functions-and-classes/_expected/000077500000000000000000000000001415504077600306325ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reassigned-exported-functions-and-classes/_expected/amd.js000066400000000000000000000003401415504077600317260ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; function foo () {} foo = 1; class bar {} bar = 1; exports.bar = bar; exports.foo = foo; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/reassigned-exported-functions-and-classes/_expected/cjs.js000066400000000000000000000002511415504077600317450ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function foo () {} foo = 1; class bar {} bar = 1; exports.bar = bar; exports.foo = foo; rollup-2.61.1/test/form/samples/reassigned-exported-functions-and-classes/_expected/es.js000066400000000000000000000001111415504077600315700ustar00rootroot00000000000000function foo () {} foo = 1; class bar {} bar = 1; export { bar, foo }; rollup-2.61.1/test/form/samples/reassigned-exported-functions-and-classes/_expected/iife.js000066400000000000000000000003571415504077600321110ustar00rootroot00000000000000var bundle = (function (exports) { 'use strict'; function foo () {} foo = 1; class bar {} bar = 1; exports.bar = bar; exports.foo = foo; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/reassigned-exported-functions-and-classes/_expected/system.js000066400000000000000000000004041415504077600325120ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/reassigned-exported-functions-and-classes/_expected/umd.js000066400000000000000000000007751415504077600317660ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/reassigned-exported-functions-and-classes/main.js000066400000000000000000000001011415504077600301440ustar00rootroot00000000000000export function foo () {} foo = 1; export class bar {} bar = 1; rollup-2.61.1/test/form/samples/recursive-assignments/000077500000000000000000000000001415504077600230555ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/recursive-assignments/_config.js000066400000000000000000000001601415504077600250140ustar00rootroot00000000000000module.exports = { description: 'do not fail for pathological recursive algorithms and circular structures' }; rollup-2.61.1/test/form/samples/recursive-assignments/_expected.js000066400000000000000000000002111415504077600253450ustar00rootroot00000000000000let foo = () => function () {}; foo.value = foo; while ( foo.value ) { foo = foo.value; } foo(); foo()(); new (foo())(); foo.bar = 1; rollup-2.61.1/test/form/samples/recursive-assignments/main.js000066400000000000000000000002101415504077600243300ustar00rootroot00000000000000let foo = () => function () {}; foo.value = foo; while ( foo.value ) { foo = foo.value; } foo(); foo()(); new (foo())() foo.bar = 1; rollup-2.61.1/test/form/samples/recursive-calls/000077500000000000000000000000001415504077600216205ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/recursive-calls/_config.js000066400000000000000000000001061415504077600235570ustar00rootroot00000000000000module.exports = { description: 'do not fail for recursive calls' }; rollup-2.61.1/test/form/samples/recursive-calls/_expected.js000066400000000000000000000016131415504077600241170ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/recursive-calls/main.js000066400000000000000000000030141415504077600231000ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/recursive-computed-members/000077500000000000000000000000001415504077600237725ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/recursive-computed-members/_config.js000066400000000000000000000001161415504077600257320ustar00rootroot00000000000000module.exports = { description: 'handle recursive computed member access' }; rollup-2.61.1/test/form/samples/recursive-computed-members/_expected.js000066400000000000000000000000671415504077600262730ustar00rootroot00000000000000var a = { foo: 'bar' }; var b = a[b]; console.log(b); rollup-2.61.1/test/form/samples/recursive-computed-members/main.js000066400000000000000000000000671415504077600252570ustar00rootroot00000000000000var a = { foo: 'bar' }; var b = a[b]; console.log(b); rollup-2.61.1/test/form/samples/recursive-literal-values/000077500000000000000000000000001415504077600234535ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/recursive-literal-values/_config.js000066400000000000000000000001421415504077600254120ustar00rootroot00000000000000module.exports = { description: 'do not fail for literal values from recursive return values' }; rollup-2.61.1/test/form/samples/recursive-literal-values/_expected.js000066400000000000000000000001401415504077600257440ustar00rootroot00000000000000function foo() { return foo() } if (foo()) { console.log('A'); } else { console.log('B'); } rollup-2.61.1/test/form/samples/recursive-literal-values/main.js000066400000000000000000000001361415504077600247350ustar00rootroot00000000000000function foo() { return foo() } if (foo()) { console.log('A') } else { console.log('B') } rollup-2.61.1/test/form/samples/recursive-multi-expressions/000077500000000000000000000000001415504077600242345ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/recursive-multi-expressions/_config.js000066400000000000000000000001121415504077600261700ustar00rootroot00000000000000module.exports = { description: 'handles recursive multi-expressions' }; rollup-2.61.1/test/form/samples/recursive-multi-expressions/_expected.js000066400000000000000000000006661415504077600265420ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/recursive-multi-expressions/main.js000066400000000000000000000006661415504077600255260ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/recursive-return-value-assignments/000077500000000000000000000000001415504077600255045ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/recursive-return-value-assignments/_config.js000066400000000000000000000001261415504077600274450ustar00rootroot00000000000000module.exports = { description: 'handle recursive reassignments of return values' }; rollup-2.61.1/test/form/samples/recursive-return-value-assignments/_expected.js000066400000000000000000000000621415504077600300000ustar00rootroot00000000000000function foo() { return foo()(); } foo().x = 1; rollup-2.61.1/test/form/samples/recursive-return-value-assignments/main.js000066400000000000000000000000621415504077600267640ustar00rootroot00000000000000function foo() { return foo()(); } foo().x = 1; rollup-2.61.1/test/form/samples/recursive-this-deoptimization/000077500000000000000000000000001415504077600245265ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/recursive-this-deoptimization/_config.js000066400000000000000000000001271415504077600264700ustar00rootroot00000000000000module.exports = { description: 'handles recursive "this" deoptimizations (#4089)' }; rollup-2.61.1/test/form/samples/recursive-this-deoptimization/_expected.js000066400000000000000000000002331415504077600270220ustar00rootroot00000000000000getObj().getThis().method(); getObj().getThis().getThis().method(); function getObj() { return { getThis() { return this; }, method() {}, }; } rollup-2.61.1/test/form/samples/recursive-this-deoptimization/main.js000066400000000000000000000002331415504077600260060ustar00rootroot00000000000000getObj().getThis().method(); getObj().getThis().getThis().method(); function getObj() { return { getThis() { return this; }, method() {}, }; } rollup-2.61.1/test/form/samples/recursive-values/000077500000000000000000000000001415504077600220215ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/recursive-values/_config.js000066400000000000000000000001601415504077600237600ustar00rootroot00000000000000module.exports = { description: 'do not fail for pathological recursive algorithms and circular structures' }; rollup-2.61.1/test/form/samples/recursive-values/_expected.js000066400000000000000000000001171415504077600243160ustar00rootroot00000000000000var x = x || true; x && console.log(1); var y = {y}; y.y && console.log(2); rollup-2.61.1/test/form/samples/recursive-values/main.js000066400000000000000000000001171415504077600233020ustar00rootroot00000000000000var x = x || true; x && console.log(1); var y = {y}; y.y && console.log(2); rollup-2.61.1/test/form/samples/redeclarations/000077500000000000000000000000001415504077600215145ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/redeclarations/_config.js000066400000000000000000000001511415504077600234530ustar00rootroot00000000000000module.exports = { description: 'make sure re-declarations via var and function are linked properly' }; rollup-2.61.1/test/form/samples/redeclarations/_expected.js000066400000000000000000000001421415504077600240070ustar00rootroot00000000000000var foo = () => {}; while ( true ) { var foo = () => console.log( 'effect' ); break; } foo(); rollup-2.61.1/test/form/samples/redeclarations/main.js000066400000000000000000000005371415504077600230030ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/reexport-external-default-and-name/000077500000000000000000000000001415504077600253055ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reexport-external-default-and-name/_config.js000066400000000000000000000004301415504077600272440ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/form/samples/reexport-external-default-and-name/_expected/000077500000000000000000000000001415504077600272455ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reexport-external-default-and-name/_expected/amd.js000066400000000000000000000010011415504077600303340ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, external) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external__default = /*#__PURE__*/_interopDefaultLegacy(external); const value = 42; Object.defineProperty(exports, 'default', { enumerable: true, get: function () { return external__default["default"]; } }); exports.value = value; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/reexport-external-default-and-name/_expected/cjs.js000066400000000000000000000007271415504077600303700ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var external = require('external'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external__default = /*#__PURE__*/_interopDefaultLegacy(external); const value = 42; Object.defineProperty(exports, 'default', { enumerable: true, get: function () { return external__default["default"]; } }); exports.value = value; rollup-2.61.1/test/form/samples/reexport-external-default-and-name/_expected/es.js000066400000000000000000000001121415504077600302040ustar00rootroot00000000000000export { default } from 'external'; const value = 42; export { value }; rollup-2.61.1/test/form/samples/reexport-external-default-and-name/_expected/iife.js000066400000000000000000000010161415504077600305150ustar00rootroot00000000000000var bundle = (function (exports, external) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external__default = /*#__PURE__*/_interopDefaultLegacy(external); const value = 42; Object.defineProperty(exports, 'default', { enumerable: true, get: function () { return external__default["default"]; } }); exports.value = value; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, external); rollup-2.61.1/test/form/samples/reexport-external-default-and-name/_expected/system.js000066400000000000000000000003701415504077600311270ustar00rootroot00000000000000System.register('bundle', ['external'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('default', module["default"]); }], execute: (function () { const value = exports('value', 42); }) }; })); rollup-2.61.1/test/form/samples/reexport-external-default-and-name/_expected/umd.js000066400000000000000000000015041415504077600303700ustar00rootroot00000000000000(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 _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external__default = /*#__PURE__*/_interopDefaultLegacy(external); const value = 42; Object.defineProperty(exports, 'default', { enumerable: true, get: function () { return external__default["default"]; } }); exports.value = value; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/reexport-external-default-and-name/main.js000066400000000000000000000000751415504077600265710ustar00rootroot00000000000000export { default } from 'external'; export const value = 42; rollup-2.61.1/test/form/samples/reexport-external-default-and-namespace/000077500000000000000000000000001415504077600263215ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reexport-external-default-and-namespace/_config.js000066400000000000000000000003761415504077600302710ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/form/samples/reexport-external-default-and-namespace/_expected/000077500000000000000000000000001415504077600302615ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reexport-external-default-and-namespace/_expected/amd.js000066400000000000000000000012521415504077600313600ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, external) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external__default = /*#__PURE__*/_interopDefaultLegacy(external); Object.defineProperty(exports, 'default', { enumerable: true, get: function () { return external__default["default"]; } }); Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/reexport-external-default-and-namespace/_expected/cjs.js000066400000000000000000000011741415504077600314010ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var external = require('external'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external__default = /*#__PURE__*/_interopDefaultLegacy(external); Object.defineProperty(exports, 'default', { enumerable: true, get: function () { return external__default["default"]; } }); Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); rollup-2.61.1/test/form/samples/reexport-external-default-and-namespace/_expected/es.js000066400000000000000000000000761415504077600312310ustar00rootroot00000000000000export * from 'external'; export { default } from 'external'; rollup-2.61.1/test/form/samples/reexport-external-default-and-namespace/_expected/iife.js000066400000000000000000000012671415504077600315410ustar00rootroot00000000000000var bundle = (function (exports, external) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external__default = /*#__PURE__*/_interopDefaultLegacy(external); Object.defineProperty(exports, 'default', { enumerable: true, get: function () { return external__default["default"]; } }); Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, external); rollup-2.61.1/test/form/samples/reexport-external-default-and-namespace/_expected/system.js000066400000000000000000000005661415504077600321520ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/reexport-external-default-and-namespace/_expected/umd.js000066400000000000000000000017551415504077600314140ustar00rootroot00000000000000(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 _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external__default = /*#__PURE__*/_interopDefaultLegacy(external); Object.defineProperty(exports, 'default', { enumerable: true, get: function () { return external__default["default"]; } }); Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/reexport-external-default-and-namespace/main.js000066400000000000000000000000761415504077600276060ustar00rootroot00000000000000export * from 'external'; export { default } from 'external'; rollup-2.61.1/test/form/samples/reexport-external-default-as-name-and-name/000077500000000000000000000000001415504077600266245ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reexport-external-default-as-name-and-name/_config.js000066400000000000000000000003541415504077600305700ustar00rootroot00000000000000module.exports = { description: 're-exports a named external export as default', expectedWarnings: ['MIXED_EXPORTS'], options: { external: ['external'], output: { globals: { external: 'external' }, name: 'bundle' } } }; rollup-2.61.1/test/form/samples/reexport-external-default-as-name-and-name/_expected/000077500000000000000000000000001415504077600305645ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reexport-external-default-as-name-and-name/_expected/amd.js000066400000000000000000000007671415504077600316750ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, external) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external__default = /*#__PURE__*/_interopDefaultLegacy(external); console.log(external.value); Object.defineProperty(exports, 'reexported', { enumerable: true, get: function () { return external__default["default"]; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/reexport-external-default-as-name-and-name/_expected/cjs.js000066400000000000000000000007161415504077600317050ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var external = require('external'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external__default = /*#__PURE__*/_interopDefaultLegacy(external); console.log(external.value); Object.defineProperty(exports, 'reexported', { enumerable: true, get: function () { return external__default["default"]; } }); rollup-2.61.1/test/form/samples/reexport-external-default-as-name-and-name/_expected/es.js000066400000000000000000000001511415504077600315260ustar00rootroot00000000000000import { value } from 'external'; export { default as reexported } from 'external'; console.log(value); rollup-2.61.1/test/form/samples/reexport-external-default-as-name-and-name/_expected/iife.js000066400000000000000000000010041415504077600320310ustar00rootroot00000000000000var bundle = (function (exports, external) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external__default = /*#__PURE__*/_interopDefaultLegacy(external); console.log(external.value); Object.defineProperty(exports, 'reexported', { enumerable: true, get: function () { return external__default["default"]; } }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, external); rollup-2.61.1/test/form/samples/reexport-external-default-as-name-and-name/_expected/system.js000066400000000000000000000004201415504077600324420ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/reexport-external-default-as-name-and-name/_expected/umd.js000066400000000000000000000014721415504077600317130ustar00rootroot00000000000000(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 _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external__default = /*#__PURE__*/_interopDefaultLegacy(external); console.log(external.value); Object.defineProperty(exports, 'reexported', { enumerable: true, get: function () { return external__default["default"]; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/reexport-external-default-as-name-and-name/main.js000066400000000000000000000001461415504077600301070ustar00rootroot00000000000000export { default as reexported } from 'external'; import {value} from 'external'; console.log(value); rollup-2.61.1/test/form/samples/reexport-external-default/000077500000000000000000000000001415504077600236275ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reexport-external-default/_config.js000066400000000000000000000003451415504077600255730ustar00rootroot00000000000000module.exports = { description: 'reexports an external default export', options: { external: ['external1', 'external2'], output: { globals: { external1: 'external1', external2: 'external2' }, name: 'bundle' } } }; rollup-2.61.1/test/form/samples/reexport-external-default/_expected/000077500000000000000000000000001415504077600255675ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reexport-external-default/_expected/amd.js000066400000000000000000000005371415504077600266730ustar00rootroot00000000000000define(['external1', 'external2'], (function (external1, external2) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external2__default = /*#__PURE__*/_interopDefaultLegacy(external2); console.log(external1.foo); return external2__default["default"]; })); rollup-2.61.1/test/form/samples/reexport-external-default/_expected/cjs.js000066400000000000000000000005461415504077600267110ustar00rootroot00000000000000'use strict'; var external1 = require('external1'); var external2 = require('external2'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external2__default = /*#__PURE__*/_interopDefaultLegacy(external2); console.log(external1.foo); module.exports = external2__default["default"]; rollup-2.61.1/test/form/samples/reexport-external-default/_expected/es.js000066400000000000000000000001311415504077600265270ustar00rootroot00000000000000import { foo } from 'external1'; export { default } from 'external2'; console.log(foo); rollup-2.61.1/test/form/samples/reexport-external-default/_expected/iife.js000066400000000000000000000005371415504077600270460ustar00rootroot00000000000000var bundle = (function (external1, external2) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external2__default = /*#__PURE__*/_interopDefaultLegacy(external2); console.log(external1.foo); return external2__default["default"]; })(external1, external2); rollup-2.61.1/test/form/samples/reexport-external-default/_expected/system.js000066400000000000000000000004541415504077600274540ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/reexport-external-default/_expected/umd.js000066400000000000000000000013201415504077600267060ustar00rootroot00000000000000(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'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external2__default = /*#__PURE__*/_interopDefaultLegacy(external2); console.log(external1.foo); return external2__default["default"]; })); rollup-2.61.1/test/form/samples/reexport-external-default/main.js000066400000000000000000000001301415504077600251030ustar00rootroot00000000000000import { foo } from 'external1'; export { default } from 'external2'; console.log(foo); rollup-2.61.1/test/form/samples/reexport-external-name-as-default/000077500000000000000000000000001415504077600251465ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reexport-external-name-as-default/_config.js000066400000000000000000000003061415504077600271070ustar00rootroot00000000000000module.exports = { description: 're-exports a named external export as default', options: { external: ['external'], output: { globals: { external: 'external' }, name: 'bundle' } } }; rollup-2.61.1/test/form/samples/reexport-external-name-as-default/_expected/000077500000000000000000000000001415504077600271065ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reexport-external-name-as-default/_expected/amd.js000066400000000000000000000001331415504077600302020ustar00rootroot00000000000000define(['external'], (function (external) { 'use strict'; return external.value; })); rollup-2.61.1/test/form/samples/reexport-external-name-as-default/_expected/cjs.js000066400000000000000000000001271415504077600302230ustar00rootroot00000000000000'use strict'; var external = require('external'); module.exports = external.value; rollup-2.61.1/test/form/samples/reexport-external-name-as-default/_expected/es.js000066400000000000000000000000551415504077600300530ustar00rootroot00000000000000export { value as default } from 'external'; rollup-2.61.1/test/form/samples/reexport-external-name-as-default/_expected/iife.js000066400000000000000000000001351415504077600303570ustar00rootroot00000000000000var bundle = (function (external) { 'use strict'; return external.value; })(external); rollup-2.61.1/test/form/samples/reexport-external-name-as-default/_expected/system.js000066400000000000000000000003151415504077600307670ustar00rootroot00000000000000System.register('bundle', ['external'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('default', module.value); }], execute: (function () { }) }; })); rollup-2.61.1/test/form/samples/reexport-external-name-as-default/_expected/umd.js000066400000000000000000000006401415504077600302310ustar00rootroot00000000000000(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-2.61.1/test/form/samples/reexport-external-name-as-default/main.js000066400000000000000000000000551415504077600264300ustar00rootroot00000000000000export { value as default } from 'external'; rollup-2.61.1/test/form/samples/reexport-external-name-as-default2/000077500000000000000000000000001415504077600252305ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reexport-external-name-as-default2/_config.js000066400000000000000000000003271415504077600271740ustar00rootroot00000000000000module.exports = { description: 're-exports a named external export as default via another file', options: { external: ['external'], output: { globals: { external: 'external' }, name: 'bundle' } } }; rollup-2.61.1/test/form/samples/reexport-external-name-as-default2/_expected/000077500000000000000000000000001415504077600271705ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reexport-external-name-as-default2/_expected/amd.js000066400000000000000000000001361415504077600302670ustar00rootroot00000000000000define(['external'], (function (external) { 'use strict'; return external.objAlias; })); rollup-2.61.1/test/form/samples/reexport-external-name-as-default2/_expected/cjs.js000066400000000000000000000001321415504077600303010ustar00rootroot00000000000000'use strict'; var external = require('external'); module.exports = external.objAlias; rollup-2.61.1/test/form/samples/reexport-external-name-as-default2/_expected/es.js000066400000000000000000000000601415504077600301310ustar00rootroot00000000000000export { objAlias as default } from 'external'; rollup-2.61.1/test/form/samples/reexport-external-name-as-default2/_expected/iife.js000066400000000000000000000001401415504077600304350ustar00rootroot00000000000000var bundle = (function (external) { 'use strict'; return external.objAlias; })(external); rollup-2.61.1/test/form/samples/reexport-external-name-as-default2/_expected/system.js000066400000000000000000000003201415504077600310450ustar00rootroot00000000000000System.register('bundle', ['external'], (function (exports) { 'use strict'; return { setters: [function (module) { exports('default', module.objAlias); }], execute: (function () { }) }; })); rollup-2.61.1/test/form/samples/reexport-external-name-as-default2/_expected/umd.js000066400000000000000000000006431415504077600303160ustar00rootroot00000000000000(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-2.61.1/test/form/samples/reexport-external-name-as-default2/first.js000066400000000000000000000000601415504077600267110ustar00rootroot00000000000000export { objAlias as default } from 'external'; rollup-2.61.1/test/form/samples/reexport-external-name-as-default2/main.js000066400000000000000000000000461415504077600265120ustar00rootroot00000000000000export { default } from './first.js'; rollup-2.61.1/test/form/samples/reexport-external-name/000077500000000000000000000000001415504077600231235ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reexport-external-name/_config.js000066400000000000000000000003621415504077600250660ustar00rootroot00000000000000module.exports = { description: 're-exports a named export from an external module', options: { external: ['external1', 'external2'], output: { globals: { external1: 'external1', external2: 'external2' }, name: 'bundle' } } }; rollup-2.61.1/test/form/samples/reexport-external-name/_expected/000077500000000000000000000000001415504077600250635ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reexport-external-name/_expected/amd.js000066400000000000000000000006201415504077600261600ustar00rootroot00000000000000define(['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; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/reexport-external-name/_expected/cjs.js000066400000000000000000000005641415504077600262050ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/form/samples/reexport-external-name/_expected/es.js000066400000000000000000000001111415504077600260210ustar00rootroot00000000000000export { foo } from 'external1'; export { foo as bar } from 'external2'; rollup-2.61.1/test/form/samples/reexport-external-name/_expected/iife.js000066400000000000000000000006331415504077600263370ustar00rootroot00000000000000var 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; } }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, external1, external2); rollup-2.61.1/test/form/samples/reexport-external-name/_expected/system.js000066400000000000000000000004151415504077600267450ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/reexport-external-name/_expected/umd.js000066400000000000000000000013731415504077600262120ustar00rootroot00000000000000(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; } }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/reexport-external-name/main.js000066400000000000000000000001111415504077600243760ustar00rootroot00000000000000export { foo } from 'external1'; export { foo as bar } from 'external2'; rollup-2.61.1/test/form/samples/reexport-external-namespace-as/000077500000000000000000000000001415504077600245405ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reexport-external-namespace-as/_config.js000066400000000000000000000002721415504077600265030ustar00rootroot00000000000000module.exports = { description: 'reexport external namespace as name', options: { external: 'external', output: { name: 'bundle', globals: { external: 'external' } } } }; rollup-2.61.1/test/form/samples/reexport-external-namespace-as/_expected/000077500000000000000000000000001415504077600265005ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reexport-external-namespace-as/_expected/amd.js000066400000000000000000000013221415504077600275750ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, external) { 'use strict'; 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__namespace = /*#__PURE__*/_interopNamespace(external); exports.external = external__namespace; exports.indirect = external__namespace; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/reexport-external-namespace-as/_expected/cjs.js000066400000000000000000000012341415504077600276150ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var external = require('external'); 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__namespace = /*#__PURE__*/_interopNamespace(external); exports.external = external__namespace; exports.indirect = external__namespace; rollup-2.61.1/test/form/samples/reexport-external-namespace-as/_expected/es.js000066400000000000000000000001341415504077600274430ustar00rootroot00000000000000import * as external from 'external'; export { external }; export { external as indirect }; rollup-2.61.1/test/form/samples/reexport-external-namespace-as/_expected/iife.js000066400000000000000000000013371415504077600277560ustar00rootroot00000000000000var bundle = (function (exports, external) { 'use strict'; 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__namespace = /*#__PURE__*/_interopNamespace(external); exports.external = external__namespace; exports.indirect = external__namespace; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, external); rollup-2.61.1/test/form/samples/reexport-external-namespace-as/_expected/system.js000066400000000000000000000003341415504077600303620ustar00rootroot00000000000000System.register('bundle', ['external'], (function (exports) { 'use strict'; return { setters: [function (module) { exports({ external: module, indirect: module }); }], execute: (function () { }) }; })); rollup-2.61.1/test/form/samples/reexport-external-namespace-as/_expected/umd.js000066400000000000000000000020251415504077600276220ustar00rootroot00000000000000(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 _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__namespace = /*#__PURE__*/_interopNamespace(external); exports.external = external__namespace; exports.indirect = external__namespace; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/reexport-external-namespace-as/main.js000066400000000000000000000001421415504077600260170ustar00rootroot00000000000000export * as external from 'external'; import * as indirect from 'external'; export { indirect }; rollup-2.61.1/test/form/samples/reexport-external-namespace/000077500000000000000000000000001415504077600241375ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reexport-external-namespace/_config.js000066400000000000000000000003011415504077600260730ustar00rootroot00000000000000module.exports = { description: 're-exports * from external module (#791)', options: { external: ['external'], output: { globals: { external: 'external' }, name: 'bundle' } } }; rollup-2.61.1/test/form/samples/reexport-external-namespace/_expected/000077500000000000000000000000001415504077600260775ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reexport-external-namespace/_expected/amd.js000066400000000000000000000005531415504077600272010ustar00rootroot00000000000000define(['exports', 'external'], (function (exports, external) { 'use strict'; Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/reexport-external-namespace/_expected/cjs.js000066400000000000000000000005031415504077600272120ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var external = require('external'); Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); rollup-2.61.1/test/form/samples/reexport-external-namespace/_expected/es.js000066400000000000000000000000321415504077600270370ustar00rootroot00000000000000export * from 'external'; rollup-2.61.1/test/form/samples/reexport-external-namespace/_expected/iife.js000066400000000000000000000005701415504077600273530ustar00rootroot00000000000000var bundle = (function (exports, external) { 'use strict'; Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, external); rollup-2.61.1/test/form/samples/reexport-external-namespace/_expected/system.js000066400000000000000000000005301415504077600277570ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/reexport-external-namespace/_expected/umd.js000066400000000000000000000012541415504077600272240ustar00rootroot00000000000000(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' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/reexport-external-namespace/main.js000066400000000000000000000000321415504077600254140ustar00rootroot00000000000000export * from 'external'; rollup-2.61.1/test/form/samples/reexport-self/000077500000000000000000000000001415504077600213145ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reexport-self/_config.js000066400000000000000000000002171415504077600232560ustar00rootroot00000000000000module.exports = { description: 'handles recursions when a module reexports its own namespace', expectedWarnings: ['CIRCULAR_DEPENDENCY'] }; rollup-2.61.1/test/form/samples/reexport-self/_expected.js000066400000000000000000000000421415504077600236060ustar00rootroot00000000000000const foo = 1; console.log(foo); rollup-2.61.1/test/form/samples/reexport-self/main.js000066400000000000000000000000721415504077600225750ustar00rootroot00000000000000import { other } from './other'; console.log(other.foo); rollup-2.61.1/test/form/samples/reexport-self/other.js000066400000000000000000000001411415504077600227670ustar00rootroot00000000000000export const foo = 1; export const bar = 2; import * as other from './other'; export { other }; rollup-2.61.1/test/form/samples/reexport-star-deshadow/000077500000000000000000000000001415504077600231305ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reexport-star-deshadow/_config.js000066400000000000000000000001731415504077600250730ustar00rootroot00000000000000module.exports = { description: 'Star reexports scope deshadowing', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/reexport-star-deshadow/_expected/000077500000000000000000000000001415504077600250705ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reexport-star-deshadow/_expected/amd.js000066400000000000000000000002251415504077600261660ustar00rootroot00000000000000define((function () { 'use strict'; function foo() { return true; } var baz = function foo$1() { return foo(); }; console.log(baz()); })); rollup-2.61.1/test/form/samples/reexport-star-deshadow/_expected/cjs.js000066400000000000000000000001641415504077600262060ustar00rootroot00000000000000'use strict'; function foo() { return true; } var baz = function foo$1() { return foo(); }; console.log(baz()); rollup-2.61.1/test/form/samples/reexport-star-deshadow/_expected/es.js000066400000000000000000000001451415504077600260350ustar00rootroot00000000000000function foo() { return true; } var baz = function foo$1() { return foo(); }; console.log(baz()); rollup-2.61.1/test/form/samples/reexport-star-deshadow/_expected/iife.js000066400000000000000000000002201415504077600263340ustar00rootroot00000000000000(function () { 'use strict'; function foo() { return true; } var baz = function foo$1() { return foo(); }; console.log(baz()); })(); rollup-2.61.1/test/form/samples/reexport-star-deshadow/_expected/system.js000066400000000000000000000003461415504077600267550ustar00rootroot00000000000000System.register('myBundle', [], (function () { 'use strict'; return { execute: (function () { function foo() { return true; } var baz = function foo$1() { return foo(); }; console.log(baz()); }) }; })); rollup-2.61.1/test/form/samples/reexport-star-deshadow/_expected/umd.js000066400000000000000000000003631415504077600262150ustar00rootroot00000000000000(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-2.61.1/test/form/samples/reexport-star-deshadow/foo.js000066400000000000000000000000461415504077600242510ustar00rootroot00000000000000export function foo() { return true; }rollup-2.61.1/test/form/samples/reexport-star-deshadow/main.js000066400000000000000000000001531415504077600244110ustar00rootroot00000000000000import * as bar from './reexport.js'; var baz = function foo() { return bar.foo(); }; console.log(baz())rollup-2.61.1/test/form/samples/reexport-star-deshadow/reexport.js000066400000000000000000000000311415504077600253300ustar00rootroot00000000000000export * from './foo.js';rollup-2.61.1/test/form/samples/reexport-used-external-namespace-as/000077500000000000000000000000001415504077600254765ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reexport-used-external-namespace-as/_config.js000066400000000000000000000004151415504077600274400ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/form/samples/reexport-used-external-namespace-as/_expected/000077500000000000000000000000001415504077600274365ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/reexport-used-external-namespace-as/_expected/amd.js000066400000000000000000000015611415504077600305400ustar00rootroot00000000000000define(['exports', 'external1', 'external2'], (function (exports, imported1, external2) { 'use strict'; 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 imported1__namespace = /*#__PURE__*/_interopNamespace(imported1); var external2__namespace = /*#__PURE__*/_interopNamespace(external2); console.log(imported1__namespace, external2.imported2); exports.external1 = imported1__namespace; exports.external2 = external2__namespace; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/reexport-used-external-namespace-as/_expected/cjs.js000066400000000000000000000015071415504077600305560ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var imported1 = require('external1'); var external2 = require('external2'); 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 imported1__namespace = /*#__PURE__*/_interopNamespace(imported1); var external2__namespace = /*#__PURE__*/_interopNamespace(external2); console.log(imported1__namespace, external2.imported2); exports.external1 = imported1__namespace; exports.external2 = external2__namespace; rollup-2.61.1/test/form/samples/reexport-used-external-namespace-as/_expected/es.js000066400000000000000000000003241415504077600304020ustar00rootroot00000000000000import * as imported1 from 'external1'; export { imported1 as external1 }; import { imported2 } from 'external2'; import * as external2 from 'external2'; export { external2 }; console.log(imported1, imported2); rollup-2.61.1/test/form/samples/reexport-used-external-namespace-as/_expected/iife.js000066400000000000000000000015741415504077600307170ustar00rootroot00000000000000var bundle = (function (exports, imported1, external2) { 'use strict'; 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 imported1__namespace = /*#__PURE__*/_interopNamespace(imported1); var external2__namespace = /*#__PURE__*/_interopNamespace(external2); console.log(imported1__namespace, external2.imported2); exports.external1 = imported1__namespace; exports.external2 = external2__namespace; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, external1, external2); rollup-2.61.1/test/form/samples/reexport-used-external-namespace-as/_expected/system.js000066400000000000000000000006111415504077600313160ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/reexport-used-external-namespace-as/_expected/umd.js000066400000000000000000000023361415504077600305650ustar00rootroot00000000000000(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 _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 imported1__namespace = /*#__PURE__*/_interopNamespace(imported1); var external2__namespace = /*#__PURE__*/_interopNamespace(external2); console.log(imported1__namespace, external2.imported2); exports.external1 = imported1__namespace; exports.external2 = external2__namespace; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/reexport-used-external-namespace-as/main.js000066400000000000000000000003031415504077600267540ustar00rootroot00000000000000export * as external1 from 'external1'; import * as imported1 from 'external1'; export * as external2 from 'external2'; import { imported2 } from 'external2'; console.log(imported1, imported2); rollup-2.61.1/test/form/samples/relative-external-ids/000077500000000000000000000000001415504077600227255ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/relative-external-ids/_config.js000066400000000000000000000014711415504077600246720ustar00rootroot00000000000000const path = require('path'); module.exports = { 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-2.61.1/test/form/samples/relative-external-ids/_expected.js000066400000000000000000000003711415504077600252240ustar00rootroot00000000000000import './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-2.61.1/test/form/samples/relative-external-ids/main.js000066400000000000000000000001741415504077600242110ustar00rootroot00000000000000import './optionDirect.js'; import './optionIndirect.js'; import './hook.js'; import 'resolved'; import './nested/nested'; rollup-2.61.1/test/form/samples/relative-external-ids/nested/000077500000000000000000000000001415504077600242075ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/relative-external-ids/nested/nested.js000066400000000000000000000001711415504077600260260ustar00rootroot00000000000000import './optionDirectNested.js'; import './optionIndirectNested.js'; import './hookNested.js'; import 'resolvedNested'; rollup-2.61.1/test/form/samples/relative-external-with-global/000077500000000000000000000000001415504077600243575ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/relative-external-with-global/_config.js000066400000000000000000000004241415504077600263210ustar00rootroot00000000000000const { resolve } = require('path'); const throttle = resolve(__dirname, 'lib/throttle.js'); module.exports = { description: 'applies globals to externalised relative imports', options: { external: [throttle], output: { globals: { [throttle]: 'Lib.throttle' } } } }; rollup-2.61.1/test/form/samples/relative-external-with-global/_expected/000077500000000000000000000000001415504077600263175ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/relative-external-with-global/_expected/amd.js000066400000000000000000000006241415504077600274200ustar00rootroot00000000000000define(['./lib/throttle'], (function (throttle) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var throttle__default = /*#__PURE__*/_interopDefaultLegacy(throttle); throttle__default["default"]( () => { console.log( '.' ); }, 500 ); window.addEventListener( 'mousemove', throttle__default["default"] ); })); rollup-2.61.1/test/form/samples/relative-external-with-global/_expected/cjs.js000066400000000000000000000006041415504077600274340ustar00rootroot00000000000000'use strict'; var throttle = require('./lib/throttle.js'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var throttle__default = /*#__PURE__*/_interopDefaultLegacy(throttle); throttle__default["default"]( () => { console.log( '.' ); }, 500 ); window.addEventListener( 'mousemove', throttle__default["default"] ); rollup-2.61.1/test/form/samples/relative-external-with-global/_expected/es.js000066400000000000000000000002171415504077600272640ustar00rootroot00000000000000import throttle from './lib/throttle.js'; throttle( () => { console.log( '.' ); }, 500 ); window.addEventListener( 'mousemove', throttle ); rollup-2.61.1/test/form/samples/relative-external-with-global/_expected/iife.js000066400000000000000000000006071415504077600275740ustar00rootroot00000000000000(function (throttle) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var throttle__default = /*#__PURE__*/_interopDefaultLegacy(throttle); throttle__default["default"]( () => { console.log( '.' ); }, 500 ); window.addEventListener( 'mousemove', throttle__default["default"] ); })(Lib.throttle); rollup-2.61.1/test/form/samples/relative-external-with-global/_expected/system.js000066400000000000000000000004771415504077600302110ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/relative-external-with-global/_expected/umd.js000066400000000000000000000013071415504077600274430ustar00rootroot00000000000000(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'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var throttle__default = /*#__PURE__*/_interopDefaultLegacy(throttle); throttle__default["default"]( () => { console.log( '.' ); }, 500 ); window.addEventListener( 'mousemove', throttle__default["default"] ); })); rollup-2.61.1/test/form/samples/relative-external-with-global/main.js000066400000000000000000000002321415504077600256360ustar00rootroot00000000000000import throttle from './lib/throttle.js'; const fn = throttle( () => { console.log( '.' ); }, 500 ); window.addEventListener( 'mousemove', throttle ); rollup-2.61.1/test/form/samples/remove-invalid-pure-comments/000077500000000000000000000000001415504077600242325ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/remove-invalid-pure-comments/_config.js000066400000000000000000000001201415504077600261650ustar00rootroot00000000000000module.exports = { description: 'removes invalidly placed pure annotations' }; rollup-2.61.1/test/form/samples/remove-invalid-pure-comments/_expected.js000066400000000000000000000000741415504077600265310ustar00rootroot00000000000000const a = 3; const b = 3; const c = 3; export { a, b, c }; rollup-2.61.1/test/form/samples/remove-invalid-pure-comments/main.js000066400000000000000000000001431415504077600255120ustar00rootroot00000000000000/*@__PURE__*/export const a = 3; export /*@__PURE__*/const b = 3; export const /*@__PURE__*/c = 3; rollup-2.61.1/test/form/samples/remove-tree-shaken-pure-comments/000077500000000000000000000000001415504077600250125ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/remove-tree-shaken-pure-comments/_config.js000066400000000000000000000001211415504077600267460ustar00rootroot00000000000000module.exports = { description: 'removes pure comments of tree-shaken nodes' }; rollup-2.61.1/test/form/samples/remove-tree-shaken-pure-comments/_expected.js000066400000000000000000000000231415504077600273030ustar00rootroot00000000000000kept() ; kept() ; rollup-2.61.1/test/form/samples/remove-tree-shaken-pure-comments/main.js000066400000000000000000000002411415504077600262710ustar00rootroot00000000000000/*@__PURE__*/(() => false)() /*@__PURE__*/ ? removed() /*@__PURE__*/ : kept() /*@__PURE__*/; /*@__PURE__*/(() => true)() /*@__PURE__*/ && kept() /*@__PURE__*/; rollup-2.61.1/test/form/samples/remove-treeshaken-banners/000077500000000000000000000000001415504077600235675ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/remove-treeshaken-banners/_config.js000066400000000000000000000001451415504077600255310ustar00rootroot00000000000000module.exports = { description: 'Also remove banner comments when completely tree-shaking files' }; rollup-2.61.1/test/form/samples/remove-treeshaken-banners/_expected.js000066400000000000000000000001401415504077600260600ustar00rootroot00000000000000// dep included banner: included console.log('dep included'); // dep included footer: included rollup-2.61.1/test/form/samples/remove-treeshaken-banners/dep-included.js000066400000000000000000000001641415504077600264630ustar00rootroot00000000000000// dep included banner: included const removed = 1; console.log('dep included'); // dep included footer: included rollup-2.61.1/test/form/samples/remove-treeshaken-banners/dep-removed.js000066400000000000000000000001231415504077600263300ustar00rootroot00000000000000// dep removed banner: removed const removed = 1; // dep removed footer: removed rollup-2.61.1/test/form/samples/remove-treeshaken-banners/main.js000066400000000000000000000001431415504077600250470ustar00rootroot00000000000000// main banner: removed import './dep-removed'; import './dep-included'; // main footer: removed rollup-2.61.1/test/form/samples/removes-existing-sourcemap-comments/000077500000000000000000000000001415504077600256445ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/removes-existing-sourcemap-comments/_config.js000066400000000000000000000001121415504077600276000ustar00rootroot00000000000000module.exports = { description: 'removes existing sourcemap comments' }; rollup-2.61.1/test/form/samples/removes-existing-sourcemap-comments/_expected/000077500000000000000000000000001415504077600276045ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/removes-existing-sourcemap-comments/_expected/amd.js000066400000000000000000000002331415504077600307010ustar00rootroot00000000000000define((function () { 'use strict'; function foo (x) { return x; } var str = ` //# sourceMappingURL=main.js.map `; console.log( foo(str) ); })); rollup-2.61.1/test/form/samples/removes-existing-sourcemap-comments/_expected/cjs.js000066400000000000000000000001721415504077600307210ustar00rootroot00000000000000'use strict'; function foo (x) { return x; } var str = ` //# sourceMappingURL=main.js.map `; console.log( foo(str) ); rollup-2.61.1/test/form/samples/removes-existing-sourcemap-comments/_expected/es.js000066400000000000000000000001531415504077600305500ustar00rootroot00000000000000function foo (x) { return x; } var str = ` //# sourceMappingURL=main.js.map `; console.log( foo(str) ); rollup-2.61.1/test/form/samples/removes-existing-sourcemap-comments/_expected/iife.js000066400000000000000000000002261415504077600310560ustar00rootroot00000000000000(function () { 'use strict'; function foo (x) { return x; } var str = ` //# sourceMappingURL=main.js.map `; console.log( foo(str) ); })(); rollup-2.61.1/test/form/samples/removes-existing-sourcemap-comments/_expected/system.js000066400000000000000000000003401415504077600314630ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function foo (x) { return x; } var str = ` //# sourceMappingURL=main.js.map `; console.log( foo(str) ); }) }; })); rollup-2.61.1/test/form/samples/removes-existing-sourcemap-comments/_expected/umd.js000066400000000000000000000003711415504077600307300ustar00rootroot00000000000000(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-2.61.1/test/form/samples/removes-existing-sourcemap-comments/foo.js000066400000000000000000000001141415504077600267610ustar00rootroot00000000000000export default function (x) { return x; } //# sourceMappingURL=foo.js.map rollup-2.61.1/test/form/samples/removes-existing-sourcemap-comments/main.js000066400000000000000000000002061415504077600271240ustar00rootroot00000000000000import foo from './foo'; var str = ` //# sourceMappingURL=main.js.map `; console.log( foo(str) ); //# sourceMappingURL=main.js.map rollup-2.61.1/test/form/samples/removes-unused-babel-helpers/000077500000000000000000000000001415504077600242015ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/removes-unused-babel-helpers/_config.js000066400000000000000000000001771415504077600261500ustar00rootroot00000000000000module.exports = { description: 'Removes unused babel helpers from the build (#1595)', expectedWarnings: ['EMPTY_BUNDLE'] }; rollup-2.61.1/test/form/samples/removes-unused-babel-helpers/_expected.js000066400000000000000000000000011415504077600264660ustar00rootroot00000000000000 rollup-2.61.1/test/form/samples/removes-unused-babel-helpers/main.js000066400000000000000000000300241415504077600254620ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/renamed-pattern-defaults/000077500000000000000000000000001415504077600234105ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/renamed-pattern-defaults/_config.js000066400000000000000000000001561415504077600253540ustar00rootroot00000000000000module.exports = { description: 'handles deconflicting of variables used as defaults in patterns (#2445)' }; rollup-2.61.1/test/form/samples/renamed-pattern-defaults/_expected.js000066400000000000000000000002161415504077600257050ustar00rootroot00000000000000const EMPTY$1 = null; const {foo: foo$1 = EMPTY$1} = {}; console.log(foo$1); const EMPTY = null; const {foo = EMPTY} = {}; console.log(foo); rollup-2.61.1/test/form/samples/renamed-pattern-defaults/dep.js000066400000000000000000000001001415504077600245050ustar00rootroot00000000000000const EMPTY = null; const {foo = EMPTY} = {}; console.log(foo); rollup-2.61.1/test/form/samples/renamed-pattern-defaults/main.js000066400000000000000000000001241415504077600246670ustar00rootroot00000000000000import './dep.js'; const EMPTY = null; const {foo = EMPTY} = {}; console.log(foo); rollup-2.61.1/test/form/samples/render-chunk-plugin-sourcemaps/000077500000000000000000000000001415504077600245555ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/render-chunk-plugin-sourcemaps/_config.js000066400000000000000000000006201415504077600265150ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/form/samples/render-chunk-plugin-sourcemaps/_expected/000077500000000000000000000000001415504077600265155ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/render-chunk-plugin-sourcemaps/_expected/amd.js000066400000000000000000000001071415504077600276120ustar00rootroot00000000000000/* first plugin */ /* second plugin */ //# sourceMappingURL=amd.js.map rollup-2.61.1/test/form/samples/render-chunk-plugin-sourcemaps/_expected/amd.js.map000066400000000000000000000001271415504077600303700ustar00rootroot00000000000000{"version":3,"file":"amd.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}rollup-2.61.1/test/form/samples/render-chunk-plugin-sourcemaps/_expected/cjs.js000066400000000000000000000001071415504077600276300ustar00rootroot00000000000000/* first plugin */ /* second plugin */ //# sourceMappingURL=cjs.js.map rollup-2.61.1/test/form/samples/render-chunk-plugin-sourcemaps/_expected/cjs.js.map000066400000000000000000000001271415504077600304060ustar00rootroot00000000000000{"version":3,"file":"cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}rollup-2.61.1/test/form/samples/render-chunk-plugin-sourcemaps/_expected/es.js000066400000000000000000000001061415504077600274570ustar00rootroot00000000000000/* first plugin */ /* second plugin */ //# sourceMappingURL=es.js.map rollup-2.61.1/test/form/samples/render-chunk-plugin-sourcemaps/_expected/es.js.map000066400000000000000000000001261415504077600302350ustar00rootroot00000000000000{"version":3,"file":"es.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}rollup-2.61.1/test/form/samples/render-chunk-plugin-sourcemaps/_expected/iife.js000066400000000000000000000001101415504077600277570ustar00rootroot00000000000000/* first plugin */ /* second plugin */ //# sourceMappingURL=iife.js.map rollup-2.61.1/test/form/samples/render-chunk-plugin-sourcemaps/_expected/iife.js.map000066400000000000000000000001301415504077600305350ustar00rootroot00000000000000{"version":3,"file":"iife.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}rollup-2.61.1/test/form/samples/render-chunk-plugin-sourcemaps/_expected/system.js000066400000000000000000000001121415504077600303710ustar00rootroot00000000000000/* first plugin */ /* second plugin */ //# sourceMappingURL=system.js.map rollup-2.61.1/test/form/samples/render-chunk-plugin-sourcemaps/_expected/system.js.map000066400000000000000000000001321415504077600311470ustar00rootroot00000000000000{"version":3,"file":"system.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}rollup-2.61.1/test/form/samples/render-chunk-plugin-sourcemaps/_expected/umd.js000066400000000000000000000001071415504077600276360ustar00rootroot00000000000000/* first plugin */ /* second plugin */ //# sourceMappingURL=umd.js.map rollup-2.61.1/test/form/samples/render-chunk-plugin-sourcemaps/_expected/umd.js.map000066400000000000000000000001271415504077600304140ustar00rootroot00000000000000{"version":3,"file":"umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}rollup-2.61.1/test/form/samples/render-chunk-plugin-sourcemaps/main.js000066400000000000000000000000261415504077600260350ustar00rootroot00000000000000console.log( 1 + 1 ); rollup-2.61.1/test/form/samples/render-chunk-plugin/000077500000000000000000000000001415504077600223765ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/render-chunk-plugin/_config.js000066400000000000000000000004061415504077600243400ustar00rootroot00000000000000module.exports = { description: 'allows plugins to hook render chunk', options: { plugins: [ { renderChunk() { return '/* first plugin */'; } }, { renderChunk(code) { return code + '\n/* second plugin */'; } } ] } }; rollup-2.61.1/test/form/samples/render-chunk-plugin/_expected/000077500000000000000000000000001415504077600243365ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/render-chunk-plugin/_expected/amd.js000066400000000000000000000000471415504077600254360ustar00rootroot00000000000000/* first plugin */ /* second plugin */ rollup-2.61.1/test/form/samples/render-chunk-plugin/_expected/cjs.js000066400000000000000000000000471415504077600254540ustar00rootroot00000000000000/* first plugin */ /* second plugin */ rollup-2.61.1/test/form/samples/render-chunk-plugin/_expected/es.js000066400000000000000000000000471415504077600253040ustar00rootroot00000000000000/* first plugin */ /* second plugin */ rollup-2.61.1/test/form/samples/render-chunk-plugin/_expected/iife.js000066400000000000000000000000471415504077600256110ustar00rootroot00000000000000/* first plugin */ /* second plugin */ rollup-2.61.1/test/form/samples/render-chunk-plugin/_expected/system.js000066400000000000000000000000471415504077600262210ustar00rootroot00000000000000/* first plugin */ /* second plugin */ rollup-2.61.1/test/form/samples/render-chunk-plugin/_expected/umd.js000066400000000000000000000000471415504077600254620ustar00rootroot00000000000000/* first plugin */ /* second plugin */ rollup-2.61.1/test/form/samples/render-chunk-plugin/main.js000066400000000000000000000000261415504077600236560ustar00rootroot00000000000000console.log( 1 + 1 ); rollup-2.61.1/test/form/samples/render-declaration-semicolons/000077500000000000000000000000001415504077600244305ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/render-declaration-semicolons/_config.js000066400000000000000000000002101415504077600263630ustar00rootroot00000000000000module.exports = { description: 'properly inserts semi-colons after declarations (#1993)', options: { output: { name: 'bundle' } } }; rollup-2.61.1/test/form/samples/render-declaration-semicolons/_expected/000077500000000000000000000000001415504077600263705ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/render-declaration-semicolons/_expected/amd.js000066400000000000000000000007301415504077600274670ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/render-declaration-semicolons/_expected/cjs.js000066400000000000000000000006231415504077600275060ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/form/samples/render-declaration-semicolons/_expected/es.js000066400000000000000000000003571415504077600273420ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/render-declaration-semicolons/_expected/iife.js000066400000000000000000000007471415504077600276520ustar00rootroot00000000000000var 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; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/render-declaration-semicolons/_expected/system.js000066400000000000000000000007121415504077600302520ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/render-declaration-semicolons/_expected/umd.js000066400000000000000000000013651415504077600275200ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/render-declaration-semicolons/main.js000066400000000000000000000003411415504077600257100ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/render-named-export-declarations/000077500000000000000000000000001415504077600250435ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/render-named-export-declarations/_config.js000066400000000000000000000001621415504077600270040ustar00rootroot00000000000000module.exports = { description: 'renders named export declarations', options: { output: { name: 'bundle' } } }; rollup-2.61.1/test/form/samples/render-named-export-declarations/_expected/000077500000000000000000000000001415504077600270035ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/render-named-export-declarations/_expected/amd.js000066400000000000000000000006461415504077600301100ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/render-named-export-declarations/_expected/cjs.js000066400000000000000000000005511415504077600301210ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/form/samples/render-named-export-declarations/_expected/es.js000066400000000000000000000002571415504077600277540ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/render-named-export-declarations/_expected/iife.js000066400000000000000000000006651415504077600302640ustar00rootroot00000000000000var 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; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/render-named-export-declarations/_expected/system.js000066400000000000000000000007321415504077600306670ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/render-named-export-declarations/_expected/umd.js000066400000000000000000000013031415504077600301230ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/render-named-export-declarations/main.js000066400000000000000000000002171415504077600263250ustar00rootroot00000000000000export 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-2.61.1/test/form/samples/render-removed-declarations/000077500000000000000000000000001415504077600241015ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/render-removed-declarations/_config.js000066400000000000000000000001201415504077600260340ustar00rootroot00000000000000module.exports = { description: 'renders tree-shaken variable declarations' }; rollup-2.61.1/test/form/samples/render-removed-declarations/_expected.js000066400000000000000000000021761415504077600264050ustar00rootroot00000000000000// -> 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-2.61.1/test/form/samples/render-removed-declarations/main.js000066400000000000000000000033431415504077600253660ustar00rootroot00000000000000// -> 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-2.61.1/test/form/samples/render-removed-statements/000077500000000000000000000000001415504077600236205ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/render-removed-statements/_config.js000066400000000000000000000001441415504077600255610ustar00rootroot00000000000000module.exports = { description: 'make sure removed statements do no leave unwanted white-space' }; rollup-2.61.1/test/form/samples/render-removed-statements/_expected.js000066400000000000000000000022501415504077600261150ustar00rootroot00000000000000/* 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-2.61.1/test/form/samples/render-removed-statements/main.js000066400000000000000000000037141415504077600251070ustar00rootroot00000000000000/* 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-2.61.1/test/form/samples/resolution-order/000077500000000000000000000000001415504077600220315ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/resolution-order/_config.js000066400000000000000000000004131415504077600237710ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/form/samples/resolution-order/_expected.js000066400000000000000000000000251415504077600243240ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/form/samples/resolution-order/locale.js000066400000000000000000000001661415504077600236310ustar00rootroot00000000000000import { utcSunday, utcTuesday } from './utcWeek' export default function formatLocale(locale) { utcSunday() } rollup-2.61.1/test/form/samples/resolution-order/main.js000066400000000000000000000001761415504077600233170ustar00rootroot00000000000000import { utcMonday } from './utcWeek'; import formatLocale from './locale'; utcMonday(); formatLocale(); console.log('main'); rollup-2.61.1/test/form/samples/resolution-order/utcWeek.js000066400000000000000000000013101415504077600237710ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/resolve-external-dynamic-imports/000077500000000000000000000000001415504077600251315ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/resolve-external-dynamic-imports/_config.js000066400000000000000000000005751415504077600271020ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/form/samples/resolve-external-dynamic-imports/_expected/000077500000000000000000000000001415504077600270715ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/resolve-external-dynamic-imports/_expected/amd.js000066400000000000000000000020661415504077600301740ustar00rootroot00000000000000define(['require', 'exports', 'external'], (function (require, exports, myExternal) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? 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 myExternal__default = /*#__PURE__*/_interopDefaultLegacy(myExternal); const test = () => myExternal__default["default"]; const someDynamicImport = () => new Promise(function (resolve, reject) { require(['external'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }); exports.someDynamicImport = someDynamicImport; exports.test = test; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/resolve-external-dynamic-imports/_expected/cjs.js000066400000000000000000000017041415504077600302100ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var myExternal = require('external'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? 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 myExternal__default = /*#__PURE__*/_interopDefaultLegacy(myExternal); const test = () => myExternal__default["default"]; const someDynamicImport = () => Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('external')); }); exports.someDynamicImport = someDynamicImport; exports.test = test; rollup-2.61.1/test/form/samples/resolve-external-dynamic-imports/_expected/es.js000066400000000000000000000002351415504077600300360ustar00rootroot00000000000000import myExternal from 'external'; const test = () => myExternal; const someDynamicImport = () => import('external'); export { someDynamicImport, test }; rollup-2.61.1/test/form/samples/resolve-external-dynamic-imports/_expected/iife.js000066400000000000000000000010311415504077600303360ustar00rootroot00000000000000var bundle = (function (exports, myExternal) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var myExternal__default = /*#__PURE__*/_interopDefaultLegacy(myExternal); const test = () => myExternal__default["default"]; const someDynamicImport = () => import('external'); exports.someDynamicImport = someDynamicImport; exports.test = test; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}, myExternal); rollup-2.61.1/test/form/samples/resolve-external-dynamic-imports/_expected/system.js000066400000000000000000000005631415504077600307570ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/resolve-external-dynamic-imports/_expected/umd.js000066400000000000000000000015171415504077600302200ustar00rootroot00000000000000(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'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var myExternal__default = /*#__PURE__*/_interopDefaultLegacy(myExternal); const test = () => myExternal__default["default"]; const someDynamicImport = () => import('external'); exports.someDynamicImport = someDynamicImport; exports.test = test; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/resolve-external-dynamic-imports/main.js000066400000000000000000000001111415504077600264040ustar00rootroot00000000000000export * from './someStaticImport'; export * from './someDynamicImport'; rollup-2.61.1/test/form/samples/resolve-external-dynamic-imports/someDynamicImport.js000066400000000000000000000000731415504077600311320ustar00rootroot00000000000000export const someDynamicImport = () => import('external'); rollup-2.61.1/test/form/samples/resolve-external-dynamic-imports/someStaticImport.js000066400000000000000000000001121415504077600307670ustar00rootroot00000000000000import myExternal from 'external'; export const test = () => myExternal; rollup-2.61.1/test/form/samples/resolve-import-meta-url-export/000077500000000000000000000000001415504077600245475ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/resolve-import-meta-url-export/_config.js000066400000000000000000000003451415504077600265130ustar00rootroot00000000000000module.exports = { description: 'correctly exports resolved import.meta.url', options: { plugins: [ { resolveImportMeta(prop) { return prop ? "'url'" : "'meta'"; } } ], output: { name: 'bundle' } } }; rollup-2.61.1/test/form/samples/resolve-import-meta-url-export/_expected/000077500000000000000000000000001415504077600265075ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/resolve-import-meta-url-export/_expected/amd.js000066400000000000000000000003471415504077600276120ustar00rootroot00000000000000define(['module', 'exports'], (function (module, exports) { 'use strict'; const url = 'url'; const meta = 'meta'; exports.meta = meta; exports.url = url; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/resolve-import-meta-url-export/_expected/cjs.js000066400000000000000000000002401415504077600276200ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const url = 'url'; const meta = 'meta'; exports.meta = meta; exports.url = url; rollup-2.61.1/test/form/samples/resolve-import-meta-url-export/_expected/es.js000066400000000000000000000000771415504077600274600ustar00rootroot00000000000000const url = 'url'; const meta = 'meta'; export { meta, url }; rollup-2.61.1/test/form/samples/resolve-import-meta-url-export/_expected/iife.js000066400000000000000000000003441415504077600277620ustar00rootroot00000000000000var bundle = (function (exports) { 'use strict'; const url = 'url'; const meta = 'meta'; exports.meta = meta; exports.url = url; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/resolve-import-meta-url-export/_expected/system.js000066400000000000000000000003161415504077600303710ustar00rootroot00000000000000System.register('bundle', [], (function (exports, module) { 'use strict'; return { execute: (function () { const url = exports('url', 'url'); const meta = exports('meta', 'meta'); }) }; })); rollup-2.61.1/test/form/samples/resolve-import-meta-url-export/_expected/umd.js000066400000000000000000000007621415504077600276370ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/resolve-import-meta-url-export/main.js000066400000000000000000000001051415504077600260250ustar00rootroot00000000000000export const url = import.meta.url; export const meta = import.meta; rollup-2.61.1/test/form/samples/resolve-import-meta-url/000077500000000000000000000000001415504077600232305ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/resolve-import-meta-url/_config.js000066400000000000000000000010341415504077600251700ustar00rootroot00000000000000module.exports = { description: 'allows to configure import.meta.url', options: { plugins: [ { resolveImportMeta(prop, { chunkId, moduleId }) { if (!moduleId.endsWith('resolved.js')) { return `'${prop}=${chunkId}:${moduleId .replace(/\\/g, '/') .split('/') .slice(-2) .join('/')}'`; } return null; } }, { resolveImportMeta(prop, { moduleId }) { if (!moduleId.endsWith('unresolved.js')) { return `'resolved'`; } return null; } } ] } }; rollup-2.61.1/test/form/samples/resolve-import-meta-url/_expected/000077500000000000000000000000001415504077600251705ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/resolve-import-meta-url/_expected/amd.js000066400000000000000000000007421415504077600262720ustar00rootroot00000000000000define(['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-2.61.1/test/form/samples/resolve-import-meta-url/_expected/cjs.js000066400000000000000000000013311415504077600263030ustar00rootroot00000000000000'use strict'; console.log('resolved'); console.log('resolved'); console.log('resolved'); console.log((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('cjs.js', document.baseURI).href))); console.log(undefined); console.log(({ url: (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.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-2.61.1/test/form/samples/resolve-import-meta-url/_expected/es.js000066400000000000000000000005421415504077600261360ustar00rootroot00000000000000console.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-2.61.1/test/form/samples/resolve-import-meta-url/_expected/iife.js000066400000000000000000000011001415504077600264320ustar00rootroot00000000000000(function () { 'use strict'; console.log('resolved'); console.log('resolved'); console.log('resolved'); console.log((document.currentScript && document.currentScript.src || new URL('iife.js', document.baseURI).href)); console.log(undefined); console.log(({ url: (document.currentScript && document.currentScript.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-2.61.1/test/form/samples/resolve-import-meta-url/_expected/system.js000066400000000000000000000007761415504077600270640ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/resolve-import-meta-url/_expected/umd.js000066400000000000000000000020061415504077600263110ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log('resolved'); console.log('resolved'); console.log('resolved'); console.log((typeof document === 'undefined' && typeof location === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : typeof document === 'undefined' ? location.href : (document.currentScript && document.currentScript.src || new URL('umd.js', document.baseURI).href))); console.log(undefined); console.log(({ url: (typeof document === 'undefined' && typeof location === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : typeof document === 'undefined' ? location.href : (document.currentScript && document.currentScript.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-2.61.1/test/form/samples/resolve-import-meta-url/main.js000066400000000000000000000002131415504077600245060ustar00rootroot00000000000000import './resolved'; import './unresolved'; console.log(import.meta.url); console.log(import.meta.privateProp); console.log(import.meta); rollup-2.61.1/test/form/samples/resolve-import-meta-url/resolved.js000066400000000000000000000001361415504077600254110ustar00rootroot00000000000000console.log(import.meta.url); console.log(import.meta.privateProp); console.log(import.meta); rollup-2.61.1/test/form/samples/resolve-import-meta-url/unresolved.js000066400000000000000000000001361415504077600257540ustar00rootroot00000000000000console.log(import.meta.url); console.log(import.meta.privateProp); console.log(import.meta); rollup-2.61.1/test/form/samples/return-statement/000077500000000000000000000000001415504077600220365ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/return-statement/missing-space/000077500000000000000000000000001415504077600246005ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/return-statement/missing-space/_config.js000066400000000000000000000001441415504077600265410ustar00rootroot00000000000000module.exports = { description: 'Inserts space when simplifying return statement without space' }; rollup-2.61.1/test/form/samples/return-statement/missing-space/_expected.js000066400000000000000000000000701415504077600270730ustar00rootroot00000000000000function test() { return null; } console.log(test()); rollup-2.61.1/test/form/samples/return-statement/missing-space/main.js000066400000000000000000000000731415504077600260620ustar00rootroot00000000000000function test() { return!1||null; } console.log(test()); rollup-2.61.1/test/form/samples/return-value-access-in-conditional/000077500000000000000000000000001415504077600253125ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/return-value-access-in-conditional/_config.js000066400000000000000000000001531415504077600272530ustar00rootroot00000000000000module.exports = { description: 'handles accessing funciton return values in deoptimized conditionals' }; rollup-2.61.1/test/form/samples/return-value-access-in-conditional/_expected.js000066400000000000000000000000551415504077600276100ustar00rootroot00000000000000console.log(true); console.log('retained'); rollup-2.61.1/test/form/samples/return-value-access-in-conditional/main.js000066400000000000000000000002431415504077600265730ustar00rootroot00000000000000function foo() { const result = false; return result; } console.log(foo() || true); if (foo() || true) console.log('retained'); else console.log('removed'); rollup-2.61.1/test/form/samples/self-calling-function-with-effects/000077500000000000000000000000001415504077600252665ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/self-calling-function-with-effects/_config.js000066400000000000000000000001311415504077600272230ustar00rootroot00000000000000module.exports = { description: 'discards a self-calling function with side-effects' }; rollup-2.61.1/test/form/samples/self-calling-function-with-effects/_expected/000077500000000000000000000000001415504077600272265ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/self-calling-function-with-effects/_expected/amd.js000066400000000000000000000003651415504077600303310ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/self-calling-function-with-effects/_expected/cjs.js000066400000000000000000000003141415504077600303410ustar00rootroot00000000000000'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-2.61.1/test/form/samples/self-calling-function-with-effects/_expected/es.js000066400000000000000000000002751415504077600301770ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/self-calling-function-with-effects/_expected/iife.js000066400000000000000000000003601415504077600304770ustar00rootroot00000000000000(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-2.61.1/test/form/samples/self-calling-function-with-effects/_expected/system.js000066400000000000000000000005121415504077600311060ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/self-calling-function-with-effects/_expected/umd.js000066400000000000000000000005231415504077600303510ustar00rootroot00000000000000(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-2.61.1/test/form/samples/self-calling-function-with-effects/main.js000066400000000000000000000002751415504077600265540ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/self-calling-function/000077500000000000000000000000001415504077600227005ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/self-calling-function/_config.js000066400000000000000000000002011415504077600246330ustar00rootroot00000000000000module.exports = { description: 'discards a self-calling function without side-effects', expectedWarnings: ['EMPTY_BUNDLE'] }; rollup-2.61.1/test/form/samples/self-calling-function/_expected/000077500000000000000000000000001415504077600246405ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/self-calling-function/_expected/amd.js000066400000000000000000000000541415504077600257360ustar00rootroot00000000000000define((function () { 'use strict'; })); rollup-2.61.1/test/form/samples/self-calling-function/_expected/cjs.js000066400000000000000000000000171415504077600257530ustar00rootroot00000000000000'use strict'; rollup-2.61.1/test/form/samples/self-calling-function/_expected/es.js000066400000000000000000000000011415504077600255740ustar00rootroot00000000000000 rollup-2.61.1/test/form/samples/self-calling-function/_expected/iife.js000066400000000000000000000000471415504077600261130ustar00rootroot00000000000000(function () { 'use strict'; })(); rollup-2.61.1/test/form/samples/self-calling-function/_expected/system.js000066400000000000000000000001471415504077600265240ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { }) }; })); rollup-2.61.1/test/form/samples/self-calling-function/_expected/umd.js000066400000000000000000000002121415504077600257560ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; })); rollup-2.61.1/test/form/samples/self-calling-function/main.js000066400000000000000000000002411415504077600241570ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/self-contained-bundle/000077500000000000000000000000001415504077600226575ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/self-contained-bundle/_config.js000066400000000000000000000000741415504077600246220ustar00rootroot00000000000000module.exports = { description: 'self-contained bundle' }; rollup-2.61.1/test/form/samples/self-contained-bundle/_expected/000077500000000000000000000000001415504077600246175ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/self-contained-bundle/_expected/amd.js000066400000000000000000000003541415504077600257200ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/self-contained-bundle/_expected/cjs.js000066400000000000000000000003051415504077600257320ustar00rootroot00000000000000'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-2.61.1/test/form/samples/self-contained-bundle/_expected/es.js000066400000000000000000000002661415504077600255700ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/self-contained-bundle/_expected/iife.js000066400000000000000000000003471415504077600260750ustar00rootroot00000000000000(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-2.61.1/test/form/samples/self-contained-bundle/_expected/system.js000066400000000000000000000004751415504077600265070ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/self-contained-bundle/_expected/umd.js000066400000000000000000000005121415504077600257400ustar00rootroot00000000000000(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-2.61.1/test/form/samples/self-contained-bundle/foo.js000066400000000000000000000002231415504077600237750ustar00rootroot00000000000000export default function foo () { console.log( bar() ); } function bar () { return 42; } function baz () { return 'this should be excluded'; } rollup-2.61.1/test/form/samples/self-contained-bundle/main.js000066400000000000000000000002031415504077600241340ustar00rootroot00000000000000import foo from './foo'; // comment before 1 console.log( 1 ); console.log( 2 ); // comment alongside 2 foo(); console.log( 3 ); rollup-2.61.1/test/form/samples/self-deoptimization/000077500000000000000000000000001415504077600225035ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/self-deoptimization/_config.js000066400000000000000000000001721415504077600244450ustar00rootroot00000000000000module.exports = { description: 'handles situations where a member expression is deoptimized while being deoptimized' }; rollup-2.61.1/test/form/samples/self-deoptimization/_expected.js000066400000000000000000000002061415504077600247770ustar00rootroot00000000000000function foo(a) { var b = bar({}, a); b && b.delete(); } function bar(a, b) { return (b = 1) ? a.a[b] || null : null; } foo({}); rollup-2.61.1/test/form/samples/self-deoptimization/main.js000066400000000000000000000002061415504077600237630ustar00rootroot00000000000000function foo(a) { var b = bar({}, a); b && b.delete(); } function bar(a, b) { return (b = 1) ? a.a[b] || null : null; } foo({}); rollup-2.61.1/test/form/samples/sequence-expression/000077500000000000000000000000001415504077600225225ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/sequence-expression/_config.js000066400000000000000000000001531415504077600244630ustar00rootroot00000000000000module.exports = { description: 'only retain expressions with effects in sequence expressions (#1649)' }; rollup-2.61.1/test/form/samples/sequence-expression/_expected.js000066400000000000000000000007641415504077600250270ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/sequence-expression/foo.js000066400000000000000000000000651415504077600236440ustar00rootroot00000000000000export function foo () { console.log( 'foo' ); } rollup-2.61.1/test/form/samples/sequence-expression/main.js000066400000000000000000000012441415504077600240050ustar00rootroot00000000000000import * 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-2.61.1/test/form/samples/shorthand-properties/000077500000000000000000000000001415504077600227015ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/shorthand-properties/_config.js000066400000000000000000000001261415504077600246420ustar00rootroot00000000000000module.exports = { description: 'expands shorthand properties as necessary (#61)' }; rollup-2.61.1/test/form/samples/shorthand-properties/_expected/000077500000000000000000000000001415504077600246415ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/shorthand-properties/_expected/amd.js000066400000000000000000000005041415504077600257370ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/shorthand-properties/_expected/cjs.js000066400000000000000000000004311415504077600257540ustar00rootroot00000000000000'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-2.61.1/test/form/samples/shorthand-properties/_expected/es.js000066400000000000000000000004121415504077600256030ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/shorthand-properties/_expected/iife.js000066400000000000000000000004771415504077600261230ustar00rootroot00000000000000(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-2.61.1/test/form/samples/shorthand-properties/_expected/system.js000066400000000000000000000006351415504077600265270ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/shorthand-properties/_expected/umd.js000066400000000000000000000006421415504077600257660ustar00rootroot00000000000000(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-2.61.1/test/form/samples/shorthand-properties/bar.js000066400000000000000000000001041415504077600237760ustar00rootroot00000000000000function x () { return 'bar'; } var bar = { x }; export { bar }; rollup-2.61.1/test/form/samples/shorthand-properties/baz.js000066400000000000000000000001041415504077600240060ustar00rootroot00000000000000function x () { return 'baz'; } var baz = { x }; export { baz }; rollup-2.61.1/test/form/samples/shorthand-properties/foo.js000066400000000000000000000001041415504077600240150ustar00rootroot00000000000000function x () { return 'foo'; } var foo = { x }; export { foo }; rollup-2.61.1/test/form/samples/shorthand-properties/main.js000066400000000000000000000002701415504077600241620ustar00rootroot00000000000000import { 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-2.61.1/test/form/samples/side-effect-b/000077500000000000000000000000001415504077600211125ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-b/_config.js000066400000000000000000000001651415504077600230560ustar00rootroot00000000000000module.exports = { description: 'discards IIFE with no side-effects', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/side-effect-b/_expected/000077500000000000000000000000001415504077600230525ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-b/_expected/amd.js000066400000000000000000000001121415504077600241430ustar00rootroot00000000000000define((function () { 'use strict'; var main = 42; return main; })); rollup-2.61.1/test/form/samples/side-effect-b/_expected/cjs.js000066400000000000000000000000661415504077600241710ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-2.61.1/test/form/samples/side-effect-b/_expected/es.js000066400000000000000000000000541415504077600240160ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-2.61.1/test/form/samples/side-effect-b/_expected/iife.js000066400000000000000000000001241415504077600243210ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var main = 42; return main; })(); rollup-2.61.1/test/form/samples/side-effect-b/_expected/system.js000066400000000000000000000002371415504077600247360ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', 42); }) }; })); rollup-2.61.1/test/form/samples/side-effect-b/_expected/umd.js000066400000000000000000000005611415504077600241770ustar00rootroot00000000000000(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-2.61.1/test/form/samples/side-effect-b/main.js000066400000000000000000000001661415504077600223770ustar00rootroot00000000000000var Unused = (function () { function Unused () {} Unused.prototype = {}; return Unused; }()); export default 42; rollup-2.61.1/test/form/samples/side-effect-c/000077500000000000000000000000001415504077600211135ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-c/_config.js000066400000000000000000000001711415504077600230540ustar00rootroot00000000000000module.exports = { description: 'discards function with no side-effects', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/side-effect-c/_expected/000077500000000000000000000000001415504077600230535ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-c/_expected/amd.js000066400000000000000000000001121415504077600241440ustar00rootroot00000000000000define((function () { 'use strict'; var main = 42; return main; })); rollup-2.61.1/test/form/samples/side-effect-c/_expected/cjs.js000066400000000000000000000000661415504077600241720ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-2.61.1/test/form/samples/side-effect-c/_expected/es.js000066400000000000000000000000541415504077600240170ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-2.61.1/test/form/samples/side-effect-c/_expected/iife.js000066400000000000000000000001241415504077600243220ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var main = 42; return main; })(); rollup-2.61.1/test/form/samples/side-effect-c/_expected/system.js000066400000000000000000000002371415504077600247370ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', 42); }) }; })); rollup-2.61.1/test/form/samples/side-effect-c/_expected/umd.js000066400000000000000000000005611415504077600242000ustar00rootroot00000000000000(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-2.61.1/test/form/samples/side-effect-c/main.js000066400000000000000000000002141415504077600223720ustar00rootroot00000000000000var factory = function () { function Unused () {} Unused.prototype = {}; return Unused; }; var Unused = factory(); export default 42; rollup-2.61.1/test/form/samples/side-effect-d/000077500000000000000000000000001415504077600211145ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-d/_config.js000066400000000000000000000001771415504077600230630ustar00rootroot00000000000000module.exports = { description: 'excludes functions that are known to be pure', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/side-effect-d/_expected/000077500000000000000000000000001415504077600230545ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-d/_expected/amd.js000066400000000000000000000001121415504077600241450ustar00rootroot00000000000000define((function () { 'use strict'; var main = 42; return main; })); rollup-2.61.1/test/form/samples/side-effect-d/_expected/cjs.js000066400000000000000000000000661415504077600241730ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-2.61.1/test/form/samples/side-effect-d/_expected/es.js000066400000000000000000000000541415504077600240200ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-2.61.1/test/form/samples/side-effect-d/_expected/iife.js000066400000000000000000000001241415504077600243230ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var main = 42; return main; })(); rollup-2.61.1/test/form/samples/side-effect-d/_expected/system.js000066400000000000000000000002371415504077600247400ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', 42); }) }; })); rollup-2.61.1/test/form/samples/side-effect-d/_expected/umd.js000066400000000000000000000005611415504077600242010ustar00rootroot00000000000000(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-2.61.1/test/form/samples/side-effect-d/main.js000066400000000000000000000001211415504077600223700ustar00rootroot00000000000000var obj = { foo: 1, bar: 2 }; var keys = Object.keys( obj ); export default 42; rollup-2.61.1/test/form/samples/side-effect-default-reexport/000077500000000000000000000000001415504077600241635ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-default-reexport/_config.js000066400000000000000000000003371415504077600261300ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/form/samples/side-effect-default-reexport/_expected.js000066400000000000000000000012161415504077600264610ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/side-effect-default-reexport/default-export/000077500000000000000000000000001415504077600271265ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-default-reexport/default-export/index.js000066400000000000000000000001751415504077600305760ustar00rootroot00000000000000import Menu from './index2'; import Item from './item'; /* default-export/index */ Menu.Item2 = Item; export default Menu; rollup-2.61.1/test/form/samples/side-effect-default-reexport/default-export/index2.js000066400000000000000000000001741415504077600306570ustar00rootroot00000000000000import Menu from './menu'; import Item from './item'; /* default-export/index2 */ Menu.Item1 = Item; export default Menu; rollup-2.61.1/test/form/samples/side-effect-default-reexport/default-export/item.js000066400000000000000000000000421415504077600304160ustar00rootroot00000000000000export default { name: 'item' }; rollup-2.61.1/test/form/samples/side-effect-default-reexport/default-export/menu.js000066400000000000000000000000421415504077600304240ustar00rootroot00000000000000export default { name: 'menu' }; rollup-2.61.1/test/form/samples/side-effect-default-reexport/default-export/reexport.js000066400000000000000000000000531415504077600313320ustar00rootroot00000000000000export { default as Menu } from './index'; rollup-2.61.1/test/form/samples/side-effect-default-reexport/default-export2/000077500000000000000000000000001415504077600272105ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-default-reexport/default-export2/index.js000066400000000000000000000001761415504077600306610ustar00rootroot00000000000000import Menu from './index2'; import Item from './item'; /* default-export2/index */ Menu.Item2 = Item; export default Menu; rollup-2.61.1/test/form/samples/side-effect-default-reexport/default-export2/index2.js000066400000000000000000000001751415504077600307420ustar00rootroot00000000000000import Menu from './menu'; import Item from './item'; /* default-export2/index2 */ Menu.Item1 = Item; export default Menu; rollup-2.61.1/test/form/samples/side-effect-default-reexport/default-export2/item.js000066400000000000000000000000421415504077600305000ustar00rootroot00000000000000export default { name: 'item' }; rollup-2.61.1/test/form/samples/side-effect-default-reexport/default-export2/menu.js000066400000000000000000000000421415504077600305060ustar00rootroot00000000000000export default { name: 'menu' }; rollup-2.61.1/test/form/samples/side-effect-default-reexport/main.js000066400000000000000000000004711415504077600254470ustar00rootroot00000000000000import { 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-2.61.1/test/form/samples/side-effect-default-reexport/named-export/000077500000000000000000000000001415504077600265665ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-default-reexport/named-export/index.js000066400000000000000000000001731415504077600302340ustar00rootroot00000000000000import { Menu } from './index2'; import Item from './item'; /* named-export/index */ Menu.Item2 = Item; export { Menu }; rollup-2.61.1/test/form/samples/side-effect-default-reexport/named-export/index2.js000066400000000000000000000001661415504077600303200ustar00rootroot00000000000000import Menu from './menu'; import Item from './item'; /* named-export/index2 */ Menu.Item1 = Item; export { Menu }; rollup-2.61.1/test/form/samples/side-effect-default-reexport/named-export/item.js000066400000000000000000000000421415504077600300560ustar00rootroot00000000000000export default { name: 'item' }; rollup-2.61.1/test/form/samples/side-effect-default-reexport/named-export/menu.js000066400000000000000000000000421415504077600300640ustar00rootroot00000000000000export default { name: 'menu' }; rollup-2.61.1/test/form/samples/side-effect-e/000077500000000000000000000000001415504077600211155ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-e/_config.js000066400000000000000000000002101415504077600230500ustar00rootroot00000000000000module.exports = { description: 'accounts for local scopes when tested function purity', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/side-effect-e/_expected/000077500000000000000000000000001415504077600230555ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-e/_expected/amd.js000066400000000000000000000003651415504077600241600ustar00rootroot00000000000000define((function () { 'use strict'; function foo () { var Object = { keys: function () { console.log( 'side-effect' ); } }; var obj = { foo: 1, bar: 2 }; Object.keys( obj ); } foo(); var main = 42; return main; })); rollup-2.61.1/test/form/samples/side-effect-e/_expected/cjs.js000066400000000000000000000003271415504077600241740ustar00rootroot00000000000000'use strict'; function foo () { var Object = { keys: function () { console.log( 'side-effect' ); } }; var obj = { foo: 1, bar: 2 }; Object.keys( obj ); } foo(); var main = 42; module.exports = main; rollup-2.61.1/test/form/samples/side-effect-e/_expected/es.js000066400000000000000000000003151415504077600240210ustar00rootroot00000000000000function foo () { var Object = { keys: function () { console.log( 'side-effect' ); } }; var obj = { foo: 1, bar: 2 }; Object.keys( obj ); } foo(); var main = 42; export { main as default }; rollup-2.61.1/test/form/samples/side-effect-e/_expected/iife.js000066400000000000000000000003771415504077600243360ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; function foo () { var Object = { keys: function () { console.log( 'side-effect' ); } }; var obj = { foo: 1, bar: 2 }; Object.keys( obj ); } foo(); var main = 42; return main; })(); rollup-2.61.1/test/form/samples/side-effect-e/_expected/system.js000066400000000000000000000005361415504077600247430ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { function foo () { var Object = { keys: function () { console.log( 'side-effect' ); } }; var obj = { foo: 1, bar: 2 }; Object.keys( obj ); } foo(); var main = exports('default', 42); }) }; })); rollup-2.61.1/test/form/samples/side-effect-e/_expected/umd.js000066400000000000000000000010341415504077600241760ustar00rootroot00000000000000(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 () { var Object = { keys: function () { console.log( 'side-effect' ); } }; var obj = { foo: 1, bar: 2 }; Object.keys( obj ); } foo(); var main = 42; return main; })); rollup-2.61.1/test/form/samples/side-effect-e/main.js000066400000000000000000000002771415504077600224050ustar00rootroot00000000000000function foo () { var Object = { keys: function () { console.log( 'side-effect' ); } }; var obj = { foo: 1, bar: 2 }; var keys = Object.keys( obj ); } foo(); export default 42; rollup-2.61.1/test/form/samples/side-effect-es5-classes/000077500000000000000000000000001415504077600230205ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-es5-classes/_config.js000066400000000000000000000002231415504077600247570ustar00rootroot00000000000000module.exports = { description: 'omits ES5 classes which are pure (e.g. they only assign to `this`)', expectedWarnings: ['THIS_IS_UNDEFINED'] }; rollup-2.61.1/test/form/samples/side-effect-es5-classes/_expected.js000066400000000000000000000006311415504077600253160ustar00rootroot00000000000000function 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(5); Corge(5); new Arrow(5); console.log( 'after' ); rollup-2.61.1/test/form/samples/side-effect-es5-classes/arrow.js000066400000000000000000000000621415504077600245060ustar00rootroot00000000000000export var Arrow = ( x ) => { this.value = x; }; rollup-2.61.1/test/form/samples/side-effect-es5-classes/bar.js000066400000000000000000000001161415504077600241200ustar00rootroot00000000000000export function Bar ( x ) { console.log( 'side effect' ); this.value = x; } rollup-2.61.1/test/form/samples/side-effect-es5-classes/baz.js000066400000000000000000000001111415504077600241230ustar00rootroot00000000000000export function Baz ( x ) { this[ console.log( 'side effect' ) ] = x; } rollup-2.61.1/test/form/samples/side-effect-es5-classes/corge.js000066400000000000000000000000611415504077600244520ustar00rootroot00000000000000export function Corge ( x ) { this.value = x; } rollup-2.61.1/test/form/samples/side-effect-es5-classes/foo.js000066400000000000000000000001161415504077600241370ustar00rootroot00000000000000export function Foo ( x ) { this.value = x; this["string property"] = 20; } rollup-2.61.1/test/form/samples/side-effect-es5-classes/main.js000066400000000000000000000005621415504077600243050ustar00rootroot00000000000000import { 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-2.61.1/test/form/samples/side-effect-es5-classes/qux.js000066400000000000000000000001121415504077600241650ustar00rootroot00000000000000export function Qux ( x ) { this.value = console.log( 'side effect' ); } rollup-2.61.1/test/form/samples/side-effect-f/000077500000000000000000000000001415504077600211165ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-f/_config.js000066400000000000000000000002171415504077600230600ustar00rootroot00000000000000module.exports = { description: 'disregards side-effects that are contained within a function', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/side-effect-f/_expected/000077500000000000000000000000001415504077600230565ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-f/_expected/amd.js000066400000000000000000000001121415504077600241470ustar00rootroot00000000000000define((function () { 'use strict'; var main = 42; return main; })); rollup-2.61.1/test/form/samples/side-effect-f/_expected/cjs.js000066400000000000000000000000661415504077600241750ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-2.61.1/test/form/samples/side-effect-f/_expected/es.js000066400000000000000000000000541415504077600240220ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-2.61.1/test/form/samples/side-effect-f/_expected/iife.js000066400000000000000000000001241415504077600243250ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var main = 42; return main; })(); rollup-2.61.1/test/form/samples/side-effect-f/_expected/system.js000066400000000000000000000002371415504077600247420ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', 42); }) }; })); rollup-2.61.1/test/form/samples/side-effect-f/_expected/umd.js000066400000000000000000000005611415504077600242030ustar00rootroot00000000000000(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-2.61.1/test/form/samples/side-effect-f/main.js000066400000000000000000000001061415504077600223750ustar00rootroot00000000000000function foo () { var a, b, c; b = 1; } foo(); export default 42; rollup-2.61.1/test/form/samples/side-effect-g/000077500000000000000000000000001415504077600211175ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-g/_config.js000066400000000000000000000002021415504077600230530ustar00rootroot00000000000000module.exports = { description: 'excludes constructors that are known to be pure', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/side-effect-g/_expected/000077500000000000000000000000001415504077600230575ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-g/_expected/amd.js000066400000000000000000000001121415504077600241500ustar00rootroot00000000000000define((function () { 'use strict'; var main = 42; return main; })); rollup-2.61.1/test/form/samples/side-effect-g/_expected/cjs.js000066400000000000000000000000661415504077600241760ustar00rootroot00000000000000'use strict'; var main = 42; module.exports = main; rollup-2.61.1/test/form/samples/side-effect-g/_expected/es.js000066400000000000000000000000541415504077600240230ustar00rootroot00000000000000var main = 42; export { main as default }; rollup-2.61.1/test/form/samples/side-effect-g/_expected/iife.js000066400000000000000000000001241415504077600243260ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var main = 42; return main; })(); rollup-2.61.1/test/form/samples/side-effect-g/_expected/system.js000066400000000000000000000002371415504077600247430ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var main = exports('default', 42); }) }; })); rollup-2.61.1/test/form/samples/side-effect-g/_expected/umd.js000066400000000000000000000005611415504077600242040ustar00rootroot00000000000000(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-2.61.1/test/form/samples/side-effect-g/main.js000066400000000000000000000001031415504077600223730ustar00rootroot00000000000000var err = new Error( 'this will be ignored' ); export default 42; rollup-2.61.1/test/form/samples/side-effect-h/000077500000000000000000000000001415504077600211205ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-h/_config.js000066400000000000000000000001541415504077600230620ustar00rootroot00000000000000module.exports = { description: 'includes throw statements', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/side-effect-h/_expected/000077500000000000000000000000001415504077600230605ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-h/_expected/amd.js000066400000000000000000000002571415504077600241630ustar00rootroot00000000000000define((function () { 'use strict'; function foo ( ok ) { if ( !ok ) { throw new Error( 'this will be ignored' ); } } foo(); var main = 42; return main; })); rollup-2.61.1/test/form/samples/side-effect-h/_expected/cjs.js000066400000000000000000000002251415504077600241740ustar00rootroot00000000000000'use strict'; function foo ( ok ) { if ( !ok ) { throw new Error( 'this will be ignored' ); } } foo(); var main = 42; module.exports = main; rollup-2.61.1/test/form/samples/side-effect-h/_expected/es.js000066400000000000000000000002131415504077600240210ustar00rootroot00000000000000function foo ( ok ) { if ( !ok ) { throw new Error( 'this will be ignored' ); } } foo(); var main = 42; export { main as default }; rollup-2.61.1/test/form/samples/side-effect-h/_expected/iife.js000066400000000000000000000002711415504077600243320ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; function foo ( ok ) { if ( !ok ) { throw new Error( 'this will be ignored' ); } } foo(); var main = 42; return main; })(); rollup-2.61.1/test/form/samples/side-effect-h/_expected/system.js000066400000000000000000000004201415504077600247360ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/side-effect-h/_expected/umd.js000066400000000000000000000007261415504077600242100ustar00rootroot00000000000000(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-2.61.1/test/form/samples/side-effect-h/main.js000066400000000000000000000001621415504077600224010ustar00rootroot00000000000000function foo ( ok ) { if ( !ok ) { throw new Error( 'this will be ignored' ); } } foo(); export default 42; rollup-2.61.1/test/form/samples/side-effect-i/000077500000000000000000000000001415504077600211215ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-i/_config.js000066400000000000000000000001661415504077600230660ustar00rootroot00000000000000module.exports = { description: 'includes top-level throw statements', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/side-effect-i/_expected/000077500000000000000000000000001415504077600230615ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-i/_expected/amd.js000066400000000000000000000002121415504077600241530ustar00rootroot00000000000000define((function () { 'use strict'; if ( !ok ) { throw new Error( 'this will be included' ); } var main = 42; return main; })); rollup-2.61.1/test/form/samples/side-effect-i/_expected/cjs.js000066400000000000000000000001631415504077600241760ustar00rootroot00000000000000'use strict'; if ( !ok ) { throw new Error( 'this will be included' ); } var main = 42; module.exports = main; rollup-2.61.1/test/form/samples/side-effect-i/_expected/es.js000066400000000000000000000001511415504077600240230ustar00rootroot00000000000000if ( !ok ) { throw new Error( 'this will be included' ); } var main = 42; export { main as default }; rollup-2.61.1/test/form/samples/side-effect-i/_expected/iife.js000066400000000000000000000002241415504077600243310ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; if ( !ok ) { throw new Error( 'this will be included' ); } var main = 42; return main; })(); rollup-2.61.1/test/form/samples/side-effect-i/_expected/system.js000066400000000000000000000003451415504077600247450ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { if ( !ok ) { throw new Error( 'this will be included' ); } var main = exports('default', 42); }) }; })); rollup-2.61.1/test/form/samples/side-effect-i/_expected/umd.js000066400000000000000000000006611415504077600242070ustar00rootroot00000000000000(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-2.61.1/test/form/samples/side-effect-i/main.js000066400000000000000000000001201415504077600223740ustar00rootroot00000000000000if ( !ok ) { throw new Error( 'this will be included' ); } export default 42; rollup-2.61.1/test/form/samples/side-effect-j/000077500000000000000000000000001415504077600211225ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-j/_config.js000066400000000000000000000002101415504077600230550ustar00rootroot00000000000000module.exports = { description: 'includes late function declarations with side-effects', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/side-effect-j/_expected/000077500000000000000000000000001415504077600230625ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-j/_expected/amd.js000066400000000000000000000002131415504077600241550ustar00rootroot00000000000000define((function () { 'use strict'; var augment; augment = y => y.augmented = true; function x () {} augment( x ); return x; })); rollup-2.61.1/test/form/samples/side-effect-j/_expected/cjs.js000066400000000000000000000001641415504077600242000ustar00rootroot00000000000000'use strict'; var augment; augment = y => y.augmented = true; function x () {} augment( x ); module.exports = x; rollup-2.61.1/test/form/samples/side-effect-j/_expected/es.js000066400000000000000000000001521415504077600240250ustar00rootroot00000000000000var augment; augment = y => y.augmented = true; function x () {} augment( x ); export { x as default }; rollup-2.61.1/test/form/samples/side-effect-j/_expected/iife.js000066400000000000000000000002251415504077600243330ustar00rootroot00000000000000var myBundle = (function () { 'use strict'; var augment; augment = y => y.augmented = true; function x () {} augment( x ); return x; })(); rollup-2.61.1/test/form/samples/side-effect-j/_expected/system.js000066400000000000000000000003601415504077600247430ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { exports('default', x); var augment; augment = y => y.augmented = true; function x () {} augment( x ); }) }; })); rollup-2.61.1/test/form/samples/side-effect-j/_expected/umd.js000066400000000000000000000006621415504077600242110ustar00rootroot00000000000000(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-2.61.1/test/form/samples/side-effect-j/foo.js000066400000000000000000000001051415504077600222370ustar00rootroot00000000000000var augment; augment = y => y.augmented = true; export { augment }; rollup-2.61.1/test/form/samples/side-effect-j/main.js000066400000000000000000000001231415504077600224000ustar00rootroot00000000000000import { augment } from './foo.js'; export default function x () {} augment( x ); rollup-2.61.1/test/form/samples/side-effect-k/000077500000000000000000000000001415504077600211235ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-k/_config.js000066400000000000000000000001771415504077600230720ustar00rootroot00000000000000module.exports = { description: 'use of arguments is treated as a side-effect', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/side-effect-k/_expected/000077500000000000000000000000001415504077600230635ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-k/_expected/amd.js000066400000000000000000000006451415504077600241670ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/side-effect-k/_expected/cjs.js000066400000000000000000000006001415504077600241740ustar00rootroot00000000000000'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-2.61.1/test/form/samples/side-effect-k/_expected/es.js000066400000000000000000000005661415504077600240370ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/side-effect-k/_expected/iife.js000066400000000000000000000006571415504077600243450ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/side-effect-k/_expected/system.js000066400000000000000000000010461415504077600247460ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/side-effect-k/_expected/umd.js000066400000000000000000000013141415504077600242050ustar00rootroot00000000000000(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-2.61.1/test/form/samples/side-effect-k/foo.js000066400000000000000000000004711415504077600222460ustar00rootroot00000000000000export 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-2.61.1/test/form/samples/side-effect-k/main.js000066400000000000000000000001351415504077600224040ustar00rootroot00000000000000import { augment } from './foo.js'; export default function x () {} augment( x.prototype ); rollup-2.61.1/test/form/samples/side-effect-l/000077500000000000000000000000001415504077600211245ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-l/_config.js000066400000000000000000000002051415504077600230630ustar00rootroot00000000000000module.exports = { description: 'discards function with no side-effects in imported module', expectedWarnings: ['EMPTY_BUNDLE'] }; rollup-2.61.1/test/form/samples/side-effect-l/_expected/000077500000000000000000000000001415504077600230645ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-l/_expected/amd.js000066400000000000000000000000541415504077600241620ustar00rootroot00000000000000define((function () { 'use strict'; })); rollup-2.61.1/test/form/samples/side-effect-l/_expected/cjs.js000066400000000000000000000000171415504077600241770ustar00rootroot00000000000000'use strict'; rollup-2.61.1/test/form/samples/side-effect-l/_expected/es.js000066400000000000000000000000011415504077600240200ustar00rootroot00000000000000 rollup-2.61.1/test/form/samples/side-effect-l/_expected/iife.js000066400000000000000000000000471415504077600243370ustar00rootroot00000000000000(function () { 'use strict'; })(); rollup-2.61.1/test/form/samples/side-effect-l/_expected/system.js000066400000000000000000000001471415504077600247500ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { }) }; })); rollup-2.61.1/test/form/samples/side-effect-l/_expected/umd.js000066400000000000000000000002121415504077600242020ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; })); rollup-2.61.1/test/form/samples/side-effect-l/foo.js000066400000000000000000000001171415504077600222440ustar00rootroot00000000000000export default function foo () { bar(); function bar () {} } var x = foo(); rollup-2.61.1/test/form/samples/side-effect-l/main.js000066400000000000000000000000231415504077600224010ustar00rootroot00000000000000import './foo.js'; rollup-2.61.1/test/form/samples/side-effect-m/000077500000000000000000000000001415504077600211255ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-m/_config.js000066400000000000000000000002021415504077600230610ustar00rootroot00000000000000module.exports = { description: 'detects side-effects in circular function calls', expectedWarnings: ['CIRCULAR_DEPENDENCY'] }; rollup-2.61.1/test/form/samples/side-effect-m/_expected.js000066400000000000000000000003721415504077600234250ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/side-effect-m/even.js000066400000000000000000000003121415504077600224140ustar00rootroot00000000000000import { 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-2.61.1/test/form/samples/side-effect-m/main.js000066400000000000000000000001371415504077600224100ustar00rootroot00000000000000import { counter, even } from './even.js'; console.log( even( 5 ) ); console.log( counter ); rollup-2.61.1/test/form/samples/side-effect-m/odd.js000066400000000000000000000001431415504077600222270ustar00rootroot00000000000000import { even } from './even.js'; export function odd ( n ) { return n !== 0 && even( n - 1 ); } rollup-2.61.1/test/form/samples/side-effect-n/000077500000000000000000000000001415504077600211265ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-n/_config.js000066400000000000000000000001271415504077600230700ustar00rootroot00000000000000module.exports = { description: 'detects side-effects in complex call expressions' }; rollup-2.61.1/test/form/samples/side-effect-n/_expected/000077500000000000000000000000001415504077600230665ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-n/_expected/amd.js000066400000000000000000000002611415504077600241640ustar00rootroot00000000000000define((function () { 'use strict'; function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } ( Math.random() < 0.5 ? foo : bar )(); })); rollup-2.61.1/test/form/samples/side-effect-n/_expected/cjs.js000066400000000000000000000002161415504077600242020ustar00rootroot00000000000000'use strict'; function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } ( Math.random() < 0.5 ? foo : bar )(); rollup-2.61.1/test/form/samples/side-effect-n/_expected/es.js000066400000000000000000000001771415504077600240400ustar00rootroot00000000000000function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } ( Math.random() < 0.5 ? foo : bar )(); rollup-2.61.1/test/form/samples/side-effect-n/_expected/iife.js000066400000000000000000000002541415504077600243410ustar00rootroot00000000000000(function () { 'use strict'; function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } ( Math.random() < 0.5 ? foo : bar )(); })(); rollup-2.61.1/test/form/samples/side-effect-n/_expected/system.js000066400000000000000000000003721415504077600247520ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } ( Math.random() < 0.5 ? foo : bar )(); }) }; })); rollup-2.61.1/test/form/samples/side-effect-n/_expected/umd.js000066400000000000000000000004171415504077600242130ustar00rootroot00000000000000(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-2.61.1/test/form/samples/side-effect-n/main.js000066400000000000000000000001771415504077600224150ustar00rootroot00000000000000function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } ( Math.random() < 0.5 ? foo : bar )(); rollup-2.61.1/test/form/samples/side-effect-o/000077500000000000000000000000001415504077600211275ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-o/_config.js000066400000000000000000000001271415504077600230710ustar00rootroot00000000000000module.exports = { description: 'detects side-effects in complex call expressions' }; rollup-2.61.1/test/form/samples/side-effect-o/_expected/000077500000000000000000000000001415504077600230675ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-o/_expected/amd.js000066400000000000000000000003221415504077600241630ustar00rootroot00000000000000define((function () { 'use strict'; function fn () { return Math.random() < 0.5 ? foo : bar; } function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } fn()(); })); rollup-2.61.1/test/form/samples/side-effect-o/_expected/cjs.js000066400000000000000000000002541415504077600242050ustar00rootroot00000000000000'use strict'; function fn () { return Math.random() < 0.5 ? foo : bar; } function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } fn()(); rollup-2.61.1/test/form/samples/side-effect-o/_expected/es.js000066400000000000000000000002351415504077600240340ustar00rootroot00000000000000function fn () { return Math.random() < 0.5 ? foo : bar; } function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } fn()(); rollup-2.61.1/test/form/samples/side-effect-o/_expected/iife.js000066400000000000000000000003151415504077600243400ustar00rootroot00000000000000(function () { 'use strict'; function fn () { return Math.random() < 0.5 ? foo : bar; } function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } fn()(); })(); rollup-2.61.1/test/form/samples/side-effect-o/_expected/system.js000066400000000000000000000004411415504077600247500ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/side-effect-o/_expected/umd.js000066400000000000000000000004601415504077600242120ustar00rootroot00000000000000(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-2.61.1/test/form/samples/side-effect-o/main.js000066400000000000000000000002351415504077600224110ustar00rootroot00000000000000function fn () { return Math.random() < 0.5 ? foo : bar; } function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } fn()(); rollup-2.61.1/test/form/samples/side-effect-p/000077500000000000000000000000001415504077600211305ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-p/_config.js000066400000000000000000000001021415504077600230630ustar00rootroot00000000000000module.exports = { description: 'detects mutation of globals' }; rollup-2.61.1/test/form/samples/side-effect-p/_expected/000077500000000000000000000000001415504077600230705ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-p/_expected/amd.js000066400000000000000000000001631415504077600241670ustar00rootroot00000000000000define((function () { 'use strict'; const hs = document.documentElement.style; { hs.color = "#222"; } })); rollup-2.61.1/test/form/samples/side-effect-p/_expected/cjs.js000066400000000000000000000001231415504077600242010ustar00rootroot00000000000000'use strict'; const hs = document.documentElement.style; { hs.color = "#222"; } rollup-2.61.1/test/form/samples/side-effect-p/_expected/es.js000066400000000000000000000001041415504077600240300ustar00rootroot00000000000000const hs = document.documentElement.style; { hs.color = "#222"; } rollup-2.61.1/test/form/samples/side-effect-p/_expected/iife.js000066400000000000000000000001561415504077600243440ustar00rootroot00000000000000(function () { 'use strict'; const hs = document.documentElement.style; { hs.color = "#222"; } })(); rollup-2.61.1/test/form/samples/side-effect-p/_expected/system.js000066400000000000000000000002661415504077600247560ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { const hs = document.documentElement.style; { hs.color = "#222"; } }) }; })); rollup-2.61.1/test/form/samples/side-effect-p/_expected/umd.js000066400000000000000000000003211415504077600242070ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; const hs = document.documentElement.style; { hs.color = "#222"; } })); rollup-2.61.1/test/form/samples/side-effect-p/bool.js000066400000000000000000000000251415504077600224160ustar00rootroot00000000000000export default true; rollup-2.61.1/test/form/samples/side-effect-p/main.js000066400000000000000000000001531415504077600224110ustar00rootroot00000000000000import bool from './bool'; const hs = document.documentElement.style; if ( bool ) { hs.color = "#222" } rollup-2.61.1/test/form/samples/side-effect-q/000077500000000000000000000000001415504077600211315ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-q/_config.js000066400000000000000000000002161415504077600230720ustar00rootroot00000000000000module.exports = { description: 'discards effects in conditional expressions with known test values', expectedWarnings: ['EMPTY_BUNDLE'] }; rollup-2.61.1/test/form/samples/side-effect-q/_expected.js000066400000000000000000000000011415504077600234160ustar00rootroot00000000000000 rollup-2.61.1/test/form/samples/side-effect-q/main.js000066400000000000000000000001441415504077600224120ustar00rootroot00000000000000var x = true ? foo() : bar(); function foo() { return 'should be removed, because x is unused'; } rollup-2.61.1/test/form/samples/side-effect-r/000077500000000000000000000000001415504077600211325ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-r/_config.js000066400000000000000000000002471415504077600230770ustar00rootroot00000000000000module.exports = { description: 'discards unused function expression assigned to a variable that calls itself and a global', expectedWarnings: ['EMPTY_BUNDLE'] }; rollup-2.61.1/test/form/samples/side-effect-r/_expected.js000066400000000000000000000000011415504077600234170ustar00rootroot00000000000000 rollup-2.61.1/test/form/samples/side-effect-r/main.js000066400000000000000000000001201415504077600224050ustar00rootroot00000000000000var foo = function foo() { if ( whatever ) { foo(); } else { bar(); } }; rollup-2.61.1/test/form/samples/side-effect-s/000077500000000000000000000000001415504077600211335ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-s/_config.js000066400000000000000000000002571415504077600231010ustar00rootroot00000000000000module.exports = { description: 'discards unused function expression assigned to a variable that calls itself and has side effects', expectedWarnings: ['EMPTY_BUNDLE'] }; rollup-2.61.1/test/form/samples/side-effect-s/_expected/000077500000000000000000000000001415504077600230735ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-s/_expected/amd.js000066400000000000000000000000541415504077600241710ustar00rootroot00000000000000define((function () { 'use strict'; })); rollup-2.61.1/test/form/samples/side-effect-s/_expected/cjs.js000066400000000000000000000000171415504077600242060ustar00rootroot00000000000000'use strict'; rollup-2.61.1/test/form/samples/side-effect-s/_expected/es.js000066400000000000000000000000011415504077600240270ustar00rootroot00000000000000 rollup-2.61.1/test/form/samples/side-effect-s/_expected/iife.js000066400000000000000000000000471415504077600243460ustar00rootroot00000000000000(function () { 'use strict'; })(); rollup-2.61.1/test/form/samples/side-effect-s/_expected/system.js000066400000000000000000000001471415504077600247570ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { }) }; })); rollup-2.61.1/test/form/samples/side-effect-s/_expected/umd.js000066400000000000000000000002121415504077600242110ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; })); rollup-2.61.1/test/form/samples/side-effect-s/main.js000066400000000000000000000001421415504077600224120ustar00rootroot00000000000000var foo = function foo(param) { if ( whatever ) { foo(param); } else { param.foo = 1; } }; rollup-2.61.1/test/form/samples/side-effect-t/000077500000000000000000000000001415504077600211345ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-t/_config.js000066400000000000000000000001631415504077600230760ustar00rootroot00000000000000module.exports = { description: 'throw statement is a side effect', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/side-effect-t/_expected/000077500000000000000000000000001415504077600230745ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-t/_expected/amd.js000066400000000000000000000001641415504077600241740ustar00rootroot00000000000000define((function () { 'use strict'; function foo () { throw new Error( 'throw side effect' ); } foo(); })); rollup-2.61.1/test/form/samples/side-effect-t/_expected/cjs.js000066400000000000000000000001241415504077600242060ustar00rootroot00000000000000'use strict'; function foo () { throw new Error( 'throw side effect' ); } foo(); rollup-2.61.1/test/form/samples/side-effect-t/_expected/es.js000066400000000000000000000001051415504077600240350ustar00rootroot00000000000000function foo () { throw new Error( 'throw side effect' ); } foo(); rollup-2.61.1/test/form/samples/side-effect-t/_expected/iife.js000066400000000000000000000001571415504077600243510ustar00rootroot00000000000000(function () { 'use strict'; function foo () { throw new Error( 'throw side effect' ); } foo(); })(); rollup-2.61.1/test/form/samples/side-effect-t/_expected/system.js000066400000000000000000000003031415504077600247520ustar00rootroot00000000000000System.register('myBundle', [], (function () { 'use strict'; return { execute: (function () { function foo () { throw new Error( 'throw side effect' ); } foo(); }) }; })); rollup-2.61.1/test/form/samples/side-effect-t/_expected/umd.js000066400000000000000000000003221415504077600242140ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function foo () { throw new Error( 'throw side effect' ); } foo(); })); rollup-2.61.1/test/form/samples/side-effect-t/main.js000066400000000000000000000001051415504077600224120ustar00rootroot00000000000000function foo () { throw new Error( 'throw side effect' ); } foo(); rollup-2.61.1/test/form/samples/side-effect-with-plusplus-expression/000077500000000000000000000000001415504077600257265ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect-with-plusplus-expression/_config.js000066400000000000000000000002411415504077600276650ustar00rootroot00000000000000module.exports = { description: 'correctly drop side-effect free statements in presence of update expression (#1564)', expectedWarnings: ['EMPTY_BUNDLE'] }; rollup-2.61.1/test/form/samples/side-effect-with-plusplus-expression/_expected.js000066400000000000000000000000011415504077600302130ustar00rootroot00000000000000 rollup-2.61.1/test/form/samples/side-effect-with-plusplus-expression/lib.js000066400000000000000000000002171415504077600270320ustar00rootroot00000000000000function first () { for ( let i = -1; ; ++i ) {} second; } function second () {} function third () { ++i; forth; } function forth () {} rollup-2.61.1/test/form/samples/side-effect-with-plusplus-expression/main.js000066400000000000000000000000171415504077600272060ustar00rootroot00000000000000import './lib' rollup-2.61.1/test/form/samples/side-effect/000077500000000000000000000000001415504077600206735ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect/_config.js000066400000000000000000000001331415504077600226320ustar00rootroot00000000000000module.exports = { description: 'side-effects to non-globals are not blindly included' }; rollup-2.61.1/test/form/samples/side-effect/_expected/000077500000000000000000000000001415504077600226335ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effect/_expected/amd.js000066400000000000000000000001251415504077600237300ustar00rootroot00000000000000define((function () { 'use strict'; var foo = 42; assert.equal( foo, 42 ); })); rollup-2.61.1/test/form/samples/side-effect/_expected/cjs.js000066400000000000000000000000671415504077600237530ustar00rootroot00000000000000'use strict'; var foo = 42; assert.equal( foo, 42 ); rollup-2.61.1/test/form/samples/side-effect/_expected/es.js000066400000000000000000000000501415504077600235730ustar00rootroot00000000000000var foo = 42; assert.equal( foo, 42 ); rollup-2.61.1/test/form/samples/side-effect/_expected/iife.js000066400000000000000000000001201415504077600240760ustar00rootroot00000000000000(function () { 'use strict'; var foo = 42; assert.equal( foo, 42 ); })(); rollup-2.61.1/test/form/samples/side-effect/_expected/system.js000066400000000000000000000002241415504077600245130ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var foo = 42; assert.equal( foo, 42 ); }) }; })); rollup-2.61.1/test/form/samples/side-effect/_expected/umd.js000066400000000000000000000002631415504077600237570ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var foo = 42; assert.equal( foo, 42 ); })); rollup-2.61.1/test/form/samples/side-effect/foo.js000066400000000000000000000003241415504077600220130ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/side-effect/main.js000066400000000000000000000000661415504077600221570ustar00rootroot00000000000000import { foo } from './foo'; assert.equal( foo, 42 ); rollup-2.61.1/test/form/samples/side-effects-await/000077500000000000000000000000001415504077600221615ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-await/_config.js000066400000000000000000000001761415504077600241270ustar00rootroot00000000000000module.exports = { description: 'await statements should never be dropped if a function has other side-effects (#1584)' }; rollup-2.61.1/test/form/samples/side-effects-await/_expected.js000066400000000000000000000002671415504077600244640ustar00rootroot00000000000000async function hasEffects1 () { await globalThis.unknown; console.log( 'effect' ); } hasEffects1(); async function hasEffects2 () { await globalThis.unknown(); } hasEffects2(); rollup-2.61.1/test/form/samples/side-effects-await/main.js000066400000000000000000000002701415504077600234420ustar00rootroot00000000000000async function hasEffects1 () { await globalThis.unknown; console.log( 'effect' ); } hasEffects1(); async function hasEffects2 () { await globalThis.unknown(); } hasEffects2(); rollup-2.61.1/test/form/samples/side-effects-break-statements/000077500000000000000000000000001415504077600243255ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-break-statements/_config.js000066400000000000000000000002621415504077600262670ustar00rootroot00000000000000module.exports = { description: 'break statements should always by included but not always cause their parents to have effects', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/side-effects-break-statements/_expected/000077500000000000000000000000001415504077600262655ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-break-statements/_expected/amd.js000066400000000000000000000006111415504077600273620ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/side-effects-break-statements/_expected/cjs.js000066400000000000000000000005311415504077600274010ustar00rootroot00000000000000'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-2.61.1/test/form/samples/side-effects-break-statements/_expected/es.js000066400000000000000000000005121415504077600272300ustar00rootroot00000000000000for ( 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-2.61.1/test/form/samples/side-effects-break-statements/_expected/iife.js000066400000000000000000000006041415504077600275370ustar00rootroot00000000000000(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-2.61.1/test/form/samples/side-effects-break-statements/_expected/system.js000066400000000000000000000007701415504077600301530ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/side-effects-break-statements/_expected/umd.js000066400000000000000000000007471415504077600274200ustar00rootroot00000000000000(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-2.61.1/test/form/samples/side-effects-break-statements/main.js000066400000000000000000000007421415504077600256120ustar00rootroot00000000000000for ( 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-2.61.1/test/form/samples/side-effects-call-arguments/000077500000000000000000000000001415504077600237725ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-call-arguments/_config.js000066400000000000000000000001301415504077600257260ustar00rootroot00000000000000module.exports = { description: 'side-effects in call arguments should be included' }; rollup-2.61.1/test/form/samples/side-effects-call-arguments/_expected.js000066400000000000000000000001431415504077600262660ustar00rootroot00000000000000function foo () {} foo( globalThis.unknown() ); var baz = 2; foo( baz++ ); assert.equal(baz, 3); rollup-2.61.1/test/form/samples/side-effects-call-arguments/main.js000066400000000000000000000002721415504077600252550ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/side-effects-class-getters-setters/000077500000000000000000000000001415504077600253235ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-class-getters-setters/_config.js000066400000000000000000000001351415504077600272640ustar00rootroot00000000000000module.exports = { description: 'treat getters and setters on classes as function calls' }; rollup-2.61.1/test/form/samples/side-effects-class-getters-setters/_expected.js000066400000000000000000000012441415504077600276220ustar00rootroot00000000000000class 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; 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-2.61.1/test/form/samples/side-effects-class-getters-setters/main.js000066400000000000000000000026011415504077600266040ustar00rootroot00000000000000class 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-2.61.1/test/form/samples/side-effects-computed-pattern-keys/000077500000000000000000000000001415504077600253205ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-computed-pattern-keys/_config.js000066400000000000000000000001471415504077600272640ustar00rootroot00000000000000module.exports = { description: 'side-effects in with computed pattern keys should not be ignored' }; rollup-2.61.1/test/form/samples/side-effects-computed-pattern-keys/_expected.js000066400000000000000000000000571415504077600276200ustar00rootroot00000000000000const { [globalThis.unknown()]: isKept } = {}; rollup-2.61.1/test/form/samples/side-effects-computed-pattern-keys/main.js000066400000000000000000000001531415504077600266010ustar00rootroot00000000000000const { [globalThis.unknown]: isRemoved } = { foo: 'bar' }; const { [globalThis.unknown()]: isKept } = {}; rollup-2.61.1/test/form/samples/side-effects-delete/000077500000000000000000000000001415504077600223165ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-delete/_config.js000066400000000000000000000002061415504077600242560ustar00rootroot00000000000000module.exports = { description: 'delete is only a side-effect for included variables', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/side-effects-delete/_expected/000077500000000000000000000000001415504077600242565ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-delete/_expected/amd.js000066400000000000000000000003301415504077600253510ustar00rootroot00000000000000define(['exports'], (function (exports) { 'use strict'; var x = {foo: 'bar'}; delete x.foo; delete globalThis.unknown.foo; exports.x = x; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/side-effects-delete/_expected/cjs.js000066400000000000000000000002431415504077600253720ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var x = {foo: 'bar'}; delete x.foo; delete globalThis.unknown.foo; exports.x = x; rollup-2.61.1/test/form/samples/side-effects-delete/_expected/es.js000066400000000000000000000001231415504077600252170ustar00rootroot00000000000000var x = {foo: 'bar'}; delete x.foo; delete globalThis.unknown.foo; export { x }; rollup-2.61.1/test/form/samples/side-effects-delete/_expected/iife.js000066400000000000000000000003511415504077600255270ustar00rootroot00000000000000var myBundle = (function (exports) { 'use strict'; var x = {foo: 'bar'}; delete x.foo; delete globalThis.unknown.foo; exports.x = x; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/side-effects-delete/_expected/system.js000066400000000000000000000003241415504077600261370ustar00rootroot00000000000000System.register('myBundle', [], (function (exports) { 'use strict'; return { execute: (function () { var x = exports('x', {foo: 'bar'}); delete x.foo; delete globalThis.unknown.foo; }) }; })); rollup-2.61.1/test/form/samples/side-effects-delete/_expected/umd.js000066400000000000000000000007671415504077600254130ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/side-effects-delete/main.js000066400000000000000000000001661415504077600236030ustar00rootroot00000000000000var x = {foo: 'bar'}; delete x.foo; var y = {foo: 'bar'}; delete y.foo; delete globalThis.unknown.foo; export {x}; rollup-2.61.1/test/form/samples/side-effects-es6-class-declarations/000077500000000000000000000000001415504077600253225ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-es6-class-declarations/_config.js000066400000000000000000000001271415504077600272640ustar00rootroot00000000000000module.exports = { description: 'determine side effects in ES6 class declarations' }; rollup-2.61.1/test/form/samples/side-effects-es6-class-declarations/_expected.js000066400000000000000000000011021415504077600276120ustar00rootroot00000000000000class 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-2.61.1/test/form/samples/side-effects-es6-class-declarations/main.js000066400000000000000000000017741415504077600266150ustar00rootroot00000000000000class 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-2.61.1/test/form/samples/side-effects-es6-class-expressions/000077500000000000000000000000001415504077600252345ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-es6-class-expressions/_config.js000066400000000000000000000001261415504077600271750ustar00rootroot00000000000000module.exports = { description: 'determine side effects in ES6 class expressions' }; rollup-2.61.1/test/form/samples/side-effects-es6-class-expressions/_expected.js000066400000000000000000000011351415504077600275320ustar00rootroot00000000000000class 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-2.61.1/test/form/samples/side-effects-es6-class-expressions/main.js000066400000000000000000000020511415504077600265140ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/side-effects-es6-super-classes/000077500000000000000000000000001415504077600243405ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-es6-super-classes/_config.js000066400000000000000000000001221415504077600262750ustar00rootroot00000000000000module.exports = { description: 'determine side effects in ES6 super classes' }; rollup-2.61.1/test/form/samples/side-effects-es6-super-classes/_expected.js000066400000000000000000000012761415504077600266440ustar00rootroot00000000000000class 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-2.61.1/test/form/samples/side-effects-es6-super-classes/main.js000066400000000000000000000017151415504077600256260ustar00rootroot00000000000000class 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-2.61.1/test/form/samples/side-effects-expressions-as-statements/000077500000000000000000000000001415504077600262245ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-expressions-as-statements/_config.js000066400000000000000000000001661415504077600301710ustar00rootroot00000000000000module.exports = { description: 'in order to keep certain getter calls, do not remove some expression statements' }; rollup-2.61.1/test/form/samples/side-effects-expressions-as-statements/_expected.js000066400000000000000000000004101415504077600305150ustar00rootroot00000000000000// 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-2.61.1/test/form/samples/side-effects-expressions-as-statements/main.js000066400000000000000000000004671415504077600275150ustar00rootroot00000000000000// 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-2.61.1/test/form/samples/side-effects-generators/000077500000000000000000000000001415504077600232255ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-generators/_config.js000066400000000000000000000001321415504077600251630ustar00rootroot00000000000000module.exports = { description: 'Properly detect side-effects in generator functions' }; rollup-2.61.1/test/form/samples/side-effects-generators/_expected.js000066400000000000000000000007221415504077600255240ustar00rootroot00000000000000function* 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-2.61.1/test/form/samples/side-effects-generators/main.js000066400000000000000000000011561415504077600245120ustar00rootroot00000000000000function* 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-2.61.1/test/form/samples/side-effects-getters-and-setters/000077500000000000000000000000001415504077600247605ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-getters-and-setters/_config.js000066400000000000000000000001221415504077600267150ustar00rootroot00000000000000module.exports = { description: 'treat getters and setters as function calls' }; rollup-2.61.1/test/form/samples/side-effects-getters-and-setters/_expected.js000066400000000000000000000007261415504077600272630ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/side-effects-getters-and-setters/main.js000066400000000000000000000014311415504077600262410ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/side-effects-in-template-literals/000077500000000000000000000000001415504077600251105ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-in-template-literals/_config.js000066400000000000000000000002341415504077600270510ustar00rootroot00000000000000module.exports = { description: 'detects side-effects in template literals and tagged template expressions', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/side-effects-in-template-literals/_expected.js000066400000000000000000000005641415504077600274130ustar00rootroot00000000000000let 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-2.61.1/test/form/samples/side-effects-in-template-literals/main.js000066400000000000000000000010031415504077600263640ustar00rootroot00000000000000let 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-2.61.1/test/form/samples/side-effects-internal-modules/000077500000000000000000000000001415504077600243365ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-internal-modules/_config.js000066400000000000000000000010351415504077600262770ustar00rootroot00000000000000const assert = require('assert'); const VIRTUAL_ID = '\0virtual'; module.exports = { 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-2.61.1/test/form/samples/side-effects-internal-modules/_expected.js000066400000000000000000000000551415504077600266340ustar00rootroot00000000000000console.log('effect'); console.log('main'); rollup-2.61.1/test/form/samples/side-effects-internal-modules/main.js000066400000000000000000000000471415504077600256210ustar00rootroot00000000000000import 'virtual'; console.log('main'); rollup-2.61.1/test/form/samples/side-effects-logical-expressions/000077500000000000000000000000001415504077600250465ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-logical-expressions/_config.js000066400000000000000000000001511415504077600270050ustar00rootroot00000000000000module.exports = { description: 'only evaluate the second part of a logical expression if necessary' }; rollup-2.61.1/test/form/samples/side-effects-logical-expressions/_expected/000077500000000000000000000000001415504077600270065ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-logical-expressions/_expected/amd.js000066400000000000000000000011241415504077600301030ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/side-effects-logical-expressions/_expected/cjs.js000066400000000000000000000010351415504077600301220ustar00rootroot00000000000000'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-2.61.1/test/form/samples/side-effects-logical-expressions/_expected/es.js000066400000000000000000000010161415504077600277510ustar00rootroot00000000000000// 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-2.61.1/test/form/samples/side-effects-logical-expressions/_expected/iife.js000066400000000000000000000011171415504077600302600ustar00rootroot00000000000000(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-2.61.1/test/form/samples/side-effects-logical-expressions/_expected/system.js000066400000000000000000000013051415504077600306670ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/side-effects-logical-expressions/_expected/umd.js000066400000000000000000000012621415504077600301320ustar00rootroot00000000000000(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-2.61.1/test/form/samples/side-effects-logical-expressions/main.js000066400000000000000000000021501415504077600263260ustar00rootroot00000000000000false || {}; 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-2.61.1/test/form/samples/side-effects-object-literal-calls/000077500000000000000000000000001415504077600250505ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-object-literal-calls/_config.js000066400000000000000000000001311415504077600270050ustar00rootroot00000000000000module.exports = { description: 'detects side-effects when mutating object literals' }; rollup-2.61.1/test/form/samples/side-effects-object-literal-calls/_expected.js000066400000000000000000000010211415504077600273400ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/side-effects-object-literal-calls/main.js000066400000000000000000000011741415504077600263350ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/side-effects-object-literal-mutation-misc/000077500000000000000000000000001415504077600265435ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-object-literal-mutation-misc/_config.js000066400000000000000000000002371415504077600305070ustar00rootroot00000000000000module.exports = { description: 'detects side-effects when setting and/or calling properties on object literals', options: { output: { name: 'bundle' } } }; rollup-2.61.1/test/form/samples/side-effects-object-literal-mutation-misc/_expected.js000066400000000000000000000012601415504077600310400ustar00rootroot00000000000000((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-2.61.1/test/form/samples/side-effects-object-literal-mutation-misc/main.js000066400000000000000000000015541415504077600300320ustar00rootroot00000000000000let 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-2.61.1/test/form/samples/side-effects-object-literal-mutation/000077500000000000000000000000001415504077600256125ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-object-literal-mutation/_config.js000066400000000000000000000001311415504077600275470ustar00rootroot00000000000000module.exports = { description: 'detects side-effects when mutating object literals' }; rollup-2.61.1/test/form/samples/side-effects-object-literal-mutation/_expected.js000066400000000000000000000007651415504077600301200ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/side-effects-object-literal-mutation/main.js000066400000000000000000000013171415504077600270760ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/side-effects-parameter-defaults/000077500000000000000000000000001415504077600246415ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-parameter-defaults/_config.js000066400000000000000000000001361415504077600266030ustar00rootroot00000000000000module.exports = { description: 'side-effects in paramter defaults should not be ignored' }; rollup-2.61.1/test/form/samples/side-effects-parameter-defaults/_expected/000077500000000000000000000000001415504077600266015ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-parameter-defaults/_expected/amd.js000066400000000000000000000006311415504077600277000ustar00rootroot00000000000000define((function () { 'use strict'; const effect = () => console.log( 'effect' ); function aDecl ( x = effect() ) {} aDecl(); const aExp = function ( x = effect() ) {}; aExp(); const aArr = ( x = effect() ) => {}; aArr(); function bDecl ( x = effect ) { x(); } bDecl(); const bExp = function ( x = effect ) { x(); }; bExp(); const bArr = ( x = effect ) => { x(); }; bArr(); })); rollup-2.61.1/test/form/samples/side-effects-parameter-defaults/_expected/cjs.js000066400000000000000000000005521415504077600277200ustar00rootroot00000000000000'use strict'; const effect = () => console.log( 'effect' ); function aDecl ( x = effect() ) {} aDecl(); const aExp = function ( x = effect() ) {}; aExp(); const aArr = ( x = effect() ) => {}; aArr(); function bDecl ( x = effect ) { x(); } bDecl(); const bExp = function ( x = effect ) { x(); }; bExp(); const bArr = ( x = effect ) => { x(); }; bArr(); rollup-2.61.1/test/form/samples/side-effects-parameter-defaults/_expected/es.js000066400000000000000000000005331415504077600275470ustar00rootroot00000000000000const effect = () => console.log( 'effect' ); function aDecl ( x = effect() ) {} aDecl(); const aExp = function ( x = effect() ) {}; aExp(); const aArr = ( x = effect() ) => {}; aArr(); function bDecl ( x = effect ) { x(); } bDecl(); const bExp = function ( x = effect ) { x(); }; bExp(); const bArr = ( x = effect ) => { x(); }; bArr(); rollup-2.61.1/test/form/samples/side-effects-parameter-defaults/_expected/iife.js000066400000000000000000000006241415504077600300550ustar00rootroot00000000000000(function () { 'use strict'; const effect = () => console.log( 'effect' ); function aDecl ( x = effect() ) {} aDecl(); const aExp = function ( x = effect() ) {}; aExp(); const aArr = ( x = effect() ) => {}; aArr(); function bDecl ( x = effect ) { x(); } bDecl(); const bExp = function ( x = effect ) { x(); }; bExp(); const bArr = ( x = effect ) => { x(); }; bArr(); })(); rollup-2.61.1/test/form/samples/side-effects-parameter-defaults/_expected/system.js000066400000000000000000000007721415504077600304710ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { const effect = () => console.log( 'effect' ); function aDecl ( x = effect() ) {} aDecl(); const aExp = function ( x = effect() ) {}; aExp(); const aArr = ( x = effect() ) => {}; aArr(); function bDecl ( x = effect ) { x(); } bDecl(); const bExp = function ( x = effect ) { x(); }; bExp(); const bArr = ( x = effect ) => { x(); }; bArr(); }) }; })); rollup-2.61.1/test/form/samples/side-effects-parameter-defaults/_expected/umd.js000066400000000000000000000007671415504077600277360ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; const effect = () => console.log( 'effect' ); function aDecl ( x = effect() ) {} aDecl(); const aExp = function ( x = effect() ) {}; aExp(); const aArr = ( x = effect() ) => {}; aArr(); function bDecl ( x = effect ) { x(); } bDecl(); const bExp = function ( x = effect ) { x(); }; bExp(); const bArr = ( x = effect ) => { x(); }; bArr(); })); rollup-2.61.1/test/form/samples/side-effects-parameter-defaults/main.js000066400000000000000000000005331415504077600261240ustar00rootroot00000000000000const effect = () => console.log( 'effect' ); function aDecl ( x = effect() ) {} aDecl(); const aExp = function ( x = effect() ) {}; aExp(); const aArr = ( x = effect() ) => {}; aArr(); function bDecl ( x = effect ) { x(); } bDecl(); const bExp = function ( x = effect ) { x(); }; bExp(); const bArr = ( x = effect ) => { x(); }; bArr(); rollup-2.61.1/test/form/samples/side-effects-pattern-assignment/000077500000000000000000000000001415504077600246775ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-pattern-assignment/_config.js000066400000000000000000000001561415504077600266430ustar00rootroot00000000000000module.exports = { description: 'side-effects when mutating destructured variables should not be ignored' }; rollup-2.61.1/test/form/samples/side-effects-pattern-assignment/_expected.js000066400000000000000000000005771415504077600272060ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/side-effects-pattern-assignment/main.js000066400000000000000000000012511415504077600261600ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/side-effects-pattern-defaults/000077500000000000000000000000001415504077600243365ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-pattern-defaults/_config.js000066400000000000000000000001351415504077600262770ustar00rootroot00000000000000module.exports = { description: 'side-effects in pattern defaults should not be ignored' }; rollup-2.61.1/test/form/samples/side-effects-pattern-defaults/_expected/000077500000000000000000000000001415504077600262765ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-pattern-defaults/_expected/amd.js000066400000000000000000000011021415504077600273670ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/side-effects-pattern-defaults/_expected/cjs.js000066400000000000000000000010131415504077600274060ustar00rootroot00000000000000'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-2.61.1/test/form/samples/side-effects-pattern-defaults/_expected/es.js000066400000000000000000000007741415504077600272530ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/side-effects-pattern-defaults/_expected/iife.js000066400000000000000000000010751415504077600275530ustar00rootroot00000000000000(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-2.61.1/test/form/samples/side-effects-pattern-defaults/_expected/system.js000066400000000000000000000012631415504077600301620ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/side-effects-pattern-defaults/_expected/umd.js000066400000000000000000000012401415504077600274160ustar00rootroot00000000000000(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-2.61.1/test/form/samples/side-effects-pattern-defaults/main.js000066400000000000000000000011441415504077600256200ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/side-effects-prototype-assignments/000077500000000000000000000000001415504077600254525ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-prototype-assignments/_config.js000066400000000000000000000001361415504077600274140ustar00rootroot00000000000000module.exports = { description: 'include side-effects with re-assigned prototypes (#953)' }; rollup-2.61.1/test/form/samples/side-effects-prototype-assignments/_expected/000077500000000000000000000000001415504077600274125ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-prototype-assignments/_expected/amd.js000066400000000000000000000004601415504077600305110ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/side-effects-prototype-assignments/_expected/cjs.js000066400000000000000000000004161415504077600305300ustar00rootroot00000000000000'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-2.61.1/test/form/samples/side-effects-prototype-assignments/_expected/es.js000066400000000000000000000003771415504077600303660ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/side-effects-prototype-assignments/_expected/iife.js000066400000000000000000000004531415504077600306660ustar00rootroot00000000000000(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-2.61.1/test/form/samples/side-effects-prototype-assignments/_expected/system.js000066400000000000000000000005671415504077600313040ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/side-effects-prototype-assignments/_expected/umd.js000066400000000000000000000006161415504077600305400ustar00rootroot00000000000000(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-2.61.1/test/form/samples/side-effects-prototype-assignments/main.js000066400000000000000000000006641415504077600267420ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/side-effects-reassignment/000077500000000000000000000000001415504077600235535ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-reassignment/_config.js000066400000000000000000000002101415504077600255060ustar00rootroot00000000000000module.exports = { description: 'when mutating/calling a reassigned variable, all assignments should be checked for side-effects' }; rollup-2.61.1/test/form/samples/side-effects-reassignment/_expected/000077500000000000000000000000001415504077600255135ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-reassignment/_expected/amd.js000066400000000000000000000002151415504077600266100ustar00rootroot00000000000000define((function () { 'use strict'; var effect = function() { console.log('effect'); }; var alsoEffect = effect; alsoEffect(); })); rollup-2.61.1/test/form/samples/side-effects-reassignment/_expected/cjs.js000066400000000000000000000001541415504077600266300ustar00rootroot00000000000000'use strict'; var effect = function() { console.log('effect'); }; var alsoEffect = effect; alsoEffect(); rollup-2.61.1/test/form/samples/side-effects-reassignment/_expected/es.js000066400000000000000000000001351415504077600264570ustar00rootroot00000000000000var effect = function() { console.log('effect'); }; var alsoEffect = effect; alsoEffect(); rollup-2.61.1/test/form/samples/side-effects-reassignment/_expected/iife.js000066400000000000000000000002101415504077600267560ustar00rootroot00000000000000(function () { 'use strict'; var effect = function() { console.log('effect'); }; var alsoEffect = effect; alsoEffect(); })(); rollup-2.61.1/test/form/samples/side-effects-reassignment/_expected/system.js000066400000000000000000000003221415504077600273720ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var effect = function() { console.log('effect'); }; var alsoEffect = effect; alsoEffect(); }) }; })); rollup-2.61.1/test/form/samples/side-effects-reassignment/_expected/umd.js000066400000000000000000000003531415504077600266370ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var effect = function() { console.log('effect'); }; var alsoEffect = effect; alsoEffect(); })); rollup-2.61.1/test/form/samples/side-effects-reassignment/main.js000066400000000000000000000005051415504077600250350ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/side-effects-return-statements/000077500000000000000000000000001415504077600245605ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-return-statements/_config.js000066400000000000000000000002531415504077600265220ustar00rootroot00000000000000module.exports = { description: 'return statements do not have side-effects but should be kept in certain cases (#1585)', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/side-effects-return-statements/_expected/000077500000000000000000000000001415504077600265205ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-return-statements/_expected/amd.js000066400000000000000000000002261415504077600276170ustar00rootroot00000000000000define((function () { 'use strict'; function isUsed ( x ) { if ( x ) { return 2; } return 1; } assert.equal( isUsed( true ), 2 ); })); rollup-2.61.1/test/form/samples/side-effects-return-statements/_expected/cjs.js000066400000000000000000000001631415504077600276350ustar00rootroot00000000000000'use strict'; function isUsed ( x ) { if ( x ) { return 2; } return 1; } assert.equal( isUsed( true ), 2 ); rollup-2.61.1/test/form/samples/side-effects-return-statements/_expected/es.js000066400000000000000000000001441415504077600274640ustar00rootroot00000000000000function isUsed ( x ) { if ( x ) { return 2; } return 1; } assert.equal( isUsed( true ), 2 ); rollup-2.61.1/test/form/samples/side-effects-return-statements/_expected/iife.js000066400000000000000000000002211415504077600277650ustar00rootroot00000000000000(function () { 'use strict'; function isUsed ( x ) { if ( x ) { return 2; } return 1; } assert.equal( isUsed( true ), 2 ); })(); rollup-2.61.1/test/form/samples/side-effects-return-statements/_expected/system.js000066400000000000000000000003531415504077600304030ustar00rootroot00000000000000System.register('myBundle', [], (function () { 'use strict'; return { execute: (function () { function isUsed ( x ) { if ( x ) { return 2; } return 1; } assert.equal( isUsed( true ), 2 ); }) }; })); rollup-2.61.1/test/form/samples/side-effects-return-statements/_expected/umd.js000066400000000000000000000003641415504077600276460ustar00rootroot00000000000000(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-2.61.1/test/form/samples/side-effects-return-statements/main.js000066400000000000000000000002741415504077600260450ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/side-effects-static-methods/000077500000000000000000000000001415504077600240045ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-static-methods/_config.js000066400000000000000000000001331415504077600257430ustar00rootroot00000000000000module.exports = { description: 'allow calls to pure static methods to be tree-shaken' }; rollup-2.61.1/test/form/samples/side-effects-static-methods/_expected.js000066400000000000000000000010041415504077600262750ustar00rootroot00000000000000class 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-2.61.1/test/form/samples/side-effects-static-methods/main.js000066400000000000000000000010661415504077600252710ustar00rootroot00000000000000class 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-2.61.1/test/form/samples/side-effects-switch-statements/000077500000000000000000000000001415504077600245425ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/side-effects-switch-statements/_config.js000066400000000000000000000001301415504077600264760ustar00rootroot00000000000000module.exports = { description: 'switch statements should be correctly tree-shaken' }; rollup-2.61.1/test/form/samples/side-effects-switch-statements/_expected.js000066400000000000000000000013501415504077600270370ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/side-effects-switch-statements/main.js000066400000000000000000000020061415504077600260220ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/simplified-initializer/000077500000000000000000000000001415504077600231635ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/simplified-initializer/_config.js000066400000000000000000000001711415504077600251240ustar00rootroot00000000000000module.exports = { description: 'handles simplified variable initializers', options: { output: { name: 'bundle' } } }; rollup-2.61.1/test/form/samples/simplified-initializer/_expected/000077500000000000000000000000001415504077600251235ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/simplified-initializer/_expected/amd.js000066400000000000000000000003601415504077600262210ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/simplified-initializer/_expected/cjs.js000066400000000000000000000002711415504077600262400ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const a = window.config ? 1 : 2; const b = 1 ; const c = 2; exports.a = a; exports.b = b; exports.c = c; rollup-2.61.1/test/form/samples/simplified-initializer/_expected/es.js000066400000000000000000000001211415504077600260620ustar00rootroot00000000000000const a = window.config ? 1 : 2; const b = 1 ; const c = 2; export { a, b, c }; rollup-2.61.1/test/form/samples/simplified-initializer/_expected/iife.js000066400000000000000000000003771415504077600264040ustar00rootroot00000000000000var 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; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/simplified-initializer/_expected/system.js000066400000000000000000000003461415504077600270100ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/simplified-initializer/_expected/umd.js000066400000000000000000000010151415504077600262430ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/simplified-initializer/main.js000066400000000000000000000001441415504077600244440ustar00rootroot00000000000000export const a = window.config ? 1 : 2 export const b = true ? 1 : 2 export const c = false ? 1 : 2 rollup-2.61.1/test/form/samples/simplify-expression-annotations/000077500000000000000000000000001415504077600251015ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/simplify-expression-annotations/_config.js000066400000000000000000000001351415504077600270420ustar00rootroot00000000000000module.exports = { description: 'keeps correct annotations when simplifying expressinos' }; rollup-2.61.1/test/form/samples/simplify-expression-annotations/_expected.js000066400000000000000000000002351415504077600273770ustar00rootroot00000000000000console.log(/*@__PURE__*/ noEffect() ); console.log(/*@__PURE__*/ noEffect()); console.log(/*@__PURE__*/ noEffect()); console.log(/*@__PURE__*/ noEffect()); rollup-2.61.1/test/form/samples/simplify-expression-annotations/main.js000066400000000000000000000003121415504077600263570ustar00rootroot00000000000000console.log(true ? /*@__PURE__*/ noEffect() : null); console.log(false ? null : /*@__PURE__*/ noEffect()); console.log(true && /*@__PURE__*/ noEffect()); console.log(false || /*@__PURE__*/ noEffect()); rollup-2.61.1/test/form/samples/simplify-return-expression/000077500000000000000000000000001415504077600240635ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/simplify-return-expression/_config.js000066400000000000000000000001231415504077600260210ustar00rootroot00000000000000module.exports = { description: 'Simplifies conditionals in return expression' }; rollup-2.61.1/test/form/samples/simplify-return-expression/_expected.js000066400000000000000000000010541415504077600263610ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/simplify-return-expression/main.js000066400000000000000000000015531415504077600253510ustar00rootroot00000000000000export 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-2.61.1/test/form/samples/skips-dead-branches-b/000077500000000000000000000000001415504077600225435ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/skips-dead-branches-b/_config.js000066400000000000000000000000761415504077600245100ustar00rootroot00000000000000module.exports = { description: 'skips a dead branch (b)' }; rollup-2.61.1/test/form/samples/skips-dead-branches-b/_expected/000077500000000000000000000000001415504077600245035ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/skips-dead-branches-b/_expected/amd.js000066400000000000000000000001661415504077600256050ustar00rootroot00000000000000define((function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })); rollup-2.61.1/test/form/samples/skips-dead-branches-b/_expected/cjs.js000066400000000000000000000001261415504077600256170ustar00rootroot00000000000000'use strict'; function bar () { console.log( 'this should be included' ); } bar(); rollup-2.61.1/test/form/samples/skips-dead-branches-b/_expected/es.js000066400000000000000000000001071415504077600254460ustar00rootroot00000000000000function bar () { console.log( 'this should be included' ); } bar(); rollup-2.61.1/test/form/samples/skips-dead-branches-b/_expected/iife.js000066400000000000000000000001611415504077600257530ustar00rootroot00000000000000(function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })(); rollup-2.61.1/test/form/samples/skips-dead-branches-b/_expected/system.js000066400000000000000000000002711415504077600263650ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function bar () { console.log( 'this should be included' ); } bar(); }) }; })); rollup-2.61.1/test/form/samples/skips-dead-branches-b/_expected/umd.js000066400000000000000000000003241415504077600256250ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })); rollup-2.61.1/test/form/samples/skips-dead-branches-b/main.js000066400000000000000000000002671415504077600240320ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/skips-dead-branches-c/000077500000000000000000000000001415504077600225445ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/skips-dead-branches-c/_config.js000066400000000000000000000000761415504077600245110ustar00rootroot00000000000000module.exports = { description: 'skips a dead branch (c)' }; rollup-2.61.1/test/form/samples/skips-dead-branches-c/_expected/000077500000000000000000000000001415504077600245045ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/skips-dead-branches-c/_expected/amd.js000066400000000000000000000001651415504077600256050ustar00rootroot00000000000000define((function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })); rollup-2.61.1/test/form/samples/skips-dead-branches-c/_expected/cjs.js000066400000000000000000000001251415504077600256170ustar00rootroot00000000000000'use strict'; function bar () { console.log( 'this should be included' ); } bar(); rollup-2.61.1/test/form/samples/skips-dead-branches-c/_expected/es.js000066400000000000000000000001061415504077600254460ustar00rootroot00000000000000function bar () { console.log( 'this should be included' ); } bar(); rollup-2.61.1/test/form/samples/skips-dead-branches-c/_expected/iife.js000066400000000000000000000001601415504077600257530ustar00rootroot00000000000000(function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })(); rollup-2.61.1/test/form/samples/skips-dead-branches-c/_expected/system.js000066400000000000000000000002701415504077600263650ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function bar () { console.log( 'this should be included' ); } bar(); }) }; })); rollup-2.61.1/test/form/samples/skips-dead-branches-c/_expected/umd.js000066400000000000000000000003231415504077600256250ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })); rollup-2.61.1/test/form/samples/skips-dead-branches-c/main.js000066400000000000000000000002631415504077600240270ustar00rootroot00000000000000var obj = {}; obj.foo = function () { console.log( 'this should be excluded' ); } function bar () { console.log( 'this should be included' ); } if ( !true ) obj.foo(); bar(); rollup-2.61.1/test/form/samples/skips-dead-branches-d/000077500000000000000000000000001415504077600225455ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/skips-dead-branches-d/_config.js000066400000000000000000000000761415504077600245120ustar00rootroot00000000000000module.exports = { description: 'skips a dead branch (d)' }; rollup-2.61.1/test/form/samples/skips-dead-branches-d/_expected/000077500000000000000000000000001415504077600245055ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/skips-dead-branches-d/_expected/amd.js000066400000000000000000000001651415504077600256060ustar00rootroot00000000000000define((function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })); rollup-2.61.1/test/form/samples/skips-dead-branches-d/_expected/cjs.js000066400000000000000000000001251415504077600256200ustar00rootroot00000000000000'use strict'; function bar () { console.log( 'this should be included' ); } bar(); rollup-2.61.1/test/form/samples/skips-dead-branches-d/_expected/es.js000066400000000000000000000001061415504077600254470ustar00rootroot00000000000000function bar () { console.log( 'this should be included' ); } bar(); rollup-2.61.1/test/form/samples/skips-dead-branches-d/_expected/iife.js000066400000000000000000000001601415504077600257540ustar00rootroot00000000000000(function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })(); rollup-2.61.1/test/form/samples/skips-dead-branches-d/_expected/system.js000066400000000000000000000002701415504077600263660ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function bar () { console.log( 'this should be included' ); } bar(); }) }; })); rollup-2.61.1/test/form/samples/skips-dead-branches-d/_expected/umd.js000066400000000000000000000003231415504077600256260ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })); rollup-2.61.1/test/form/samples/skips-dead-branches-d/main.js000066400000000000000000000003141415504077600240250ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/skips-dead-branches-e/000077500000000000000000000000001415504077600225465ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/skips-dead-branches-e/_config.js000066400000000000000000000000761415504077600245130ustar00rootroot00000000000000module.exports = { description: 'skips a dead branch (e)' }; rollup-2.61.1/test/form/samples/skips-dead-branches-e/_expected/000077500000000000000000000000001415504077600245065ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/skips-dead-branches-e/_expected/amd.js000066400000000000000000000001651415504077600256070ustar00rootroot00000000000000define((function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })); rollup-2.61.1/test/form/samples/skips-dead-branches-e/_expected/cjs.js000066400000000000000000000001251415504077600256210ustar00rootroot00000000000000'use strict'; function bar () { console.log( 'this should be included' ); } bar(); rollup-2.61.1/test/form/samples/skips-dead-branches-e/_expected/es.js000066400000000000000000000001061415504077600254500ustar00rootroot00000000000000function bar () { console.log( 'this should be included' ); } bar(); rollup-2.61.1/test/form/samples/skips-dead-branches-e/_expected/iife.js000066400000000000000000000001601415504077600257550ustar00rootroot00000000000000(function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })(); rollup-2.61.1/test/form/samples/skips-dead-branches-e/_expected/system.js000066400000000000000000000002701415504077600263670ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function bar () { console.log( 'this should be included' ); } bar(); }) }; })); rollup-2.61.1/test/form/samples/skips-dead-branches-e/_expected/umd.js000066400000000000000000000003231415504077600256270ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })); rollup-2.61.1/test/form/samples/skips-dead-branches-e/main.js000066400000000000000000000003131415504077600240250ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/skips-dead-branches-f/000077500000000000000000000000001415504077600225475ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/skips-dead-branches-f/_config.js000066400000000000000000000000761415504077600245140ustar00rootroot00000000000000module.exports = { description: 'skips a dead branch (f)' }; rollup-2.61.1/test/form/samples/skips-dead-branches-f/_expected/000077500000000000000000000000001415504077600245075ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/skips-dead-branches-f/_expected/amd.js000066400000000000000000000001651415504077600256100ustar00rootroot00000000000000define((function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })); rollup-2.61.1/test/form/samples/skips-dead-branches-f/_expected/cjs.js000066400000000000000000000001251415504077600256220ustar00rootroot00000000000000'use strict'; function bar () { console.log( 'this should be included' ); } bar(); rollup-2.61.1/test/form/samples/skips-dead-branches-f/_expected/es.js000066400000000000000000000001061415504077600254510ustar00rootroot00000000000000function bar () { console.log( 'this should be included' ); } bar(); rollup-2.61.1/test/form/samples/skips-dead-branches-f/_expected/iife.js000066400000000000000000000001601415504077600257560ustar00rootroot00000000000000(function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })(); rollup-2.61.1/test/form/samples/skips-dead-branches-f/_expected/system.js000066400000000000000000000002701415504077600263700ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function bar () { console.log( 'this should be included' ); } bar(); }) }; })); rollup-2.61.1/test/form/samples/skips-dead-branches-f/_expected/umd.js000066400000000000000000000003231415504077600256300ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function bar () { console.log( 'this should be included' ); } bar(); })); rollup-2.61.1/test/form/samples/skips-dead-branches-f/main.js000066400000000000000000000002701415504077600240300ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/skips-dead-branches-g/000077500000000000000000000000001415504077600225505ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/skips-dead-branches-g/_config.js000066400000000000000000000001251415504077600245100ustar00rootroot00000000000000module.exports = { description: 'skips a dead conditional expression branch (g)' }; rollup-2.61.1/test/form/samples/skips-dead-branches-g/_expected/000077500000000000000000000000001415504077600245105ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/skips-dead-branches-g/_expected/amd.js000066400000000000000000000001651415504077600256110ustar00rootroot00000000000000define((function () { 'use strict'; var a = 0; var b = 1; var x = a ; var y = b; console.log( x + y ); })); rollup-2.61.1/test/form/samples/skips-dead-branches-g/_expected/cjs.js000066400000000000000000000001241415504077600256220ustar00rootroot00000000000000'use strict'; var a = 0; var b = 1; var x = a ; var y = b; console.log( x + y ); rollup-2.61.1/test/form/samples/skips-dead-branches-g/_expected/es.js000066400000000000000000000001051415504077600254510ustar00rootroot00000000000000var a = 0; var b = 1; var x = a ; var y = b; console.log( x + y ); rollup-2.61.1/test/form/samples/skips-dead-branches-g/_expected/iife.js000066400000000000000000000001601415504077600257570ustar00rootroot00000000000000(function () { 'use strict'; var a = 0; var b = 1; var x = a ; var y = b; console.log( x + y ); })(); rollup-2.61.1/test/form/samples/skips-dead-branches-g/_expected/system.js000066400000000000000000000002721415504077600263730ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var a = 0; var b = 1; var x = a ; var y = b; console.log( x + y ); }) }; })); rollup-2.61.1/test/form/samples/skips-dead-branches-g/_expected/umd.js000066400000000000000000000003231415504077600256310ustar00rootroot00000000000000(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-2.61.1/test/form/samples/skips-dead-branches-g/main.js000066400000000000000000000001461415504077600240330ustar00rootroot00000000000000var a = 0; var b = 1; var c = 2; var x = true ? a : b; var y = false ? c : b; console.log( x + y ); rollup-2.61.1/test/form/samples/skips-dead-branches-h/000077500000000000000000000000001415504077600225515ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/skips-dead-branches-h/_config.js000066400000000000000000000000761415504077600245160ustar00rootroot00000000000000module.exports = { description: 'skips a dead branch (h)' }; rollup-2.61.1/test/form/samples/skips-dead-branches-h/_expected/000077500000000000000000000000001415504077600245115ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/skips-dead-branches-h/_expected/amd.js000066400000000000000000000001361415504077600256100ustar00rootroot00000000000000define((function () { 'use strict'; function baz() { console.log("baz"); } baz(); })); rollup-2.61.1/test/form/samples/skips-dead-branches-h/_expected/cjs.js000066400000000000000000000000761415504077600256310ustar00rootroot00000000000000'use strict'; function baz() { console.log("baz"); } baz(); rollup-2.61.1/test/form/samples/skips-dead-branches-h/_expected/es.js000066400000000000000000000000571415504077600254600ustar00rootroot00000000000000function baz() { console.log("baz"); } baz(); rollup-2.61.1/test/form/samples/skips-dead-branches-h/_expected/iife.js000066400000000000000000000001311415504077600257560ustar00rootroot00000000000000(function () { 'use strict'; function baz() { console.log("baz"); } baz(); })(); rollup-2.61.1/test/form/samples/skips-dead-branches-h/_expected/system.js000066400000000000000000000002411415504077600263700ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function baz() { console.log("baz"); } baz(); }) }; })); rollup-2.61.1/test/form/samples/skips-dead-branches-h/_expected/umd.js000066400000000000000000000002741415504077600256370ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function baz() { console.log("baz"); } baz(); })); rollup-2.61.1/test/form/samples/skips-dead-branches-h/main.js000066400000000000000000000002111415504077600240250ustar00rootroot00000000000000function bar(umm) { umm = hmm(); console.log("bar"); } function hmm() { return true; } function baz() { console.log("baz"); } baz(); rollup-2.61.1/test/form/samples/skips-dead-branches-i/000077500000000000000000000000001415504077600225525ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/skips-dead-branches-i/_config.js000066400000000000000000000000761415504077600245170ustar00rootroot00000000000000module.exports = { description: 'skips a dead branch (i)' }; rollup-2.61.1/test/form/samples/skips-dead-branches-i/_expected/000077500000000000000000000000001415504077600245125ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/skips-dead-branches-i/_expected/amd.js000066400000000000000000000001361415504077600256110ustar00rootroot00000000000000define((function () { 'use strict'; function baz() { console.log("baz"); } baz(); })); rollup-2.61.1/test/form/samples/skips-dead-branches-i/_expected/cjs.js000066400000000000000000000000761415504077600256320ustar00rootroot00000000000000'use strict'; function baz() { console.log("baz"); } baz(); rollup-2.61.1/test/form/samples/skips-dead-branches-i/_expected/es.js000066400000000000000000000000571415504077600254610ustar00rootroot00000000000000function baz() { console.log("baz"); } baz(); rollup-2.61.1/test/form/samples/skips-dead-branches-i/_expected/iife.js000066400000000000000000000001311415504077600257570ustar00rootroot00000000000000(function () { 'use strict'; function baz() { console.log("baz"); } baz(); })(); rollup-2.61.1/test/form/samples/skips-dead-branches-i/_expected/system.js000066400000000000000000000002411415504077600263710ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function baz() { console.log("baz"); } baz(); }) }; })); rollup-2.61.1/test/form/samples/skips-dead-branches-i/_expected/umd.js000066400000000000000000000002741415504077600256400ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function baz() { console.log("baz"); } baz(); })); rollup-2.61.1/test/form/samples/skips-dead-branches-i/main.js000066400000000000000000000002141415504077600240310ustar00rootroot00000000000000function bar() { var t; t = hmm(); console.log("bar"); } function hmm() { return true; } function baz() { console.log("baz"); } baz(); rollup-2.61.1/test/form/samples/skips-dead-branches-j/000077500000000000000000000000001415504077600225535ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/skips-dead-branches-j/_config.js000066400000000000000000000000761415504077600245200ustar00rootroot00000000000000module.exports = { description: 'skips a dead branch (j)' }; rollup-2.61.1/test/form/samples/skips-dead-branches-j/_expected/000077500000000000000000000000001415504077600245135ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/skips-dead-branches-j/_expected/amd.js000066400000000000000000000001121415504077600256040ustar00rootroot00000000000000define((function () { 'use strict'; { console.log( 'true' ); } })); rollup-2.61.1/test/form/samples/skips-dead-branches-j/_expected/cjs.js000066400000000000000000000000531415504077600256260ustar00rootroot00000000000000'use strict'; { console.log( 'true' ); } rollup-2.61.1/test/form/samples/skips-dead-branches-j/_expected/es.js000066400000000000000000000000341415504077600254550ustar00rootroot00000000000000{ console.log( 'true' ); } rollup-2.61.1/test/form/samples/skips-dead-branches-j/_expected/iife.js000066400000000000000000000001051415504077600257610ustar00rootroot00000000000000(function () { 'use strict'; { console.log( 'true' ); } })(); rollup-2.61.1/test/form/samples/skips-dead-branches-j/_expected/system.js000066400000000000000000000002131415504077600263710ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { { console.log( 'true' ); } }) }; })); rollup-2.61.1/test/form/samples/skips-dead-branches-j/_expected/umd.js000066400000000000000000000002501415504077600256330ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; { console.log( 'true' ); } })); rollup-2.61.1/test/form/samples/skips-dead-branches-j/main.js000066400000000000000000000001221415504077600240300ustar00rootroot00000000000000if ( true && true ) { console.log( 'true' ); } else { console.log( 'false' ); } rollup-2.61.1/test/form/samples/skips-dead-branches/000077500000000000000000000000001415504077600223245ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/skips-dead-branches/_config.js000066400000000000000000000000721415504077600242650ustar00rootroot00000000000000module.exports = { description: 'skips a dead branch' }; rollup-2.61.1/test/form/samples/skips-dead-branches/_expected.js000066400000000000000000000001071415504077600246200ustar00rootroot00000000000000function bar () { console.log( 'this should be included' ); } bar(); rollup-2.61.1/test/form/samples/skips-dead-branches/main.js000066400000000000000000000002701415504077600236050ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/slash-in-function-parameters/000077500000000000000000000000001415504077600242175ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/slash-in-function-parameters/_config.js000066400000000000000000000001571415504077600261640ustar00rootroot00000000000000module.exports = { description: 'handles slashes in function parameters and correctly inserts missing ids' }; rollup-2.61.1/test/form/samples/slash-in-function-parameters/_expected/000077500000000000000000000000001415504077600261575ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/slash-in-function-parameters/_expected/amd.js000066400000000000000000000002171415504077600272560ustar00rootroot00000000000000define((function () { 'use strict'; class someClass {} function someFunction (text = '/') {} console.log(someClass, someFunction); })); rollup-2.61.1/test/form/samples/slash-in-function-parameters/_expected/cjs.js000066400000000000000000000001601415504077600272710ustar00rootroot00000000000000'use strict'; class someClass {} function someFunction (text = '/') {} console.log(someClass, someFunction); rollup-2.61.1/test/form/samples/slash-in-function-parameters/_expected/es.js000066400000000000000000000001411415504077600271200ustar00rootroot00000000000000class someClass {} function someFunction (text = '/') {} console.log(someClass, someFunction); rollup-2.61.1/test/form/samples/slash-in-function-parameters/_expected/iife.js000066400000000000000000000002121415504077600274240ustar00rootroot00000000000000(function () { 'use strict'; class someClass {} function someFunction (text = '/') {} console.log(someClass, someFunction); })(); rollup-2.61.1/test/form/samples/slash-in-function-parameters/_expected/system.js000066400000000000000000000003201415504077600300340ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { class someClass {} function someFunction (text = '/') {} console.log(someClass, someFunction); }) }; })); rollup-2.61.1/test/form/samples/slash-in-function-parameters/_expected/umd.js000066400000000000000000000003551415504077600273050ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; class someClass {} function someFunction (text = '/') {} console.log(someClass, someFunction); })); rollup-2.61.1/test/form/samples/slash-in-function-parameters/class.js000066400000000000000000000000661415504077600256640ustar00rootroot00000000000000export default class {} function* doesNotMatter() {} rollup-2.61.1/test/form/samples/slash-in-function-parameters/function.js000066400000000000000000000001061415504077600263770ustar00rootroot00000000000000export default function (text = '/') {} function* doesNotMatter() {} rollup-2.61.1/test/form/samples/slash-in-function-parameters/main.js000066400000000000000000000001621415504077600255000ustar00rootroot00000000000000import someClass from './class.js'; import someFunction from './function'; console.log(someClass, someFunction); rollup-2.61.1/test/form/samples/sourcemaps-excludesources/000077500000000000000000000000001415504077600237315ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/sourcemaps-excludesources/_config.js000066400000000000000000000003021415504077600256660ustar00rootroot00000000000000module.exports = { description: 'correct sourcemaps are written (excluding sourceContent)', skipIfWindows: true, options: { output: { sourcemap: true, sourcemapExcludeSources: true } } }; rollup-2.61.1/test/form/samples/sourcemaps-excludesources/_expected/000077500000000000000000000000001415504077600256715ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/sourcemaps-excludesources/_expected/amd.js000066400000000000000000000003741415504077600267740ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/sourcemaps-excludesources/_expected/amd.js.map000066400000000000000000000005551415504077600275510ustar00rootroot00000000000000{"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-2.61.1/test/form/samples/sourcemaps-excludesources/_expected/cjs.js000066400000000000000000000003271415504077600270100ustar00rootroot00000000000000'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-2.61.1/test/form/samples/sourcemaps-excludesources/_expected/cjs.js.map000066400000000000000000000005511415504077600275630ustar00rootroot00000000000000{"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-2.61.1/test/form/samples/sourcemaps-excludesources/_expected/es.js000066400000000000000000000003071415504077600266360ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/sourcemaps-excludesources/_expected/es.js.map000066400000000000000000000005441415504077600274150ustar00rootroot00000000000000{"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-2.61.1/test/form/samples/sourcemaps-excludesources/_expected/iife.js000066400000000000000000000003701415504077600271430ustar00rootroot00000000000000(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-2.61.1/test/form/samples/sourcemaps-excludesources/_expected/iife.js.map000066400000000000000000000005571415504077600277260ustar00rootroot00000000000000{"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-2.61.1/test/form/samples/sourcemaps-excludesources/_expected/system.js000066400000000000000000000005141415504077600275530ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/sourcemaps-excludesources/_expected/system.js.map000066400000000000000000000005651415504077600303350ustar00rootroot00000000000000{"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-2.61.1/test/form/samples/sourcemaps-excludesources/_expected/umd.js000066400000000000000000000005321415504077600270140ustar00rootroot00000000000000(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-2.61.1/test/form/samples/sourcemaps-excludesources/_expected/umd.js.map000066400000000000000000000005601415504077600275710ustar00rootroot00000000000000{"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-2.61.1/test/form/samples/sourcemaps-excludesources/bar.js000066400000000000000000000001101415504077600250230ustar00rootroot00000000000000export default function bar () { console.log( 'hello from bar.js' ); } rollup-2.61.1/test/form/samples/sourcemaps-excludesources/foo.js000066400000000000000000000001101415504077600250420ustar00rootroot00000000000000export default function foo () { console.log( 'hello from foo.js' ); } rollup-2.61.1/test/form/samples/sourcemaps-excludesources/main.js000066400000000000000000000001471415504077600252150ustar00rootroot00000000000000import foo from './foo'; import bar from './bar'; console.log( 'hello from main.js' ); foo(); bar(); rollup-2.61.1/test/form/samples/sourcemaps-external/000077500000000000000000000000001415504077600225165ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/sourcemaps-external/_config.js000066400000000000000000000002311415504077600244540ustar00rootroot00000000000000module.exports = { description: 'correct sourcemaps are written (separate file)', skipIfWindows: true, options: { output: { sourcemap: true } } }; rollup-2.61.1/test/form/samples/sourcemaps-external/_expected/000077500000000000000000000000001415504077600244565ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/sourcemaps-external/_expected/amd.js000066400000000000000000000003741415504077600255610ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/sourcemaps-external/_expected/amd.js.map000066400000000000000000000011711415504077600263310ustar00rootroot00000000000000{"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-2.61.1/test/form/samples/sourcemaps-external/_expected/cjs.js000066400000000000000000000003271415504077600255750ustar00rootroot00000000000000'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-2.61.1/test/form/samples/sourcemaps-external/_expected/cjs.js.map000066400000000000000000000011651415504077600263520ustar00rootroot00000000000000{"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-2.61.1/test/form/samples/sourcemaps-external/_expected/es.js000066400000000000000000000003071415504077600254230ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/sourcemaps-external/_expected/es.js.map000066400000000000000000000011601415504077600261750ustar00rootroot00000000000000{"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-2.61.1/test/form/samples/sourcemaps-external/_expected/iife.js000066400000000000000000000003701415504077600257300ustar00rootroot00000000000000(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-2.61.1/test/form/samples/sourcemaps-external/_expected/iife.js.map000066400000000000000000000011731415504077600265060ustar00rootroot00000000000000{"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-2.61.1/test/form/samples/sourcemaps-external/_expected/system.js000066400000000000000000000005141415504077600263400ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/sourcemaps-external/_expected/system.js.map000066400000000000000000000012011415504077600271060ustar00rootroot00000000000000{"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-2.61.1/test/form/samples/sourcemaps-external/_expected/umd.js000066400000000000000000000005321415504077600256010ustar00rootroot00000000000000(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-2.61.1/test/form/samples/sourcemaps-external/_expected/umd.js.map000066400000000000000000000011741415504077600263600ustar00rootroot00000000000000{"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-2.61.1/test/form/samples/sourcemaps-external/bar.js000066400000000000000000000001101415504077600236100ustar00rootroot00000000000000export default function bar () { console.log( 'hello from bar.js' ); } rollup-2.61.1/test/form/samples/sourcemaps-external/foo.js000066400000000000000000000001101415504077600236270ustar00rootroot00000000000000export default function foo () { console.log( 'hello from foo.js' ); } rollup-2.61.1/test/form/samples/sourcemaps-external/main.js000066400000000000000000000001471415504077600240020ustar00rootroot00000000000000import foo from './foo'; import bar from './bar'; console.log( 'hello from main.js' ); foo(); bar(); rollup-2.61.1/test/form/samples/sourcemaps-hidden/000077500000000000000000000000001415504077600221275ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/sourcemaps-hidden/_config.js000066400000000000000000000002551415504077600240730ustar00rootroot00000000000000module.exports = { description: 'correct sourcemaps are written (separate file) without comment', skipIfWindows: true, options: { output: { sourcemap: 'hidden' } } }; rollup-2.61.1/test/form/samples/sourcemaps-hidden/_expected/000077500000000000000000000000001415504077600240675ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/sourcemaps-hidden/_expected/amd.js000066400000000000000000000003341415504077600251660ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/sourcemaps-hidden/_expected/amd.js.map000066400000000000000000000011711415504077600257420ustar00rootroot00000000000000{"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-2.61.1/test/form/samples/sourcemaps-hidden/_expected/cjs.js000066400000000000000000000002671415504077600252110ustar00rootroot00000000000000'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-2.61.1/test/form/samples/sourcemaps-hidden/_expected/cjs.js.map000066400000000000000000000011651415504077600257630ustar00rootroot00000000000000{"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-2.61.1/test/form/samples/sourcemaps-hidden/_expected/es.js000066400000000000000000000002501415504077600250310ustar00rootroot00000000000000function foo () { console.log( 'hello from foo.js' ); } function bar () { console.log( 'hello from bar.js' ); } console.log( 'hello from main.js' ); foo(); bar(); rollup-2.61.1/test/form/samples/sourcemaps-hidden/_expected/es.js.map000066400000000000000000000011601415504077600256060ustar00rootroot00000000000000{"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-2.61.1/test/form/samples/sourcemaps-hidden/_expected/iife.js000066400000000000000000000003271415504077600253430ustar00rootroot00000000000000(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-2.61.1/test/form/samples/sourcemaps-hidden/_expected/iife.js.map000066400000000000000000000011731415504077600261170ustar00rootroot00000000000000{"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-2.61.1/test/form/samples/sourcemaps-hidden/_expected/system.js000066400000000000000000000004511415504077600257510ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/sourcemaps-hidden/_expected/system.js.map000066400000000000000000000012011415504077600265170ustar00rootroot00000000000000{"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-2.61.1/test/form/samples/sourcemaps-hidden/_expected/umd.js000066400000000000000000000004721415504077600252150ustar00rootroot00000000000000(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-2.61.1/test/form/samples/sourcemaps-hidden/_expected/umd.js.map000066400000000000000000000011741415504077600257710ustar00rootroot00000000000000{"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-2.61.1/test/form/samples/sourcemaps-hidden/bar.js000066400000000000000000000001101415504077600232210ustar00rootroot00000000000000export default function bar () { console.log( 'hello from bar.js' ); } rollup-2.61.1/test/form/samples/sourcemaps-hidden/foo.js000066400000000000000000000001101415504077600232400ustar00rootroot00000000000000export default function foo () { console.log( 'hello from foo.js' ); } rollup-2.61.1/test/form/samples/sourcemaps-hidden/main.js000066400000000000000000000001471415504077600234130ustar00rootroot00000000000000import foo from './foo'; import bar from './bar'; console.log( 'hello from main.js' ); foo(); bar(); rollup-2.61.1/test/form/samples/sourcemaps-inline/000077500000000000000000000000001415504077600221525ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/sourcemaps-inline/_config.js000066400000000000000000000002261415504077600241140ustar00rootroot00000000000000module.exports = { description: 'correct sourcemaps are written (inline)', skipIfWindows: true, options: { output: { sourcemap: 'inline' } } }; rollup-2.61.1/test/form/samples/sourcemaps-inline/_expected/000077500000000000000000000000001415504077600241125ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/sourcemaps-inline/_expected/amd.js000066400000000000000000000021511415504077600252100ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/sourcemaps-inline/_expected/cjs.js000066400000000000000000000021001415504077600252200ustar00rootroot00000000000000'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-2.61.1/test/form/samples/sourcemaps-inline/_expected/es.js000066400000000000000000000020511415504077600250550ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/sourcemaps-inline/_expected/iife.js000066400000000000000000000021501415504077600253620ustar00rootroot00000000000000(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-2.61.1/test/form/samples/sourcemaps-inline/_expected/system.js000066400000000000000000000023021415504077600257710ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/sourcemaps-inline/_expected/umd.js000066400000000000000000000023131415504077600252340ustar00rootroot00000000000000(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-2.61.1/test/form/samples/sourcemaps-inline/bar.js000066400000000000000000000001101415504077600232440ustar00rootroot00000000000000export default function bar () { console.log( 'hello from bar.js' ); } rollup-2.61.1/test/form/samples/sourcemaps-inline/foo.js000066400000000000000000000001101415504077600232630ustar00rootroot00000000000000export default function foo () { console.log( 'hello from foo.js' ); } rollup-2.61.1/test/form/samples/sourcemaps-inline/main.js000066400000000000000000000001471415504077600234360ustar00rootroot00000000000000import foo from './foo'; import bar from './bar'; console.log( 'hello from main.js' ); foo(); bar(); rollup-2.61.1/test/form/samples/spacing-after-function-with-semicolon/000077500000000000000000000000001415504077600260225ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/spacing-after-function-with-semicolon/_config.js000066400000000000000000000001051415504077600277600ustar00rootroot00000000000000module.exports = { description: 'handles superfluous semicolons' }; rollup-2.61.1/test/form/samples/spacing-after-function-with-semicolon/_expected/000077500000000000000000000000001415504077600277625ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/spacing-after-function-with-semicolon/_expected/amd.js000066400000000000000000000001441415504077600310600ustar00rootroot00000000000000define((function () { 'use strict'; function x () { return 'x' } assert.equal( x(), 'x' ); })); rollup-2.61.1/test/form/samples/spacing-after-function-with-semicolon/_expected/cjs.js000066400000000000000000000001061415504077600310740ustar00rootroot00000000000000'use strict'; function x () { return 'x' } assert.equal( x(), 'x' ); rollup-2.61.1/test/form/samples/spacing-after-function-with-semicolon/_expected/es.js000066400000000000000000000000671415504077600307320ustar00rootroot00000000000000function x () { return 'x' } assert.equal( x(), 'x' ); rollup-2.61.1/test/form/samples/spacing-after-function-with-semicolon/_expected/iife.js000066400000000000000000000001371415504077600312350ustar00rootroot00000000000000(function () { 'use strict'; function x () { return 'x' } assert.equal( x(), 'x' ); })(); rollup-2.61.1/test/form/samples/spacing-after-function-with-semicolon/_expected/system.js000066400000000000000000000002431415504077600316430ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function x () { return 'x' } assert.equal( x(), 'x' ); }) }; })); rollup-2.61.1/test/form/samples/spacing-after-function-with-semicolon/_expected/umd.js000066400000000000000000000003021415504077600311000ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function x () { return 'x' } assert.equal( x(), 'x' ); })); rollup-2.61.1/test/form/samples/spacing-after-function-with-semicolon/main.js000066400000000000000000000000711415504077600273020ustar00rootroot00000000000000function x () { return 'x' }; assert.equal( x(), 'x' ); rollup-2.61.1/test/form/samples/static-class-property-calls/000077500000000000000000000000001415504077600240655ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/static-class-property-calls/_config.js000066400000000000000000000001331415504077600260240ustar00rootroot00000000000000module.exports = { description: 'handles effects when calling static class properties' }; rollup-2.61.1/test/form/samples/static-class-property-calls/_expected.js000066400000000000000000000005561415504077600263710ustar00rootroot00000000000000class 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-2.61.1/test/form/samples/static-class-property-calls/main.js000066400000000000000000000006551415504077600253550ustar00rootroot00000000000000class 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-2.61.1/test/form/samples/static-method-deoptimization/000077500000000000000000000000001415504077600243175ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/static-method-deoptimization/_config.js000066400000000000000000000001421415504077600262560ustar00rootroot00000000000000module.exports = { description: 'avoids infinite recursions when deoptimizing "this" context' }; rollup-2.61.1/test/form/samples/static-method-deoptimization/_expected.js000066400000000000000000000002641415504077600266170ustar00rootroot00000000000000class Foo { static echo(message) { this.prototype.echo(message); } echo(message) { console.log(message); } } class Bar extends Foo {} global.baz = 'PASS'; Bar.echo(baz); rollup-2.61.1/test/form/samples/static-method-deoptimization/main.js000066400000000000000000000002641415504077600256030ustar00rootroot00000000000000class Foo { static echo(message) { this.prototype.echo(message); } echo(message) { console.log(message); } } class Bar extends Foo {} global.baz = 'PASS'; Bar.echo(baz); rollup-2.61.1/test/form/samples/strict-false/000077500000000000000000000000001415504077600211155ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/strict-false/_config.js000066400000000000000000000001701415504077600230550ustar00rootroot00000000000000module.exports = { description: 'use strict should not be present', options: { output: { strict: false } } }; rollup-2.61.1/test/form/samples/strict-false/_expected/000077500000000000000000000000001415504077600230555ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/strict-false/_expected/amd.js000066400000000000000000000004001415504077600241460ustar00rootroot00000000000000define((function () { const localVariable = 'local'; try { globalVariable = localVariable; } catch (error) { console.log('use strict; detected', error); Function("g", "globalVariable = g")(localVariable); } })); rollup-2.61.1/test/form/samples/strict-false/_expected/cjs.js000066400000000000000000000003071415504077600241720ustar00rootroot00000000000000const localVariable = 'local'; try { globalVariable = localVariable; } catch (error) { console.log('use strict; detected', error); Function("g", "globalVariable = g")(localVariable); } rollup-2.61.1/test/form/samples/strict-false/_expected/es.js000066400000000000000000000003071415504077600240220ustar00rootroot00000000000000const localVariable = 'local'; try { globalVariable = localVariable; } catch (error) { console.log('use strict; detected', error); Function("g", "globalVariable = g")(localVariable); } rollup-2.61.1/test/form/samples/strict-false/_expected/iife.js000066400000000000000000000003721415504077600243310ustar00rootroot00000000000000(function () { const localVariable = 'local'; try { globalVariable = localVariable; } catch (error) { console.log('use strict; detected', error); Function("g", "globalVariable = g")(localVariable); } })(); rollup-2.61.1/test/form/samples/strict-false/_expected/system.js000066400000000000000000000006111415504077600247350ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/strict-false/_expected/umd.js000066400000000000000000000005431415504077600242020ustar00rootroot00000000000000(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-2.61.1/test/form/samples/strict-false/main.js000066400000000000000000000003051415504077600223750ustar00rootroot00000000000000const localVariable = 'local' try { globalVariable = localVariable; } catch (error) { console.log('use strict; detected', error); Function("g", "globalVariable = g")(localVariable); }rollup-2.61.1/test/form/samples/string-indentation-b/000077500000000000000000000000001415504077600225545ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/string-indentation-b/_config.js000066400000000000000000000002151415504077600245140ustar00rootroot00000000000000module.exports = { description: 'handles multiple var declarations inited to strings (#166)', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/string-indentation-b/_expected/000077500000000000000000000000001415504077600245145ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/string-indentation-b/_expected/amd.js000066400000000000000000000002061415504077600256110ustar00rootroot00000000000000define((function () { 'use strict'; var a = 'a', b = 'b'; assert.equal( a, 'a' ); assert.equal( b, 'b' ); })); rollup-2.61.1/test/form/samples/string-indentation-b/_expected/cjs.js000066400000000000000000000001321415504077600256250ustar00rootroot00000000000000'use strict'; var a = 'a', b = 'b'; assert.equal( a, 'a' ); assert.equal( b, 'b' ); rollup-2.61.1/test/form/samples/string-indentation-b/_expected/es.js000066400000000000000000000001131415504077600254540ustar00rootroot00000000000000var a = 'a', b = 'b'; assert.equal( a, 'a' ); assert.equal( b, 'b' ); rollup-2.61.1/test/form/samples/string-indentation-b/_expected/iife.js000066400000000000000000000002041415504077600257620ustar00rootroot00000000000000(function () { 'use strict'; var a = 'a', b = 'b'; assert.equal( a, 'a' ); assert.equal( b, 'b' ); })(); rollup-2.61.1/test/form/samples/string-indentation-b/_expected/system.js000066400000000000000000000004021415504077600263720ustar00rootroot00000000000000System.register('myBundle', [], (function () { 'use strict'; return { execute: (function () { var a = 'a', b = 'b'; assert.equal( a, 'a' ); assert.equal( b, 'b' ); }) }; })); rollup-2.61.1/test/form/samples/string-indentation-b/_expected/umd.js000066400000000000000000000003521415504077600256370ustar00rootroot00000000000000(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-2.61.1/test/form/samples/string-indentation-b/main.js000066400000000000000000000001131415504077600240310ustar00rootroot00000000000000var a = 'a', b = 'b'; assert.equal( a, 'a' ); assert.equal( b, 'b' ); rollup-2.61.1/test/form/samples/string-indentation/000077500000000000000000000000001415504077600223355ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/string-indentation/_config.js000066400000000000000000000001251415504077600242750ustar00rootroot00000000000000module.exports = { description: 'indentation is preserved in multi-line strings' }; rollup-2.61.1/test/form/samples/string-indentation/_expected/000077500000000000000000000000001415504077600242755ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/string-indentation/_expected/amd.js000066400000000000000000000003571415504077600254010ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/string-indentation/_expected/cjs.js000066400000000000000000000003131415504077600254070ustar00rootroot00000000000000'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-2.61.1/test/form/samples/string-indentation/_expected/es.js000066400000000000000000000002741415504077600252450ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/string-indentation/_expected/iife.js000066400000000000000000000003521415504077600255470ustar00rootroot00000000000000(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-2.61.1/test/form/samples/string-indentation/_expected/system.js000066400000000000000000000004721415504077600261620ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/string-indentation/_expected/umd.js000066400000000000000000000005151415504077600254210ustar00rootroot00000000000000(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-2.61.1/test/form/samples/string-indentation/main.js000066400000000000000000000002741415504077600236220ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/super-classes/000077500000000000000000000000001415504077600213065ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/super-classes/super-class-prototype-access/000077500000000000000000000000001415504077600270515ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/super-classes/super-class-prototype-access/_config.js000066400000000000000000000001641415504077600310140ustar00rootroot00000000000000module.exports = { description: 'correctly resolves the prototype of the super class when accessing properties' }; rollup-2.61.1/test/form/samples/super-classes/super-class-prototype-access/_expected.js000066400000000000000000000003021415504077600313420ustar00rootroot00000000000000class SuperAccess { prop = {}; method() {} } class Access extends SuperAccess {} Access.prototype.doesNoExist.throws; Access.prototype.method.doesNoExist.throws; Access.prototype.prop.throws; rollup-2.61.1/test/form/samples/super-classes/super-class-prototype-access/main.js000066400000000000000000000004061415504077600303330ustar00rootroot00000000000000class SuperAccess { prop = {}; method() {} } class Access extends SuperAccess {} Access.prototype.doesNoExist; Access.prototype.doesNoExist.throws; Access.prototype.method.doesNoExist; Access.prototype.method.doesNoExist.throws; Access.prototype.prop.throws; rollup-2.61.1/test/form/samples/super-classes/super-class-prototype-assignment/000077500000000000000000000000001415504077600277605ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/super-classes/super-class-prototype-assignment/_config.js000066400000000000000000000001641415504077600317230ustar00rootroot00000000000000module.exports = { description: 'correctly resolves the prototype of the super class when assigning properites' }; rollup-2.61.1/test/form/samples/super-classes/super-class-prototype-assignment/_expected.js000066400000000000000000000012331415504077600322550ustar00rootroot00000000000000class 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-2.61.1/test/form/samples/super-classes/super-class-prototype-assignment/main.js000066400000000000000000000016051415504077600312440ustar00rootroot00000000000000class SuperRemovedAssign { method() {} set prop(v) {} } class RemovedAssign extends SuperRemovedAssign {} RemovedAssign.prototype.doesNotExist = 1; RemovedAssign.prototype.method.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-2.61.1/test/form/samples/super-classes/super-class-prototype-calls/000077500000000000000000000000001415504077600267065ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/super-classes/super-class-prototype-calls/_config.js000066400000000000000000000001621415504077600306470ustar00rootroot00000000000000module.exports = { description: 'correctly resolves the prototype of the super class when calling properties' }; rollup-2.61.1/test/form/samples/super-classes/super-class-prototype-calls/_expected.js000066400000000000000000000005651415504077600312120ustar00rootroot00000000000000class SuperValues { get prop() { return { effect(used) { console.log('effect', used); }, isTrue() { return true; } }; } effect(used) { console.log('effect', used); } isTrue() { return true; } } class Values extends SuperValues {} console.log('retained'); console.log('retained'); Values.prototype.effect(); Values.prototype.prop.effect(); rollup-2.61.1/test/form/samples/super-classes/super-class-prototype-calls/main.js000066400000000000000000000007621415504077600301750ustar00rootroot00000000000000class SuperValues { get prop() { return { effect(used) { console.log('effect', used); }, isTrue() { return true; } }; } effect(used) { console.log('effect', used); } isTrue() { return true; } } class Values extends SuperValues {} if (Values.prototype.isTrue()) console.log('retained'); else console.log('removed'); if (Values.prototype.prop.isTrue()) console.log('retained'); else console.log('removed'); Values.prototype.effect(); Values.prototype.prop.effect(); rollup-2.61.1/test/form/samples/super-classes/super-class-prototype-values/000077500000000000000000000000001415504077600271075ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/super-classes/super-class-prototype-values/_config.js000066400000000000000000000001671415504077600310550ustar00rootroot00000000000000module.exports = { description: 'correctly resolves the prototype of the super class when reading property values' }; rollup-2.61.1/test/form/samples/super-classes/super-class-prototype-values/_expected.js000066400000000000000000000005671415504077600314150ustar00rootroot00000000000000console.log('retained'); console.log('retained'); // Note that isTrueProp is not part of the prototype console.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-2.61.1/test/form/samples/super-classes/super-class-prototype-values/main.js000066400000000000000000000013121415504077600303660ustar00rootroot00000000000000class SuperValues { isTrueProp = true; get isTrue() { return true; } get prop() { return { isTrue: true }; } } class Values extends SuperValues {} if (Values.prototype.isTrue) console.log('retained'); else console.log('removed'); if (Values.prototype.prop.isTrue) console.log('retained'); else console.log('removed'); // Note that isTrueProp is not part of the prototype if (Values.prototype.isTrueProp) console.log('removed'); else console.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-2.61.1/test/form/samples/supports-core-js/000077500000000000000000000000001415504077600217545ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/supports-core-js/_config.js000066400000000000000000000004101415504077600237110ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/form/samples/supports-core-js/_expected.js000066400000000000000000017376751415504077600243040ustar00rootroot00000000000000var 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$R = // 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; })() || Function('return this')(); var objectGetOwnPropertyDescriptor = {}; var fails$15 = function (exec) { try { return !!exec(); } catch (error) { return true; } }; var fails$14 = fails$15; // Detect IE8's incomplete defineProperty implementation var descriptors = !fails$14(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7; }); var objectPropertyIsEnumerable = {}; var $propertyIsEnumerable$1 = {}.propertyIsEnumerable; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getOwnPropertyDescriptor$8 = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug var NASHORN_BUG = getOwnPropertyDescriptor$8 && !$propertyIsEnumerable$1.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$8(this, V); return !!descriptor && descriptor.enumerable; } : $propertyIsEnumerable$1; var createPropertyDescriptor$9 = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; var toString$u = {}.toString; var classofRaw$1 = function (it) { return toString$u.call(it).slice(8, -1); }; var fails$13 = fails$15; var classof$d = classofRaw$1; var split = ''.split; // fallback for non-array-like ES3 and non-enumerable old V8 strings var indexedObject = fails$13(function () { // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 // eslint-disable-next-line no-prototype-builtins -- safe return !Object('z').propertyIsEnumerable(0); }) ? function (it) { return classof$d(it) == 'String' ? split.call(it, '') : Object(it); } : Object; // `RequireObjectCoercible` abstract operation // https://tc39.es/ecma262/#sec-requireobjectcoercible var requireObjectCoercible$j = function (it) { if (it == undefined) throw TypeError("Can't call method on " + it); return it; }; // toObject with fallback for non-array-like ES3 strings var IndexedObject$6 = indexedObject; var requireObjectCoercible$i = requireObjectCoercible$j; var toIndexedObject$d = function (it) { return IndexedObject$6(requireObjectCoercible$i(it)); }; // `IsCallable` abstract operation // https://tc39.es/ecma262/#sec-iscallable var isCallable$z = function (argument) { return typeof argument === 'function'; }; var isCallable$y = isCallable$z; var isObject$C = function (it) { return typeof it === 'object' ? it !== null : isCallable$y(it); }; var global$Q = global$R; var isCallable$x = isCallable$z; var aFunction = function (argument) { return isCallable$x(argument) ? argument : undefined; }; var getBuiltIn$y = function (namespace, method) { return arguments.length < 2 ? aFunction(global$Q[namespace]) : global$Q[namespace] && global$Q[namespace][method]; }; var getBuiltIn$x = getBuiltIn$y; var engineUserAgent = getBuiltIn$x('navigator', 'userAgent') || ''; var global$P = global$R; var userAgent$7 = engineUserAgent; var process$4 = global$P.process; var Deno = global$P.Deno; var versions = process$4 && process$4.versions || Deno && Deno.version; var v8 = versions && versions.v8; var match, version; if (v8) { match = v8.split('.'); version = match[0] < 4 ? 1 : match[0] + match[1]; } else if (userAgent$7) { match = userAgent$7.match(/Edge\/(\d+)/); if (!match || match[1] >= 74) { match = userAgent$7.match(/Chrome\/(\d+)/); if (match) version = match[1]; } } var engineV8Version = version && +version; /* eslint-disable es/no-symbol -- required for testing */ var V8_VERSION$3 = engineV8Version; var fails$12 = fails$15; // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing var nativeSymbol$1 = !!Object.getOwnPropertySymbols && !fails$12(function () { var symbol = Symbol(); // Chrome 38 Symbol has incorrect toString conversion // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances return !String(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$2 = nativeSymbol$1; var useSymbolAsUid = NATIVE_SYMBOL$2 && !Symbol.sham && typeof Symbol.iterator == 'symbol'; var isCallable$w = isCallable$z; var getBuiltIn$w = getBuiltIn$y; var USE_SYMBOL_AS_UID$1 = useSymbolAsUid; var isSymbol$5 = USE_SYMBOL_AS_UID$1 ? function (it) { return typeof it == 'symbol'; } : function (it) { var $Symbol = getBuiltIn$w('Symbol'); return isCallable$w($Symbol) && Object(it) instanceof $Symbol; }; var tryToString$3 = function (argument) { try { return String(argument); } catch (error) { return 'Object'; } }; var isCallable$v = isCallable$z; var tryToString$2 = tryToString$3; // `Assert: IsCallable(argument) is true` var aCallable$Q = function (argument) { if (isCallable$v(argument)) return argument; throw TypeError(tryToString$2(argument) + ' is not a function'); }; var aCallable$P = aCallable$Q; // `GetMethod` abstract operation // https://tc39.es/ecma262/#sec-getmethod var getMethod$h = function (V, P) { var func = V[P]; return func == null ? undefined : aCallable$P(func); }; var isCallable$u = isCallable$z; var isObject$B = isObject$C; // `OrdinaryToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-ordinarytoprimitive var ordinaryToPrimitive$2 = function (input, pref) { var fn, val; if (pref === 'string' && isCallable$u(fn = input.toString) && !isObject$B(val = fn.call(input))) return val; if (isCallable$u(fn = input.valueOf) && !isObject$B(val = fn.call(input))) return val; if (pref !== 'string' && isCallable$u(fn = input.toString) && !isObject$B(val = fn.call(input))) return val; throw TypeError("Can't convert object to primitive value"); }; var shared$7 = {exports: {}}; var isPure = false; var global$O = global$R; var setGlobal$3 = function (key, value) { try { // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty(global$O, key, { value: value, configurable: true, writable: true }); } catch (error) { global$O[key] = value; } return value; }; var global$N = global$R; var setGlobal$2 = setGlobal$3; var SHARED = '__core-js_shared__'; var store$5 = global$N[SHARED] || setGlobal$2(SHARED, {}); var sharedStore = store$5; var store$4 = sharedStore; (shared$7.exports = function (key, value) { return store$4[key] || (store$4[key] = value !== undefined ? value : {}); })('versions', []).push({ version: '3.18.3', mode: 'global', copyright: '© 2021 Denis Pushkarev (zloirock.ru)' }); var requireObjectCoercible$h = requireObjectCoercible$j; // `ToObject` abstract operation // https://tc39.es/ecma262/#sec-toobject var toObject$z = function (argument) { return Object(requireObjectCoercible$h(argument)); }; var toObject$y = toObject$z; var hasOwnProperty = {}.hasOwnProperty; // `HasOwnProperty` abstract operation // https://tc39.es/ecma262/#sec-hasownproperty var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) { return hasOwnProperty.call(toObject$y(it), key); }; var id$2 = 0; var postfix = Math.random(); var uid$5 = function (key) { return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id$2 + postfix).toString(36); }; var global$M = global$R; var shared$6 = shared$7.exports; var hasOwn$o = hasOwnProperty_1; var uid$4 = uid$5; var NATIVE_SYMBOL$1 = nativeSymbol$1; var USE_SYMBOL_AS_UID = useSymbolAsUid; var WellKnownSymbolsStore$1 = shared$6('wks'); var Symbol$3 = global$M.Symbol; var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$3 : Symbol$3 && Symbol$3.withoutSetter || uid$4; var wellKnownSymbol$G = function (name) { if (!hasOwn$o(WellKnownSymbolsStore$1, name) || !(NATIVE_SYMBOL$1 || typeof WellKnownSymbolsStore$1[name] == 'string')) { if (NATIVE_SYMBOL$1 && hasOwn$o(Symbol$3, name)) { WellKnownSymbolsStore$1[name] = Symbol$3[name]; } else { WellKnownSymbolsStore$1[name] = createWellKnownSymbol('Symbol.' + name); } } return WellKnownSymbolsStore$1[name]; }; var isObject$A = isObject$C; var isSymbol$4 = isSymbol$5; var getMethod$g = getMethod$h; var ordinaryToPrimitive$1 = ordinaryToPrimitive$2; var wellKnownSymbol$F = wellKnownSymbol$G; var TO_PRIMITIVE$2 = wellKnownSymbol$F('toPrimitive'); // `ToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-toprimitive var toPrimitive$3 = function (input, pref) { if (!isObject$A(input) || isSymbol$4(input)) return input; var exoticToPrim = getMethod$g(input, TO_PRIMITIVE$2); var result; if (exoticToPrim) { if (pref === undefined) pref = 'default'; result = exoticToPrim.call(input, pref); if (!isObject$A(result) || isSymbol$4(result)) return result; throw TypeError("Can't convert object to primitive value"); } if (pref === undefined) pref = 'number'; return ordinaryToPrimitive$1(input, pref); }; var toPrimitive$2 = toPrimitive$3; var isSymbol$3 = isSymbol$5; // `ToPropertyKey` abstract operation // https://tc39.es/ecma262/#sec-topropertykey var toPropertyKey$9 = function (argument) { var key = toPrimitive$2(argument, 'string'); return isSymbol$3(key) ? key : String(key); }; var global$L = global$R; var isObject$z = isObject$C; var document$3 = global$L.document; // typeof document.createElement is 'object' in old IE var EXISTS$1 = isObject$z(document$3) && isObject$z(document$3.createElement); var documentCreateElement$2 = function (it) { return EXISTS$1 ? document$3.createElement(it) : {}; }; var DESCRIPTORS$A = descriptors; var fails$11 = fails$15; var createElement$1 = documentCreateElement$2; // Thank's IE8 for his funny defineProperty var ie8DomDefine = !DESCRIPTORS$A && !fails$11(function () { // eslint-disable-next-line es/no-object-defineproperty -- requied for testing return Object.defineProperty(createElement$1('div'), 'a', { get: function () { return 7; } }).a != 7; }); var DESCRIPTORS$z = descriptors; var propertyIsEnumerableModule$2 = objectPropertyIsEnumerable; var createPropertyDescriptor$8 = createPropertyDescriptor$9; var toIndexedObject$c = toIndexedObject$d; var toPropertyKey$8 = toPropertyKey$9; var hasOwn$n = hasOwnProperty_1; var IE8_DOM_DEFINE$1 = ie8DomDefine; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor objectGetOwnPropertyDescriptor.f = DESCRIPTORS$z ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject$c(O); P = toPropertyKey$8(P); if (IE8_DOM_DEFINE$1) try { return $getOwnPropertyDescriptor$1(O, P); } catch (error) { /* empty */ } if (hasOwn$n(O, P)) return createPropertyDescriptor$8(!propertyIsEnumerableModule$2.f.call(O, P), O[P]); }; var objectDefineProperty = {}; var isObject$y = isObject$C; // `Assert: Type(argument) is Object` var anObject$1C = function (argument) { if (isObject$y(argument)) return argument; throw TypeError(String(argument) + ' is not an object'); }; var DESCRIPTORS$y = descriptors; var IE8_DOM_DEFINE = ie8DomDefine; var anObject$1B = anObject$1C; var toPropertyKey$7 = toPropertyKey$9; // eslint-disable-next-line es/no-object-defineproperty -- safe var $defineProperty$1 = Object.defineProperty; // `Object.defineProperty` method // https://tc39.es/ecma262/#sec-object.defineproperty objectDefineProperty.f = DESCRIPTORS$y ? $defineProperty$1 : function defineProperty(O, P, Attributes) { anObject$1B(O); P = toPropertyKey$7(P); anObject$1B(Attributes); if (IE8_DOM_DEFINE) try { return $defineProperty$1(O, P, Attributes); } catch (error) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; var DESCRIPTORS$x = descriptors; var definePropertyModule$c = objectDefineProperty; var createPropertyDescriptor$7 = createPropertyDescriptor$9; var createNonEnumerableProperty$h = DESCRIPTORS$x ? function (object, key, value) { return definePropertyModule$c.f(object, key, createPropertyDescriptor$7(1, value)); } : function (object, key, value) { object[key] = value; return object; }; var redefine$l = {exports: {}}; var isCallable$t = isCallable$z; var store$3 = sharedStore; var functionToString = Function.toString; // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper if (!isCallable$t(store$3.inspectSource)) { store$3.inspectSource = function (it) { return functionToString.call(it); }; } var inspectSource$4 = store$3.inspectSource; var global$K = global$R; var isCallable$s = isCallable$z; var inspectSource$3 = inspectSource$4; var WeakMap$3 = global$K.WeakMap; var nativeWeakMap = isCallable$s(WeakMap$3) && /native code/.test(inspectSource$3(WeakMap$3)); var shared$5 = shared$7.exports; var uid$3 = uid$5; var keys$3 = shared$5('keys'); var sharedKey$4 = function (key) { return keys$3[key] || (keys$3[key] = uid$3(key)); }; var hiddenKeys$6 = {}; var NATIVE_WEAK_MAP$1 = nativeWeakMap; var global$J = global$R; var isObject$x = isObject$C; var createNonEnumerableProperty$g = createNonEnumerableProperty$h; var hasOwn$m = hasOwnProperty_1; var shared$4 = sharedStore; var sharedKey$3 = sharedKey$4; var hiddenKeys$5 = hiddenKeys$6; var OBJECT_ALREADY_INITIALIZED = 'Object already initialized'; var WeakMap$2 = global$J.WeakMap; var set$3, get$2, has; var enforce = function (it) { return has(it) ? get$2(it) : set$3(it, {}); }; var getterFor = function (TYPE) { return function (it) { var state; if (!isObject$x(it) || (state = get$2(it)).type !== TYPE) { throw TypeError('Incompatible receiver, ' + TYPE + ' required'); } return state; }; }; if (NATIVE_WEAK_MAP$1 || shared$4.state) { var store$2 = shared$4.state || (shared$4.state = new WeakMap$2()); var wmget = store$2.get; var wmhas = store$2.has; var wmset = store$2.set; set$3 = function (it, metadata) { if (wmhas.call(store$2, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; wmset.call(store$2, it, metadata); return metadata; }; get$2 = function (it) { return wmget.call(store$2, it) || {}; }; has = function (it) { return wmhas.call(store$2, it); }; } else { var STATE = sharedKey$3('state'); hiddenKeys$5[STATE] = true; set$3 = function (it, metadata) { if (hasOwn$m(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; createNonEnumerableProperty$g(it, STATE, metadata); return metadata; }; get$2 = function (it) { return hasOwn$m(it, STATE) ? it[STATE] : {}; }; has = function (it) { return hasOwn$m(it, STATE); }; } var internalState = { set: set$3, get: get$2, has: has, enforce: enforce, getterFor: getterFor }; var DESCRIPTORS$w = descriptors; var hasOwn$l = hasOwnProperty_1; var FunctionPrototype$2 = Function.prototype; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getDescriptor = DESCRIPTORS$w && Object.getOwnPropertyDescriptor; var EXISTS = hasOwn$l(FunctionPrototype$2, 'name'); // additional protection from minified / mangled / dropped function names var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something'; var CONFIGURABLE = EXISTS && (!DESCRIPTORS$w || (DESCRIPTORS$w && getDescriptor(FunctionPrototype$2, 'name').configurable)); var functionName = { EXISTS: EXISTS, PROPER: PROPER, CONFIGURABLE: CONFIGURABLE }; var global$I = global$R; var isCallable$r = isCallable$z; var hasOwn$k = hasOwnProperty_1; var createNonEnumerableProperty$f = createNonEnumerableProperty$h; var setGlobal$1 = setGlobal$3; var inspectSource$2 = inspectSource$4; var InternalStateModule$j = internalState; var CONFIGURABLE_FUNCTION_NAME$2 = functionName.CONFIGURABLE; var getInternalState$i = InternalStateModule$j.get; var enforceInternalState$1 = InternalStateModule$j.enforce; var TEMPLATE = String(String).split('String'); (redefine$l.exports = function (O, key, value, options) { var unsafe = options ? !!options.unsafe : false; var simple = options ? !!options.enumerable : false; var noTargetGet = options ? !!options.noTargetGet : false; var name = options && options.name !== undefined ? options.name : key; var state; if (isCallable$r(value)) { if (String(name).slice(0, 7) === 'Symbol(') { name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']'; } if (!hasOwn$k(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$2 && value.name !== name)) { createNonEnumerableProperty$f(value, 'name', name); } state = enforceInternalState$1(value); if (!state.source) { state.source = TEMPLATE.join(typeof name == 'string' ? name : ''); } } if (O === global$I) { if (simple) O[key] = value; else setGlobal$1(key, value); return; } else if (!unsafe) { delete O[key]; } else if (!noTargetGet && O[key]) { simple = true; } if (simple) O[key] = value; else createNonEnumerableProperty$f(O, key, value); // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative })(Function.prototype, 'toString', function toString() { return isCallable$r(this) && getInternalState$i(this).source || inspectSource$2(this); }); var objectGetOwnPropertyNames = {}; var ceil$2 = Math.ceil; var floor$a = Math.floor; // `ToIntegerOrInfinity` abstract operation // https://tc39.es/ecma262/#sec-tointegerorinfinity var toIntegerOrInfinity$i = function (argument) { var number = +argument; // eslint-disable-next-line no-self-compare -- safe return number !== number || number === 0 ? 0 : (number > 0 ? floor$a : ceil$2)(number); }; var toIntegerOrInfinity$h = toIntegerOrInfinity$i; var max$6 = Math.max; var min$a = 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$8 = function (index, length) { var integer = toIntegerOrInfinity$h(index); return integer < 0 ? max$6(integer + length, 0) : min$a(integer, length); }; var toIntegerOrInfinity$g = toIntegerOrInfinity$i; var min$9 = Math.min; // `ToLength` abstract operation // https://tc39.es/ecma262/#sec-tolength var toLength$d = function (argument) { return argument > 0 ? min$9(toIntegerOrInfinity$g(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 }; var toLength$c = toLength$d; // `LengthOfArrayLike` abstract operation // https://tc39.es/ecma262/#sec-lengthofarraylike var lengthOfArrayLike$q = function (obj) { return toLength$c(obj.length); }; var toIndexedObject$b = toIndexedObject$d; var toAbsoluteIndex$7 = toAbsoluteIndex$8; var lengthOfArrayLike$p = lengthOfArrayLike$q; // `Array.prototype.{ indexOf, includes }` methods implementation var createMethod$8 = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIndexedObject$b($this); var length = lengthOfArrayLike$p(O); var index = toAbsoluteIndex$7(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 hasOwn$j = hasOwnProperty_1; var toIndexedObject$a = toIndexedObject$d; var indexOf = arrayIncludes.indexOf; var hiddenKeys$4 = hiddenKeys$6; var objectKeysInternal = function (object, names) { var O = toIndexedObject$a(object); var i = 0; var result = []; var key; for (key in O) !hasOwn$j(hiddenKeys$4, key) && hasOwn$j(O, key) && result.push(key); // Don't enum bug & hidden keys while (names.length > i) if (hasOwn$j(O, key = names[i++])) { ~indexOf(result, key) || result.push(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$v = getBuiltIn$y; var getOwnPropertyNamesModule$2 = objectGetOwnPropertyNames; var getOwnPropertySymbolsModule$2 = objectGetOwnPropertySymbols; var anObject$1A = anObject$1C; // all object keys, includes non-enumerable and symbols var ownKeys$3 = getBuiltIn$v('Reflect', 'ownKeys') || function ownKeys(it) { var keys = getOwnPropertyNamesModule$2.f(anObject$1A(it)); var getOwnPropertySymbols = getOwnPropertySymbolsModule$2.f; return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; }; var hasOwn$i = hasOwnProperty_1; var ownKeys$2 = ownKeys$3; var getOwnPropertyDescriptorModule$6 = objectGetOwnPropertyDescriptor; var definePropertyModule$b = objectDefineProperty; var copyConstructorProperties$3 = function (target, source) { var keys = ownKeys$2(source); var defineProperty = definePropertyModule$b.f; var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule$6.f; for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (!hasOwn$i(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key)); } }; var fails$10 = fails$15; var isCallable$q = isCallable$z; var replacement = /#|\.prototype\./; var isForced$5 = function (feature, detection) { var value = data[normalize(feature)]; return value == POLYFILL ? true : value == NATIVE ? false : isCallable$q(detection) ? fails$10(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$H = global$R; var getOwnPropertyDescriptor$7 = objectGetOwnPropertyDescriptor.f; var createNonEnumerableProperty$e = createNonEnumerableProperty$h; var redefine$k = redefine$l.exports; var setGlobal = setGlobal$3; var copyConstructorProperties$2 = copyConstructorProperties$3; 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.noTargetGet - 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$H; } else if (STATIC) { target = global$H[TARGET] || setGlobal(TARGET, {}); } else { target = (global$H[TARGET] || {}).prototype; } if (target) for (key in source) { sourceProperty = source[key]; if (options.noTargetGet) { descriptor = getOwnPropertyDescriptor$7(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$2(sourceProperty, targetProperty); } // add a flag to not completely full polyfills if (options.sham || (targetProperty && targetProperty.sham)) { createNonEnumerableProperty$e(sourceProperty, 'sham', true); } // extend global redefine$k(target, key, sourceProperty, options); } }; var classof$c = classofRaw$1; // `IsArray` abstract operation // https://tc39.es/ecma262/#sec-isarray // eslint-disable-next-line es/no-array-isarray -- safe var isArray$8 = Array.isArray || function isArray(argument) { return classof$c(argument) == 'Array'; }; var wellKnownSymbol$E = wellKnownSymbol$G; var TO_STRING_TAG$8 = wellKnownSymbol$E('toStringTag'); var test$2 = {}; test$2[TO_STRING_TAG$8] = 'z'; var toStringTagSupport = String(test$2) === '[object z]'; var TO_STRING_TAG_SUPPORT$2 = toStringTagSupport; var isCallable$p = isCallable$z; var classofRaw = classofRaw$1; var wellKnownSymbol$D = wellKnownSymbol$G; var TO_STRING_TAG$7 = wellKnownSymbol$D('toStringTag'); // ES3 wrong here var CORRECT_ARGUMENTS = classofRaw(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$b = TO_STRING_TAG_SUPPORT$2 ? classofRaw : function (it) { var O, tag, result; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$7)) == 'string' ? tag // builtinTag case : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback : (result = classofRaw(O)) == 'Object' && isCallable$p(O.callee) ? 'Arguments' : result; }; var classof$a = classof$b; var toString$t = function (argument) { if (classof$a(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string'); return String(argument); }; 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$5 = Object.keys || function keys(O) { return internalObjectKeys(O, enumBugKeys$1); }; var DESCRIPTORS$v = descriptors; var definePropertyModule$a = objectDefineProperty; var anObject$1z = anObject$1C; var objectKeys$4 = objectKeys$5; // `Object.defineProperties` method // https://tc39.es/ecma262/#sec-object.defineproperties // eslint-disable-next-line es/no-object-defineproperties -- safe var objectDefineProperties = DESCRIPTORS$v ? Object.defineProperties : function defineProperties(O, Properties) { anObject$1z(O); var keys = objectKeys$4(Properties); var length = keys.length; var index = 0; var key; while (length > index) definePropertyModule$a.f(O, key = keys[index++], Properties[key]); return O; }; var getBuiltIn$u = getBuiltIn$y; var html$2 = getBuiltIn$u('document', 'documentElement'); /* global ActiveXObject -- old IE, WSH */ var anObject$1y = anObject$1C; var defineProperties$3 = 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 var objectCreate$1 = Object.create || function create(O, Properties) { var result; if (O !== null) { EmptyConstructor[PROTOTYPE$2] = anObject$1y(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 : defineProperties$3(result, Properties); }; var objectGetOwnPropertyNamesExternal = {}; /* eslint-disable es/no-object-getownpropertynames -- safe */ var toIndexedObject$9 = toIndexedObject$d; var $getOwnPropertyNames$1 = objectGetOwnPropertyNames.f; var toString$s = {}.toString; var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; var getWindowNames = function (it) { try { return $getOwnPropertyNames$1(it); } catch (error) { return windowNames.slice(); } }; // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window objectGetOwnPropertyNamesExternal.f = function getOwnPropertyNames(it) { return windowNames && toString$s.call(it) == '[object Window]' ? getWindowNames(it) : $getOwnPropertyNames$1(toIndexedObject$9(it)); }; var wellKnownSymbolWrapped = {}; var wellKnownSymbol$C = wellKnownSymbol$G; wellKnownSymbolWrapped.f = wellKnownSymbol$C; var global$G = global$R; var path$1 = global$G; var path = path$1; var hasOwn$h = hasOwnProperty_1; var wrappedWellKnownSymbolModule$1 = wellKnownSymbolWrapped; var defineProperty$f = objectDefineProperty.f; var defineWellKnownSymbol$l = function (NAME) { var Symbol = path.Symbol || (path.Symbol = {}); if (!hasOwn$h(Symbol, NAME)) defineProperty$f(Symbol, NAME, { value: wrappedWellKnownSymbolModule$1.f(NAME) }); }; var defineProperty$e = objectDefineProperty.f; var hasOwn$g = hasOwnProperty_1; var wellKnownSymbol$B = wellKnownSymbol$G; var TO_STRING_TAG$6 = wellKnownSymbol$B('toStringTag'); var setToStringTag$b = function (it, TAG, STATIC) { if (it && !hasOwn$g(it = STATIC ? it : it.prototype, TO_STRING_TAG$6)) { defineProperty$e(it, TO_STRING_TAG$6, { configurable: true, value: TAG }); } }; var aCallable$O = aCallable$Q; // optional / simple context binding var functionBindContext = function (fn, that, length) { aCallable$O(fn); if (that === undefined) return fn; switch (length) { case 0: return function () { return fn.call(that); }; case 1: return function (a) { return fn.call(that, a); }; case 2: return function (a, b) { return fn.call(that, a, b); }; case 3: return function (a, b, c) { return fn.call(that, a, b, c); }; } return function (/* ...args */) { return fn.apply(that, arguments); }; }; var fails$$ = fails$15; var isCallable$o = isCallable$z; var classof$9 = classof$b; var getBuiltIn$t = getBuiltIn$y; var inspectSource$1 = inspectSource$4; var empty = []; var construct$1 = getBuiltIn$t('Reflect', 'construct'); var constructorRegExp = /^\s*(?:class|function)\b/; var exec$1 = constructorRegExp.exec; var INCORRECT_TO_STRING = !constructorRegExp.exec(function () { /* empty */ }); var isConstructorModern = function (argument) { if (!isCallable$o(argument)) return false; try { construct$1(Object, empty, argument); return true; } catch (error) { return false; } }; var isConstructorLegacy = function (argument) { if (!isCallable$o(argument)) return false; switch (classof$9(argument)) { case 'AsyncFunction': case 'GeneratorFunction': case 'AsyncGeneratorFunction': return false; // we can't check .prototype since constructors produced by .bind haven't it } return INCORRECT_TO_STRING || !!exec$1.call(constructorRegExp, inspectSource$1(argument)); }; // `IsConstructor` abstract operation // https://tc39.es/ecma262/#sec-isconstructor var isConstructor$7 = !construct$1 || fails$$(function () { var called; return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function () { called = true; }) || called; }) ? isConstructorLegacy : isConstructorModern; var isArray$7 = isArray$8; var isConstructor$6 = isConstructor$7; var isObject$w = isObject$C; var wellKnownSymbol$A = wellKnownSymbol$G; var SPECIES$6 = wellKnownSymbol$A('species'); // a part of `ArraySpeciesCreate` abstract operation // https://tc39.es/ecma262/#sec-arrayspeciescreate var arraySpeciesConstructor$2 = function (originalArray) { var C; if (isArray$7(originalArray)) { C = originalArray.constructor; // cross-realm fallback if (isConstructor$6(C) && (C === Array || isArray$7(C.prototype))) C = undefined; else if (isObject$w(C)) { C = C[SPECIES$6]; if (C === null) C = undefined; } } return C === undefined ? Array : C; }; var arraySpeciesConstructor$1 = arraySpeciesConstructor$2; // `ArraySpeciesCreate` abstract operation // https://tc39.es/ecma262/#sec-arrayspeciescreate var arraySpeciesCreate$6 = function (originalArray, length) { return new (arraySpeciesConstructor$1(originalArray))(length === 0 ? 0 : length); }; var bind$q = functionBindContext; var IndexedObject$5 = indexedObject; var toObject$x = toObject$z; var lengthOfArrayLike$o = lengthOfArrayLike$q; var arraySpeciesCreate$5 = arraySpeciesCreate$6; var push$4 = [].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$x($this); var self = IndexedObject$5(O); var boundFunction = bind$q(callbackfn, that, 3); var length = lengthOfArrayLike$o(self); var index = 0; var create = specificCreate || arraySpeciesCreate$5; 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$4.call(target, value); // filter } else switch (TYPE) { case 4: return false; // every case 7: push$4.call(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 $$4i = _export; var global$F = global$R; var getBuiltIn$s = getBuiltIn$y; var DESCRIPTORS$u = descriptors; var NATIVE_SYMBOL = nativeSymbol$1; var fails$_ = fails$15; var hasOwn$f = hasOwnProperty_1; var isArray$6 = isArray$8; var isCallable$n = isCallable$z; var isObject$v = isObject$C; var isSymbol$2 = isSymbol$5; var anObject$1x = anObject$1C; var toObject$w = toObject$z; var toIndexedObject$8 = toIndexedObject$d; var toPropertyKey$6 = toPropertyKey$9; var $toString$3 = toString$t; var createPropertyDescriptor$6 = createPropertyDescriptor$9; var nativeObjectCreate = objectCreate$1; var objectKeys$3 = objectKeys$5; var getOwnPropertyNamesModule$1 = objectGetOwnPropertyNames; var getOwnPropertyNamesExternal = objectGetOwnPropertyNamesExternal; var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols; var getOwnPropertyDescriptorModule$5 = objectGetOwnPropertyDescriptor; var definePropertyModule$9 = objectDefineProperty; var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable; var redefine$j = redefine$l.exports; var shared$3 = shared$7.exports; var sharedKey$1 = sharedKey$4; var hiddenKeys$1 = hiddenKeys$6; var uid$2 = uid$5; var wellKnownSymbol$z = wellKnownSymbol$G; var wrappedWellKnownSymbolModule = wellKnownSymbolWrapped; var defineWellKnownSymbol$k = defineWellKnownSymbol$l; var setToStringTag$a = setToStringTag$b; var InternalStateModule$i = internalState; var $forEach$3 = arrayIteration.forEach; var HIDDEN = sharedKey$1('hidden'); var SYMBOL = 'Symbol'; var PROTOTYPE$1 = 'prototype'; var TO_PRIMITIVE$1 = wellKnownSymbol$z('toPrimitive'); var setInternalState$i = InternalStateModule$i.set; var getInternalState$h = InternalStateModule$i.getterFor(SYMBOL); var ObjectPrototype$3 = Object[PROTOTYPE$1]; var $Symbol = global$F.Symbol; var $stringify$1 = getBuiltIn$s('JSON', 'stringify'); var nativeGetOwnPropertyDescriptor$2 = getOwnPropertyDescriptorModule$5.f; var nativeDefineProperty$1 = definePropertyModule$9.f; var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f; var nativePropertyIsEnumerable = propertyIsEnumerableModule$1.f; var AllSymbols = shared$3('symbols'); var ObjectPrototypeSymbols = shared$3('op-symbols'); var StringToSymbolRegistry = shared$3('string-to-symbol-registry'); var SymbolToStringRegistry = shared$3('symbol-to-string-registry'); var WellKnownSymbolsStore = shared$3('wks'); var QObject = global$F.QObject; // 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$u && fails$_(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$3, P); if (ObjectPrototypeDescriptor) delete ObjectPrototype$3[P]; nativeDefineProperty$1(O, P, Attributes); if (ObjectPrototypeDescriptor && O !== ObjectPrototype$3) { nativeDefineProperty$1(ObjectPrototype$3, P, ObjectPrototypeDescriptor); } } : nativeDefineProperty$1; var wrap$1 = function (tag, description) { var symbol = AllSymbols[tag] = nativeObjectCreate($Symbol[PROTOTYPE$1]); setInternalState$i(symbol, { type: SYMBOL, tag: tag, description: description }); if (!DESCRIPTORS$u) symbol.description = description; return symbol; }; var $defineProperty = function defineProperty(O, P, Attributes) { if (O === ObjectPrototype$3) $defineProperty(ObjectPrototypeSymbols, P, Attributes); anObject$1x(O); var key = toPropertyKey$6(P); anObject$1x(Attributes); if (hasOwn$f(AllSymbols, key)) { if (!Attributes.enumerable) { if (!hasOwn$f(O, HIDDEN)) nativeDefineProperty$1(O, HIDDEN, createPropertyDescriptor$6(1, {})); O[HIDDEN][key] = true; } else { if (hasOwn$f(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false; Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor$6(0, false) }); } return setSymbolDescriptor(O, key, Attributes); } return nativeDefineProperty$1(O, key, Attributes); }; var $defineProperties = function defineProperties(O, Properties) { anObject$1x(O); var properties = toIndexedObject$8(Properties); var keys = objectKeys$3(properties).concat($getOwnPropertySymbols(properties)); $forEach$3(keys, function (key) { if (!DESCRIPTORS$u || $propertyIsEnumerable.call(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 = function propertyIsEnumerable(V) { var P = toPropertyKey$6(V); var enumerable = nativePropertyIsEnumerable.call(this, P); if (this === ObjectPrototype$3 && hasOwn$f(AllSymbols, P) && !hasOwn$f(ObjectPrototypeSymbols, P)) return false; return enumerable || !hasOwn$f(this, P) || !hasOwn$f(AllSymbols, P) || hasOwn$f(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true; }; var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) { var it = toIndexedObject$8(O); var key = toPropertyKey$6(P); if (it === ObjectPrototype$3 && hasOwn$f(AllSymbols, key) && !hasOwn$f(ObjectPrototypeSymbols, key)) return; var descriptor = nativeGetOwnPropertyDescriptor$2(it, key); if (descriptor && hasOwn$f(AllSymbols, key) && !(hasOwn$f(it, HIDDEN) && it[HIDDEN][key])) { descriptor.enumerable = true; } return descriptor; }; var $getOwnPropertyNames = function getOwnPropertyNames(O) { var names = nativeGetOwnPropertyNames(toIndexedObject$8(O)); var result = []; $forEach$3(names, function (key) { if (!hasOwn$f(AllSymbols, key) && !hasOwn$f(hiddenKeys$1, key)) result.push(key); }); return result; }; var $getOwnPropertySymbols = function getOwnPropertySymbols(O) { var IS_OBJECT_PROTOTYPE = O === ObjectPrototype$3; var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject$8(O)); var result = []; $forEach$3(names, function (key) { if (hasOwn$f(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn$f(ObjectPrototype$3, key))) { result.push(AllSymbols[key]); } }); return result; }; // `Symbol` constructor // https://tc39.es/ecma262/#sec-symbol-constructor if (!NATIVE_SYMBOL) { $Symbol = function Symbol() { if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor'); var description = !arguments.length || arguments[0] === undefined ? undefined : $toString$3(arguments[0]); var tag = uid$2(description); var setter = function (value) { if (this === ObjectPrototype$3) setter.call(ObjectPrototypeSymbols, value); if (hasOwn$f(this, HIDDEN) && hasOwn$f(this[HIDDEN], tag)) this[HIDDEN][tag] = false; setSymbolDescriptor(this, tag, createPropertyDescriptor$6(1, value)); }; if (DESCRIPTORS$u && USE_SETTER) setSymbolDescriptor(ObjectPrototype$3, tag, { configurable: true, set: setter }); return wrap$1(tag, description); }; redefine$j($Symbol[PROTOTYPE$1], 'toString', function toString() { return getInternalState$h(this).tag; }); redefine$j($Symbol, 'withoutSetter', function (description) { return wrap$1(uid$2(description), description); }); propertyIsEnumerableModule$1.f = $propertyIsEnumerable; definePropertyModule$9.f = $defineProperty; getOwnPropertyDescriptorModule$5.f = $getOwnPropertyDescriptor; getOwnPropertyNamesModule$1.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames; getOwnPropertySymbolsModule$1.f = $getOwnPropertySymbols; wrappedWellKnownSymbolModule.f = function (name) { return wrap$1(wellKnownSymbol$z(name), name); }; if (DESCRIPTORS$u) { // https://github.com/tc39/proposal-Symbol-description nativeDefineProperty$1($Symbol[PROTOTYPE$1], 'description', { configurable: true, get: function description() { return getInternalState$h(this).description; } }); { redefine$j(ObjectPrototype$3, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true }); } } } $$4i({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, { Symbol: $Symbol }); $forEach$3(objectKeys$3(WellKnownSymbolsStore), function (name) { defineWellKnownSymbol$k(name); }); $$4i({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, { // `Symbol.for` method // https://tc39.es/ecma262/#sec-symbol.for 'for': function (key) { var string = $toString$3(key); if (hasOwn$f(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string]; var symbol = $Symbol(string); StringToSymbolRegistry[string] = symbol; SymbolToStringRegistry[symbol] = string; return symbol; }, // `Symbol.keyFor` method // https://tc39.es/ecma262/#sec-symbol.keyfor keyFor: function keyFor(sym) { if (!isSymbol$2(sym)) throw TypeError(sym + ' is not a symbol'); if (hasOwn$f(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym]; }, useSetter: function () { USE_SETTER = true; }, useSimple: function () { USE_SETTER = false; } }); $$4i({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS$u }, { // `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 }); $$4i({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, { // `Object.getOwnPropertyNames` method // https://tc39.es/ecma262/#sec-object.getownpropertynames getOwnPropertyNames: $getOwnPropertyNames, // `Object.getOwnPropertySymbols` method // https://tc39.es/ecma262/#sec-object.getownpropertysymbols getOwnPropertySymbols: $getOwnPropertySymbols }); // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives // https://bugs.chromium.org/p/v8/issues/detail?id=3443 $$4i({ target: 'Object', stat: true, forced: fails$_(function () { getOwnPropertySymbolsModule$1.f(1); }) }, { getOwnPropertySymbols: function getOwnPropertySymbols(it) { return getOwnPropertySymbolsModule$1.f(toObject$w(it)); } }); // `JSON.stringify` method behavior with symbols // https://tc39.es/ecma262/#sec-json.stringify if ($stringify$1) { var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails$_(function () { var symbol = $Symbol(); // 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)) != '{}'; }); $$4i({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, { // eslint-disable-next-line no-unused-vars -- required for `.length` stringify: function stringify(it, replacer, space) { var args = [it]; var index = 1; var $replacer; while (arguments.length > index) args.push(arguments[index++]); $replacer = replacer; if (!isObject$v(replacer) && it === undefined || isSymbol$2(it)) return; // IE8 returns string on undefined if (!isArray$6(replacer)) replacer = function (key, value) { if (isCallable$n($replacer)) value = $replacer.call(this, key, value); if (!isSymbol$2(value)) return value; }; args[1] = replacer; return $stringify$1.apply(null, args); } }); } // `Symbol.prototype[@@toPrimitive]` method // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive if (!$Symbol[PROTOTYPE$1][TO_PRIMITIVE$1]) { var valueOf$1 = $Symbol[PROTOTYPE$1].valueOf; redefine$j($Symbol[PROTOTYPE$1], TO_PRIMITIVE$1, function () { return valueOf$1.apply(this, arguments); }); } // `Symbol.prototype[@@toStringTag]` property // https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag setToStringTag$a($Symbol, SYMBOL); hiddenKeys$1[HIDDEN] = true; var $$4h = _export; var DESCRIPTORS$t = descriptors; var global$E = global$R; var hasOwn$e = hasOwnProperty_1; var isCallable$m = isCallable$z; var isObject$u = isObject$C; var defineProperty$d = objectDefineProperty.f; var copyConstructorProperties$1 = copyConstructorProperties$3; var NativeSymbol = global$E.Symbol; if (DESCRIPTORS$t && isCallable$m(NativeSymbol) && (!('description' in NativeSymbol.prototype) || // 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 : String(arguments[0]); var result = this instanceof SymbolWrapper ? new NativeSymbol(description) // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)' : description === undefined ? NativeSymbol() : NativeSymbol(description); if (description === '') EmptyStringDescriptionStore[result] = true; return result; }; copyConstructorProperties$1(SymbolWrapper, NativeSymbol); var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype; symbolPrototype.constructor = SymbolWrapper; var symbolToString = symbolPrototype.toString; var nativeSymbol = String(NativeSymbol('test')) == 'Symbol(test)'; var regexp = /^Symbol\((.*)\)[^)]+$/; defineProperty$d(symbolPrototype, 'description', { configurable: true, get: function description() { var symbol = isObject$u(this) ? this.valueOf() : this; var string = symbolToString.call(symbol); if (hasOwn$e(EmptyStringDescriptionStore, symbol)) return ''; var desc = nativeSymbol ? string.slice(7, -1) : string.replace(regexp, '$1'); return desc === '' ? undefined : desc; } }); $$4h({ global: true, forced: true }, { Symbol: SymbolWrapper }); } var defineWellKnownSymbol$j = defineWellKnownSymbol$l; // `Symbol.asyncIterator` well-known symbol // https://tc39.es/ecma262/#sec-symbol.asynciterator defineWellKnownSymbol$j('asyncIterator'); var defineWellKnownSymbol$i = defineWellKnownSymbol$l; // `Symbol.hasInstance` well-known symbol // https://tc39.es/ecma262/#sec-symbol.hasinstance defineWellKnownSymbol$i('hasInstance'); var defineWellKnownSymbol$h = defineWellKnownSymbol$l; // `Symbol.isConcatSpreadable` well-known symbol // https://tc39.es/ecma262/#sec-symbol.isconcatspreadable defineWellKnownSymbol$h('isConcatSpreadable'); var defineWellKnownSymbol$g = defineWellKnownSymbol$l; // `Symbol.iterator` well-known symbol // https://tc39.es/ecma262/#sec-symbol.iterator defineWellKnownSymbol$g('iterator'); var defineWellKnownSymbol$f = defineWellKnownSymbol$l; // `Symbol.match` well-known symbol // https://tc39.es/ecma262/#sec-symbol.match defineWellKnownSymbol$f('match'); var defineWellKnownSymbol$e = defineWellKnownSymbol$l; // `Symbol.matchAll` well-known symbol // https://tc39.es/ecma262/#sec-symbol.matchall defineWellKnownSymbol$e('matchAll'); var defineWellKnownSymbol$d = defineWellKnownSymbol$l; // `Symbol.replace` well-known symbol // https://tc39.es/ecma262/#sec-symbol.replace defineWellKnownSymbol$d('replace'); var defineWellKnownSymbol$c = defineWellKnownSymbol$l; // `Symbol.search` well-known symbol // https://tc39.es/ecma262/#sec-symbol.search defineWellKnownSymbol$c('search'); var defineWellKnownSymbol$b = defineWellKnownSymbol$l; // `Symbol.species` well-known symbol // https://tc39.es/ecma262/#sec-symbol.species defineWellKnownSymbol$b('species'); var defineWellKnownSymbol$a = defineWellKnownSymbol$l; // `Symbol.split` well-known symbol // https://tc39.es/ecma262/#sec-symbol.split defineWellKnownSymbol$a('split'); var defineWellKnownSymbol$9 = defineWellKnownSymbol$l; // `Symbol.toPrimitive` well-known symbol // https://tc39.es/ecma262/#sec-symbol.toprimitive defineWellKnownSymbol$9('toPrimitive'); var defineWellKnownSymbol$8 = defineWellKnownSymbol$l; // `Symbol.toStringTag` well-known symbol // https://tc39.es/ecma262/#sec-symbol.tostringtag defineWellKnownSymbol$8('toStringTag'); var defineWellKnownSymbol$7 = defineWellKnownSymbol$l; // `Symbol.unscopables` well-known symbol // https://tc39.es/ecma262/#sec-symbol.unscopables defineWellKnownSymbol$7('unscopables'); var fails$Z = fails$15; var correctPrototypeGetter = !fails$Z(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$d = hasOwnProperty_1; var isCallable$l = isCallable$z; var toObject$v = toObject$z; var sharedKey = sharedKey$4; var CORRECT_PROTOTYPE_GETTER$2 = correctPrototypeGetter; var IE_PROTO = sharedKey('IE_PROTO'); var ObjectPrototype$2 = Object.prototype; // `Object.getPrototypeOf` method // https://tc39.es/ecma262/#sec-object.getprototypeof // eslint-disable-next-line es/no-object-getprototypeof -- safe var objectGetPrototypeOf$1 = CORRECT_PROTOTYPE_GETTER$2 ? Object.getPrototypeOf : function (O) { var object = toObject$v(O); if (hasOwn$d(object, IE_PROTO)) return object[IE_PROTO]; var constructor = object.constructor; if (isCallable$l(constructor) && object instanceof constructor) { return constructor.prototype; } return object instanceof Object ? ObjectPrototype$2 : null; }; var isCallable$k = isCallable$z; var aPossiblePrototype$2 = function (argument) { if (typeof argument === 'object' || isCallable$k(argument)) return argument; throw TypeError("Can't set " + String(argument) + ' as a prototype'); }; /* eslint-disable no-proto -- safe */ var anObject$1w = anObject$1C; 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 { // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set; setter.call(test, []); CORRECT_SETTER = test instanceof Array; } catch (error) { /* empty */ } return function setPrototypeOf(O, proto) { anObject$1w(O); aPossiblePrototype$1(proto); if (CORRECT_SETTER) setter.call(O, proto); else O.__proto__ = proto; return O; }; }() : undefined); var isObject$t = isObject$C; var createNonEnumerableProperty$d = createNonEnumerableProperty$h; // `InstallErrorCause` abstract operation // https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause var installErrorCause$1 = function (O, options) { if (isObject$t(options) && 'cause' in options) { createNonEnumerableProperty$d(O, 'cause', options.cause); } }; var iterators = {}; var wellKnownSymbol$y = wellKnownSymbol$G; var Iterators$4 = iterators; var ITERATOR$a = wellKnownSymbol$y('iterator'); var ArrayPrototype$2 = Array.prototype; // check on default Array iterator var isArrayIteratorMethod$3 = function (it) { return it !== undefined && (Iterators$4.Array === it || ArrayPrototype$2[ITERATOR$a] === it); }; var classof$8 = classof$b; var getMethod$f = getMethod$h; var Iterators$3 = iterators; var wellKnownSymbol$x = wellKnownSymbol$G; var ITERATOR$9 = wellKnownSymbol$x('iterator'); var getIteratorMethod$9 = function (it) { if (it != undefined) return getMethod$f(it, ITERATOR$9) || getMethod$f(it, '@@iterator') || Iterators$3[classof$8(it)]; }; var aCallable$N = aCallable$Q; var anObject$1v = anObject$1C; var getIteratorMethod$8 = getIteratorMethod$9; var getIterator$b = function (argument, usingIterator) { var iteratorMethod = arguments.length < 2 ? getIteratorMethod$8(argument) : usingIterator; if (aCallable$N(iteratorMethod)) return anObject$1v(iteratorMethod.call(argument)); throw TypeError(String(argument) + ' is not iterable'); }; var anObject$1u = anObject$1C; var getMethod$e = getMethod$h; var iteratorClose$4 = function (iterator, kind, value) { var innerResult, innerError; anObject$1u(iterator); try { innerResult = getMethod$e(iterator, 'return'); if (!innerResult) { if (kind === 'throw') throw value; return value; } innerResult = innerResult.call(iterator); } catch (error) { innerError = true; innerResult = error; } if (kind === 'throw') throw value; if (innerError) throw innerResult; anObject$1u(innerResult); return value; }; var anObject$1t = anObject$1C; var isArrayIteratorMethod$2 = isArrayIteratorMethod$3; var lengthOfArrayLike$n = lengthOfArrayLike$q; var bind$p = functionBindContext; var getIterator$a = getIterator$b; var getIteratorMethod$7 = getIteratorMethod$9; var iteratorClose$3 = iteratorClose$4; var Result = function (stopped, result) { this.stopped = stopped; this.result = result; }; var iterate$I = function (iterable, unboundFunction, options) { var that = options && options.that; var AS_ENTRIES = !!(options && options.AS_ENTRIES); var IS_ITERATOR = !!(options && options.IS_ITERATOR); var INTERRUPTED = !!(options && options.INTERRUPTED); var fn = bind$p(unboundFunction, that, 1 + AS_ENTRIES + INTERRUPTED); var iterator, iterFn, index, length, result, next, step; var stop = function (condition) { if (iterator) iteratorClose$3(iterator, 'normal', condition); return new Result(true, condition); }; var callFn = function (value) { if (AS_ENTRIES) { anObject$1t(value); return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]); } return INTERRUPTED ? fn(value, stop) : fn(value); }; if (IS_ITERATOR) { iterator = iterable; } else { iterFn = getIteratorMethod$7(iterable); if (!iterFn) throw TypeError(String(iterable) + ' is not iterable'); // optimisation for array iterators if (isArrayIteratorMethod$2(iterFn)) { for (index = 0, length = lengthOfArrayLike$n(iterable); length > index; index++) { result = callFn(iterable[index]); if (result && result instanceof Result) return result; } return new Result(false); } iterator = getIterator$a(iterable, iterFn); } next = iterator.next; while (!(step = next.call(iterator)).done) { try { result = callFn(step.value); } catch (error) { iteratorClose$3(iterator, 'throw', error); } if (typeof result == 'object' && result && result instanceof Result) return result; } return new Result(false); }; var $$4g = _export; var getPrototypeOf$d = objectGetPrototypeOf$1; var setPrototypeOf$7 = objectSetPrototypeOf$1; var copyConstructorProperties = copyConstructorProperties$3; var create$d = objectCreate$1; var createNonEnumerableProperty$c = createNonEnumerableProperty$h; var createPropertyDescriptor$5 = createPropertyDescriptor$9; var installErrorCause = installErrorCause$1; var iterate$H = iterate$I; var toString$r = toString$t; var $AggregateError = function AggregateError(errors, message /* , options */) { var that = this; var options = arguments.length > 2 ? arguments[2] : undefined; if (!(that instanceof $AggregateError)) return new $AggregateError(errors, message, options); if (setPrototypeOf$7) { // eslint-disable-next-line unicorn/error-message -- expected that = setPrototypeOf$7(new Error(undefined), getPrototypeOf$d(that)); } if (message !== undefined) createNonEnumerableProperty$c(that, 'message', toString$r(message)); installErrorCause(that, options); var errorsArray = []; iterate$H(errors, errorsArray.push, { that: errorsArray }); createNonEnumerableProperty$c(that, 'errors', errorsArray); return that; }; if (setPrototypeOf$7) setPrototypeOf$7($AggregateError, Error); else copyConstructorProperties($AggregateError, Error); $AggregateError.prototype = create$d(Error.prototype, { constructor: createPropertyDescriptor$5(1, $AggregateError), message: createPropertyDescriptor$5(1, ''), name: createPropertyDescriptor$5(1, 'AggregateError') }); // `AggregateError` constructor // https://tc39.es/ecma262/#sec-aggregate-error-constructor $$4g({ global: true }, { AggregateError: $AggregateError }); var wellKnownSymbol$w = wellKnownSymbol$G; var create$c = objectCreate$1; var definePropertyModule$8 = objectDefineProperty; var UNSCOPABLES = wellKnownSymbol$w('unscopables'); var ArrayPrototype$1 = Array.prototype; // Array.prototype[@@unscopables] // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables if (ArrayPrototype$1[UNSCOPABLES] == undefined) { definePropertyModule$8.f(ArrayPrototype$1, UNSCOPABLES, { configurable: true, value: create$c(null) }); } // add a key to Array.prototype[@@unscopables] var addToUnscopables$h = function (key) { ArrayPrototype$1[UNSCOPABLES][key] = true; }; var $$4f = _export; var toObject$u = toObject$z; var lengthOfArrayLike$m = lengthOfArrayLike$q; var toIntegerOrInfinity$f = toIntegerOrInfinity$i; var addToUnscopables$g = addToUnscopables$h; // `Array.prototype.at` method // https://github.com/tc39/proposal-relative-indexing-method $$4f({ target: 'Array', proto: true }, { at: function at(index) { var O = toObject$u(this); var len = lengthOfArrayLike$m(O); var relativeIndex = toIntegerOrInfinity$f(index); var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex; return (k < 0 || k >= len) ? undefined : O[k]; } }); addToUnscopables$g('at'); var toPropertyKey$5 = toPropertyKey$9; var definePropertyModule$7 = objectDefineProperty; var createPropertyDescriptor$4 = createPropertyDescriptor$9; var createProperty$7 = function (object, key, value) { var propertyKey = toPropertyKey$5(key); if (propertyKey in object) definePropertyModule$7.f(object, propertyKey, createPropertyDescriptor$4(0, value)); else object[propertyKey] = value; }; var fails$Y = fails$15; var wellKnownSymbol$v = wellKnownSymbol$G; var V8_VERSION$2 = engineV8Version; var SPECIES$5 = wellKnownSymbol$v('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$Y(function () { var array = []; var constructor = array.constructor = {}; constructor[SPECIES$5] = function () { return { foo: 1 }; }; return array[METHOD_NAME](Boolean).foo !== 1; }); }; var $$4e = _export; var fails$X = fails$15; var isArray$5 = isArray$8; var isObject$s = isObject$C; var toObject$t = toObject$z; var lengthOfArrayLike$l = lengthOfArrayLike$q; var createProperty$6 = createProperty$7; var arraySpeciesCreate$4 = arraySpeciesCreate$6; var arrayMethodHasSpeciesSupport$4 = arrayMethodHasSpeciesSupport$5; var wellKnownSymbol$u = wellKnownSymbol$G; var V8_VERSION$1 = engineV8Version; var IS_CONCAT_SPREADABLE = wellKnownSymbol$u('isConcatSpreadable'); var MAX_SAFE_INTEGER$2 = 0x1FFFFFFFFFFFFF; var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded'; // 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$X(function () { var array = []; array[IS_CONCAT_SPREADABLE] = false; return array.concat()[0] !== array; }); var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport$4('concat'); var isConcatSpreadable = function (O) { if (!isObject$s(O)) return false; var spreadable = O[IS_CONCAT_SPREADABLE]; return spreadable !== undefined ? !!spreadable : isArray$5(O); }; var FORCED$u = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT; // `Array.prototype.concat` method // https://tc39.es/ecma262/#sec-array.prototype.concat // with adding support of @@isConcatSpreadable and @@species $$4e({ target: 'Array', proto: true, forced: FORCED$u }, { // eslint-disable-next-line no-unused-vars -- required for `.length` concat: function concat(arg) { var O = toObject$t(this); var A = arraySpeciesCreate$4(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$l(E); if (n + len > MAX_SAFE_INTEGER$2) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); for (k = 0; k < len; k++, n++) if (k in E) createProperty$6(A, n, E[k]); } else { if (n >= MAX_SAFE_INTEGER$2) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); createProperty$6(A, n++, E); } } A.length = n; return A; } }); var toObject$s = toObject$z; var toAbsoluteIndex$6 = toAbsoluteIndex$8; var lengthOfArrayLike$k = lengthOfArrayLike$q; var min$8 = 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$s(this); var len = lengthOfArrayLike$k(O); var to = toAbsoluteIndex$6(target, len); var from = toAbsoluteIndex$6(start, len); var end = arguments.length > 2 ? arguments[2] : undefined; var count = min$8((end === undefined ? len : toAbsoluteIndex$6(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 delete O[to]; to += inc; from += inc; } return O; }; var $$4d = _export; var copyWithin = arrayCopyWithin; var addToUnscopables$f = addToUnscopables$h; // `Array.prototype.copyWithin` method // https://tc39.es/ecma262/#sec-array.prototype.copywithin $$4d({ target: 'Array', proto: true }, { copyWithin: copyWithin }); // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables$f('copyWithin'); var fails$W = fails$15; var arrayMethodIsStrict$9 = function (METHOD_NAME, argument) { var method = [][METHOD_NAME]; return !!method && fails$W(function () { // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing method.call(null, argument || function () { throw 1; }, 1); }); }; var $$4c = _export; var $every$2 = arrayIteration.every; var arrayMethodIsStrict$8 = arrayMethodIsStrict$9; var STRICT_METHOD$8 = arrayMethodIsStrict$8('every'); // `Array.prototype.every` method // https://tc39.es/ecma262/#sec-array.prototype.every $$4c({ target: 'Array', proto: true, forced: !STRICT_METHOD$8 }, { every: function every(callbackfn /* , thisArg */) { return $every$2(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); var toObject$r = toObject$z; var toAbsoluteIndex$5 = toAbsoluteIndex$8; var lengthOfArrayLike$j = lengthOfArrayLike$q; // `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$r(this); var length = lengthOfArrayLike$j(O); var argumentsLength = arguments.length; var index = toAbsoluteIndex$5(argumentsLength > 1 ? arguments[1] : undefined, length); var end = argumentsLength > 2 ? arguments[2] : undefined; var endPos = end === undefined ? length : toAbsoluteIndex$5(end, length); while (endPos > index) O[index++] = value; return O; }; var $$4b = _export; var fill = arrayFill$1; var addToUnscopables$e = addToUnscopables$h; // `Array.prototype.fill` method // https://tc39.es/ecma262/#sec-array.prototype.fill $$4b({ target: 'Array', proto: true }, { fill: fill }); // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables$e('fill'); var $$4a = _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 $$4a({ 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 $$49 = _export; var $find$2 = arrayIteration.find; var addToUnscopables$d = addToUnscopables$h; var FIND = 'find'; var SKIPS_HOLES$1 = true; // Shouldn't skip holes if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES$1 = false; }); // `Array.prototype.find` method // https://tc39.es/ecma262/#sec-array.prototype.find $$49({ 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$d(FIND); var $$48 = _export; var $findIndex$1 = arrayIteration.findIndex; var addToUnscopables$c = addToUnscopables$h; var FIND_INDEX = 'findIndex'; var SKIPS_HOLES = true; // Shouldn't skip holes if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES = false; }); // `Array.prototype.findIndex` method // https://tc39.es/ecma262/#sec-array.prototype.findindex $$48({ 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$c(FIND_INDEX); var isArray$4 = isArray$8; var lengthOfArrayLike$i = lengthOfArrayLike$q; var bind$o = 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$o(mapper, thisArg, 3) : false; var element, elementLen; while (sourceIndex < sourceLen) { if (sourceIndex in source) { element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; if (depth > 0 && isArray$4(element)) { elementLen = lengthOfArrayLike$i(element); targetIndex = flattenIntoArray$2(target, original, element, elementLen, targetIndex, depth - 1) - 1; } else { if (targetIndex >= 0x1FFFFFFFFFFFFF) throw TypeError('Exceed the acceptable array length'); target[targetIndex] = element; } targetIndex++; } sourceIndex++; } return targetIndex; }; var flattenIntoArray_1 = flattenIntoArray$2; var $$47 = _export; var flattenIntoArray$1 = flattenIntoArray_1; var toObject$q = toObject$z; var lengthOfArrayLike$h = lengthOfArrayLike$q; var toIntegerOrInfinity$e = toIntegerOrInfinity$i; var arraySpeciesCreate$3 = arraySpeciesCreate$6; // `Array.prototype.flat` method // https://tc39.es/ecma262/#sec-array.prototype.flat $$47({ target: 'Array', proto: true }, { flat: function flat(/* depthArg = 1 */) { var depthArg = arguments.length ? arguments[0] : undefined; var O = toObject$q(this); var sourceLen = lengthOfArrayLike$h(O); var A = arraySpeciesCreate$3(O, 0); A.length = flattenIntoArray$1(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toIntegerOrInfinity$e(depthArg)); return A; } }); var $$46 = _export; var flattenIntoArray = flattenIntoArray_1; var aCallable$M = aCallable$Q; var toObject$p = toObject$z; var lengthOfArrayLike$g = lengthOfArrayLike$q; var arraySpeciesCreate$2 = arraySpeciesCreate$6; // `Array.prototype.flatMap` method // https://tc39.es/ecma262/#sec-array.prototype.flatmap $$46({ target: 'Array', proto: true }, { flatMap: function flatMap(callbackfn /* , thisArg */) { var O = toObject$p(this); var sourceLen = lengthOfArrayLike$g(O); var A; aCallable$M(callbackfn); A = arraySpeciesCreate$2(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$7 = arrayMethodIsStrict$9; var STRICT_METHOD$7 = arrayMethodIsStrict$7('forEach'); // `Array.prototype.forEach` method implementation // https://tc39.es/ecma262/#sec-array.prototype.foreach var arrayForEach = !STRICT_METHOD$7 ? 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 $$45 = _export; var forEach$2 = arrayForEach; // `Array.prototype.forEach` method // https://tc39.es/ecma262/#sec-array.prototype.foreach // eslint-disable-next-line es/no-array-prototype-foreach -- safe $$45({ target: 'Array', proto: true, forced: [].forEach != forEach$2 }, { forEach: forEach$2 }); var anObject$1s = anObject$1C; var iteratorClose$2 = iteratorClose$4; // call something on iterator step with safe closing on error var callWithSafeIterationClosing$3 = function (iterator, fn, value, ENTRIES) { try { return ENTRIES ? fn(anObject$1s(value)[0], value[1]) : fn(value); } catch (error) { iteratorClose$2(iterator, 'throw', error); } }; var bind$n = functionBindContext; var toObject$o = toObject$z; var callWithSafeIterationClosing$2 = callWithSafeIterationClosing$3; var isArrayIteratorMethod$1 = isArrayIteratorMethod$3; var isConstructor$5 = isConstructor$7; var lengthOfArrayLike$f = lengthOfArrayLike$q; var createProperty$5 = createProperty$7; var getIterator$9 = getIterator$b; var getIteratorMethod$6 = getIteratorMethod$9; // `Array.from` method implementation // https://tc39.es/ecma262/#sec-array.from var arrayFrom$1 = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { var O = toObject$o(arrayLike); var IS_CONSTRUCTOR = isConstructor$5(this); var argumentsLength = arguments.length; var mapfn = argumentsLength > 1 ? arguments[1] : undefined; var mapping = mapfn !== undefined; if (mapping) mapfn = bind$n(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2); var iteratorMethod = getIteratorMethod$6(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 && isArrayIteratorMethod$1(iteratorMethod))) { iterator = getIterator$9(O, iteratorMethod); next = iterator.next; result = IS_CONSTRUCTOR ? new this() : []; for (;!(step = next.call(iterator)).done; index++) { value = mapping ? callWithSafeIterationClosing$2(iterator, mapfn, [step.value, index], true) : step.value; createProperty$5(result, index, value); } } else { length = lengthOfArrayLike$f(O); result = IS_CONSTRUCTOR ? new this(length) : Array(length); for (;length > index; index++) { value = mapping ? mapfn(O[index], index) : O[index]; createProperty$5(result, index, value); } } result.length = index; return result; }; var wellKnownSymbol$t = wellKnownSymbol$G; var ITERATOR$8 = wellKnownSymbol$t('iterator'); var SAFE_CLOSING = false; try { var called = 0; var iteratorWithReturn = { next: function () { return { done: !!called++ }; }, 'return': function () { SAFE_CLOSING = true; } }; iteratorWithReturn[ITERATOR$8] = 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) { if (!SKIP_CLOSING && !SAFE_CLOSING) return false; var ITERATION_SUPPORT = false; try { var object = {}; object[ITERATOR$8] = function () { return { next: function () { return { done: ITERATION_SUPPORT = true }; } }; }; exec(object); } catch (error) { /* empty */ } return ITERATION_SUPPORT; }; var $$44 = _export; var from$5 = arrayFrom$1; var checkCorrectnessOfIteration$3 = checkCorrectnessOfIteration$4; var INCORRECT_ITERATION$1 = !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 $$44({ target: 'Array', stat: true, forced: INCORRECT_ITERATION$1 }, { from: from$5 }); var $$43 = _export; var $includes$1 = arrayIncludes.includes; var addToUnscopables$b = addToUnscopables$h; // `Array.prototype.includes` method // https://tc39.es/ecma262/#sec-array.prototype.includes $$43({ target: 'Array', proto: true }, { 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$b('includes'); /* eslint-disable es/no-array-prototype-indexof -- required for testing */ var $$42 = _export; var $indexOf$1 = arrayIncludes.indexOf; var arrayMethodIsStrict$6 = arrayMethodIsStrict$9; var nativeIndexOf = [].indexOf; var NEGATIVE_ZERO$1 = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0; var STRICT_METHOD$6 = arrayMethodIsStrict$6('indexOf'); // `Array.prototype.indexOf` method // https://tc39.es/ecma262/#sec-array.prototype.indexof $$42({ target: 'Array', proto: true, forced: NEGATIVE_ZERO$1 || !STRICT_METHOD$6 }, { indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { return NEGATIVE_ZERO$1 // convert -0 to +0 ? nativeIndexOf.apply(this, arguments) || 0 : $indexOf$1(this, searchElement, arguments.length > 1 ? arguments[1] : undefined); } }); var $$41 = _export; var isArray$3 = isArray$8; // `Array.isArray` method // https://tc39.es/ecma262/#sec-array.isarray $$41({ target: 'Array', stat: true }, { isArray: isArray$3 }); var fails$V = fails$15; var isCallable$j = isCallable$z; var getPrototypeOf$c = objectGetPrototypeOf$1; var redefine$i = redefine$l.exports; var wellKnownSymbol$s = wellKnownSymbol$G; var ITERATOR$7 = wellKnownSymbol$s('iterator'); var BUGGY_SAFARI_ITERATORS$1 = false; // `%IteratorPrototype%` object // https://tc39.es/ecma262/#sec-%iteratorprototype%-object var IteratorPrototype$5, 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$c(getPrototypeOf$c(arrayIterator$1)); if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$5 = PrototypeOfArrayIteratorPrototype; } } var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$5 == undefined || fails$V(function () { var test = {}; // FF44- legacy iterators case return IteratorPrototype$5[ITERATOR$7].call(test) !== test; }); if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$5 = {}; // `%IteratorPrototype%[@@iterator]()` method // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator if (!isCallable$j(IteratorPrototype$5[ITERATOR$7])) { redefine$i(IteratorPrototype$5, ITERATOR$7, function () { return this; }); } var iteratorsCore = { IteratorPrototype: IteratorPrototype$5, BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1 }; var IteratorPrototype$4 = iteratorsCore.IteratorPrototype; var create$b = objectCreate$1; var createPropertyDescriptor$3 = createPropertyDescriptor$9; var setToStringTag$9 = setToStringTag$b; var Iterators$2 = iterators; var returnThis$1 = function () { return this; }; var createIteratorConstructor$7 = function (IteratorConstructor, NAME, next) { var TO_STRING_TAG = NAME + ' Iterator'; IteratorConstructor.prototype = create$b(IteratorPrototype$4, { next: createPropertyDescriptor$3(1, next) }); setToStringTag$9(IteratorConstructor, TO_STRING_TAG, false); Iterators$2[TO_STRING_TAG] = returnThis$1; return IteratorConstructor; }; var $$40 = _export; var FunctionName$1 = functionName; var isCallable$i = isCallable$z; var createIteratorConstructor$6 = createIteratorConstructor$7; var getPrototypeOf$b = objectGetPrototypeOf$1; var setPrototypeOf$6 = objectSetPrototypeOf$1; var setToStringTag$8 = setToStringTag$b; var createNonEnumerableProperty$b = createNonEnumerableProperty$h; var redefine$h = redefine$l.exports; var wellKnownSymbol$r = wellKnownSymbol$G; var Iterators$1 = iterators; var IteratorsCore = iteratorsCore; var PROPER_FUNCTION_NAME$4 = FunctionName$1.PROPER; var CONFIGURABLE_FUNCTION_NAME$1 = FunctionName$1.CONFIGURABLE; var IteratorPrototype$3 = IteratorsCore.IteratorPrototype; var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; var ITERATOR$6 = wellKnownSymbol$r('iterator'); var KEYS = 'keys'; var VALUES = 'values'; var ENTRIES = 'entries'; var returnThis = function () { return this; }; var defineIterator$3 = 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 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$6] || 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$b(anyNativeIterator.call(new Iterable())); if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { if (getPrototypeOf$b(CurrentIteratorPrototype) !== IteratorPrototype$3) { if (setPrototypeOf$6) { setPrototypeOf$6(CurrentIteratorPrototype, IteratorPrototype$3); } else if (!isCallable$i(CurrentIteratorPrototype[ITERATOR$6])) { redefine$h(CurrentIteratorPrototype, ITERATOR$6, returnThis); } } // Set @@toStringTag to native iterators setToStringTag$8(CurrentIteratorPrototype, TO_STRING_TAG, true); } } // fix Array.prototype.{ values, @@iterator }.name in V8 / FF if (PROPER_FUNCTION_NAME$4 && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { if (CONFIGURABLE_FUNCTION_NAME$1) { createNonEnumerableProperty$b(IterablePrototype, 'name', VALUES); } else { INCORRECT_VALUES_NAME = true; defaultIterator = function values() { return nativeIterator.call(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)) { redefine$h(IterablePrototype, KEY, methods[KEY]); } } else $$40({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); } // define iterator if (IterablePrototype[ITERATOR$6] !== defaultIterator) { redefine$h(IterablePrototype, ITERATOR$6, defaultIterator, { name: DEFAULT }); } Iterators$1[NAME] = defaultIterator; return methods; }; var toIndexedObject$7 = toIndexedObject$d; var addToUnscopables$a = addToUnscopables$h; var Iterators = iterators; var InternalStateModule$h = internalState; var defineIterator$2 = defineIterator$3; var ARRAY_ITERATOR = 'Array Iterator'; var setInternalState$h = InternalStateModule$h.set; var getInternalState$g = InternalStateModule$h.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$h(this, { type: ARRAY_ITERATOR, target: toIndexedObject$7(iterated), // target index: 0, // next index kind: kind // kind }); // `%ArrayIteratorPrototype%.next` method // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next }, function () { var state = getInternalState$g(this); var target = state.target; var kind = state.kind; var index = state.index++; if (!target || index >= target.length) { state.target = undefined; return { value: undefined, done: true }; } if (kind == 'keys') return { value: index, done: false }; if (kind == 'values') return { value: target[index], done: false }; return { value: [index, target[index]], done: false }; }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% // https://tc39.es/ecma262/#sec-createunmappedargumentsobject // https://tc39.es/ecma262/#sec-createmappedargumentsobject Iterators.Arguments = Iterators.Array; // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables$a('keys'); addToUnscopables$a('values'); addToUnscopables$a('entries'); var $$3$ = _export; var IndexedObject$4 = indexedObject; var toIndexedObject$6 = toIndexedObject$d; var arrayMethodIsStrict$5 = arrayMethodIsStrict$9; var nativeJoin = [].join; var ES3_STRINGS = IndexedObject$4 != Object; var STRICT_METHOD$5 = arrayMethodIsStrict$5('join', ','); // `Array.prototype.join` method // https://tc39.es/ecma262/#sec-array.prototype.join $$3$({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD$5 }, { join: function join(separator) { return nativeJoin.call(toIndexedObject$6(this), separator === undefined ? ',' : separator); } }); /* eslint-disable es/no-array-prototype-lastindexof -- safe */ var toIndexedObject$5 = toIndexedObject$d; var toIntegerOrInfinity$d = toIntegerOrInfinity$i; var lengthOfArrayLike$e = lengthOfArrayLike$q; var arrayMethodIsStrict$4 = arrayMethodIsStrict$9; var min$7 = Math.min; var $lastIndexOf$1 = [].lastIndexOf; var NEGATIVE_ZERO = !!$lastIndexOf$1 && 1 / [1].lastIndexOf(1, -0) < 0; var STRICT_METHOD$4 = arrayMethodIsStrict$4('lastIndexOf'); var FORCED$t = NEGATIVE_ZERO || !STRICT_METHOD$4; // `Array.prototype.lastIndexOf` method implementation // https://tc39.es/ecma262/#sec-array.prototype.lastindexof var arrayLastIndexOf = FORCED$t ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { // convert -0 to +0 if (NEGATIVE_ZERO) return $lastIndexOf$1.apply(this, arguments) || 0; var O = toIndexedObject$5(this); var length = lengthOfArrayLike$e(O); var index = length - 1; if (arguments.length > 1) index = min$7(index, toIntegerOrInfinity$d(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 $$3_ = _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 $$3_({ target: 'Array', proto: true, forced: lastIndexOf !== [].lastIndexOf }, { lastIndexOf: lastIndexOf }); var $$3Z = _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 $$3Z({ 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 $$3Y = _export; var fails$U = fails$15; var isConstructor$4 = isConstructor$7; var createProperty$4 = createProperty$7; var ISNT_GENERIC = fails$U(function () { function F() { /* empty */ } // eslint-disable-next-line es/no-array-of -- required for testing return !(Array.of.call(F) instanceof F); }); // `Array.of` method // https://tc39.es/ecma262/#sec-array.of // WebKit Array.of isn't generic $$3Y({ target: 'Array', stat: true, forced: ISNT_GENERIC }, { of: function of(/* ...args */) { var index = 0; var argumentsLength = arguments.length; var result = new (isConstructor$4(this) ? this : Array)(argumentsLength); while (argumentsLength > index) createProperty$4(result, index, arguments[index++]); result.length = argumentsLength; return result; } }); var aCallable$L = aCallable$Q; var toObject$n = toObject$z; var IndexedObject$3 = indexedObject; var lengthOfArrayLike$d = lengthOfArrayLike$q; // `Array.prototype.{ reduce, reduceRight }` methods implementation var createMethod$6 = function (IS_RIGHT) { return function (that, callbackfn, argumentsLength, memo) { aCallable$L(callbackfn); var O = toObject$n(that); var self = IndexedObject$3(O); var length = lengthOfArrayLike$d(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('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$6(false), // `Array.prototype.reduceRight` method // https://tc39.es/ecma262/#sec-array.prototype.reduceright right: createMethod$6(true) }; var classof$7 = classofRaw$1; var global$D = global$R; var engineIsNode = classof$7(global$D.process) == 'process'; var $$3X = _export; var $reduce$1 = arrayReduce.left; var arrayMethodIsStrict$3 = arrayMethodIsStrict$9; var CHROME_VERSION$1 = engineV8Version; var IS_NODE$5 = engineIsNode; var STRICT_METHOD$3 = arrayMethodIsStrict$3('reduce'); // Chrome 80-82 has a critical bug // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982 var CHROME_BUG$1 = !IS_NODE$5 && CHROME_VERSION$1 > 79 && CHROME_VERSION$1 < 83; // `Array.prototype.reduce` method // https://tc39.es/ecma262/#sec-array.prototype.reduce $$3X({ target: 'Array', proto: true, forced: !STRICT_METHOD$3 || CHROME_BUG$1 }, { reduce: function reduce(callbackfn /* , initialValue */) { return $reduce$1(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); } }); var $$3W = _export; var $reduceRight$1 = arrayReduce.right; var arrayMethodIsStrict$2 = arrayMethodIsStrict$9; var CHROME_VERSION = engineV8Version; var IS_NODE$4 = engineIsNode; var STRICT_METHOD$2 = arrayMethodIsStrict$2('reduceRight'); // Chrome 80-82 has a critical bug // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982 var CHROME_BUG = !IS_NODE$4 && CHROME_VERSION > 79 && CHROME_VERSION < 83; // `Array.prototype.reduceRight` method // https://tc39.es/ecma262/#sec-array.prototype.reduceright $$3W({ target: 'Array', proto: true, forced: !STRICT_METHOD$2 || CHROME_BUG }, { reduceRight: function reduceRight(callbackfn /* , initialValue */) { return $reduceRight$1(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); } }); var $$3V = _export; var isArray$2 = isArray$8; var nativeReverse = [].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 $$3V({ 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$2(this)) this.length = this.length; return nativeReverse.call(this); } }); var $$3U = _export; var isArray$1 = isArray$8; var isConstructor$3 = isConstructor$7; var isObject$r = isObject$C; var toAbsoluteIndex$4 = toAbsoluteIndex$8; var lengthOfArrayLike$c = lengthOfArrayLike$q; var toIndexedObject$4 = toIndexedObject$d; var createProperty$3 = createProperty$7; var wellKnownSymbol$q = wellKnownSymbol$G; var arrayMethodHasSpeciesSupport$1 = arrayMethodHasSpeciesSupport$5; var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport$1('slice'); var SPECIES$4 = wellKnownSymbol$q('species'); var nativeSlice = [].slice; var max$5 = Math.max; // `Array.prototype.slice` method // https://tc39.es/ecma262/#sec-array.prototype.slice // fallback for not array-like ES3 strings and DOM objects $$3U({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, { slice: function slice(start, end) { var O = toIndexedObject$4(this); var length = lengthOfArrayLike$c(O); var k = toAbsoluteIndex$4(start, length); var fin = toAbsoluteIndex$4(end === undefined ? length : end, length); // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible var Constructor, result, n; if (isArray$1(O)) { Constructor = O.constructor; // cross-realm fallback if (isConstructor$3(Constructor) && (Constructor === Array || isArray$1(Constructor.prototype))) { Constructor = undefined; } else if (isObject$r(Constructor)) { Constructor = Constructor[SPECIES$4]; if (Constructor === null) Constructor = undefined; } if (Constructor === Array || Constructor === undefined) { return nativeSlice.call(O, k, fin); } } result = new (Constructor === undefined ? Array : Constructor)(max$5(fin - k, 0)); for (n = 0; k < fin; k++, n++) if (k in O) createProperty$3(result, n, O[k]); result.length = n; return result; } }); var $$3T = _export; var $some$2 = arrayIteration.some; var arrayMethodIsStrict$1 = arrayMethodIsStrict$9; var STRICT_METHOD$1 = arrayMethodIsStrict$1('some'); // `Array.prototype.some` method // https://tc39.es/ecma262/#sec-array.prototype.some $$3T({ target: 'Array', proto: true, forced: !STRICT_METHOD$1 }, { some: function some(callbackfn /* , thisArg */) { return $some$2(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); // TODO: use something more complex like timsort? 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( mergeSort(array.slice(0, middle), comparefn), mergeSort(array.slice(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 (left, right, comparefn) { var llength = left.length; var rlength = right.length; var lindex = 0; var rindex = 0; var result = []; while (lindex < llength || rindex < rlength) { if (lindex < llength && rindex < rlength) { result.push(comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]); } else { result.push(lindex < llength ? left[lindex++] : right[rindex++]); } } return result; }; var arraySort = mergeSort; var userAgent$6 = engineUserAgent; var firefox = userAgent$6.match(/firefox\/(\d+)/i); var engineFfVersion = !!firefox && +firefox[1]; var UA = engineUserAgent; var engineIsIeOrEdge = /MSIE|Trident/.test(UA); var userAgent$5 = engineUserAgent; var webkit = userAgent$5.match(/AppleWebKit\/(\d+)\./); var engineWebkitVersion = !!webkit && +webkit[1]; var $$3S = _export; var aCallable$K = aCallable$Q; var toObject$m = toObject$z; var lengthOfArrayLike$b = lengthOfArrayLike$q; var toString$q = toString$t; var fails$T = fails$15; var internalSort$1 = arraySort; var arrayMethodIsStrict = arrayMethodIsStrict$9; var FF$1 = engineFfVersion; var IE_OR_EDGE$1 = engineIsIeOrEdge; var V8$1 = engineV8Version; var WEBKIT$2 = engineWebkitVersion; var test = []; var nativeSort$1 = test.sort; // IE8- var FAILS_ON_UNDEFINED = fails$T(function () { test.sort(undefined); }); // V8 bug var FAILS_ON_NULL = fails$T(function () { test.sort(null); }); // Old WebKit var STRICT_METHOD = arrayMethodIsStrict('sort'); var STABLE_SORT$1 = !fails$T(function () { // feature detection can be too slow, so check engines versions if (V8$1) return V8$1 < 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$s = 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$q(x) > toString$q(y) ? 1 : -1; }; }; // `Array.prototype.sort` method // https://tc39.es/ecma262/#sec-array.prototype.sort $$3S({ target: 'Array', proto: true, forced: FORCED$s }, { sort: function sort(comparefn) { if (comparefn !== undefined) aCallable$K(comparefn); var array = toObject$m(this); if (STABLE_SORT$1) return comparefn === undefined ? nativeSort$1.call(array) : nativeSort$1.call(array, comparefn); var items = []; var arrayLength = lengthOfArrayLike$b(array); var itemsLength, index; for (index = 0; index < arrayLength; index++) { if (index in array) items.push(array[index]); } items = internalSort$1(items, getSortCompare$1(comparefn)); itemsLength = items.length; index = 0; while (index < itemsLength) array[index] = items[index++]; while (index < arrayLength) delete array[index++]; return array; } }); var getBuiltIn$r = getBuiltIn$y; var definePropertyModule$6 = objectDefineProperty; var wellKnownSymbol$p = wellKnownSymbol$G; var DESCRIPTORS$s = descriptors; var SPECIES$3 = wellKnownSymbol$p('species'); var setSpecies$7 = function (CONSTRUCTOR_NAME) { var Constructor = getBuiltIn$r(CONSTRUCTOR_NAME); var defineProperty = definePropertyModule$6.f; if (DESCRIPTORS$s && Constructor && !Constructor[SPECIES$3]) { defineProperty(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 $$3R = _export; var toAbsoluteIndex$3 = toAbsoluteIndex$8; var toIntegerOrInfinity$c = toIntegerOrInfinity$i; var lengthOfArrayLike$a = lengthOfArrayLike$q; var toObject$l = toObject$z; var arraySpeciesCreate$1 = arraySpeciesCreate$6; var createProperty$2 = createProperty$7; var arrayMethodHasSpeciesSupport = arrayMethodHasSpeciesSupport$5; var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice'); var max$4 = Math.max; var min$6 = Math.min; var MAX_SAFE_INTEGER$1 = 0x1FFFFFFFFFFFFF; var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded'; // `Array.prototype.splice` method // https://tc39.es/ecma262/#sec-array.prototype.splice // with adding support of @@species $$3R({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { splice: function splice(start, deleteCount /* , ...items */) { var O = toObject$l(this); var len = lengthOfArrayLike$a(O); var actualStart = toAbsoluteIndex$3(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$6(max$4(toIntegerOrInfinity$c(deleteCount), 0), len - actualStart); } if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER$1) { throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED); } A = arraySpeciesCreate$1(O, actualDeleteCount); for (k = 0; k < actualDeleteCount; k++) { from = actualStart + k; if (from in O) createProperty$2(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 delete O[to]; } for (k = len; k > len - actualDeleteCount + insertCount; k--) delete 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 delete O[to]; } } for (k = 0; k < insertCount; k++) { O[k + actualStart] = arguments[k + 2]; } O.length = len - actualDeleteCount + insertCount; return A; } }); // this method was added to unscopables after implementation // in popular engines, so it's moved to a separate module var addToUnscopables$9 = addToUnscopables$h; // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables$9('flat'); // this method was added to unscopables after implementation // in popular engines, so it's moved to a separate module var addToUnscopables$8 = addToUnscopables$h; // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables addToUnscopables$8('flatMap'); // eslint-disable-next-line es/no-typed-arrays -- safe var arrayBufferNative = typeof ArrayBuffer !== 'undefined' && typeof DataView !== 'undefined'; var redefine$g = redefine$l.exports; var redefineAll$a = function (target, src, options) { for (var key in src) redefine$g(target, key, src[key], options); return target; }; var anInstance$b = function (it, Constructor, name) { if (it instanceof Constructor) return it; throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation'); }; var toIntegerOrInfinity$b = toIntegerOrInfinity$i; var toLength$b = toLength$d; // `ToIndex` abstract operation // https://tc39.es/ecma262/#sec-toindex var toIndex$2 = function (it) { if (it === undefined) return 0; var number = toIntegerOrInfinity$b(it); var length = toLength$b(number); if (number !== length) throw RangeError('Wrong length or index'); return length; }; // IEEE754 conversions based on https://github.com/feross/ieee754 var abs$7 = Math.abs; var pow$4 = Math.pow; var floor$8 = Math.floor; var log$8 = Math.log; var LN2$2 = Math.LN2; var pack = function (number, mantissaLength, bytes) { var buffer = new Array(bytes); var exponentLength = bytes * 8 - mantissaLength - 1; var eMax = (1 << exponentLength) - 1; var eBias = eMax >> 1; var rt = mantissaLength === 23 ? pow$4(2, -24) - pow$4(2, -77) : 0; var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0; var index = 0; var exponent, mantissa, c; number = abs$7(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); if (number * (c = pow$4(2, -exponent)) < 1) { exponent--; c *= 2; } if (exponent + eBias >= 1) { number += rt / c; } else { number += rt * pow$4(2, 1 - eBias); } if (number * c >= 2) { exponent++; c /= 2; } if (exponent + eBias >= eMax) { mantissa = 0; exponent = eMax; } else if (exponent + eBias >= 1) { mantissa = (number * c - 1) * pow$4(2, mantissaLength); exponent = exponent + eBias; } else { mantissa = number * pow$4(2, eBias - 1) * pow$4(2, mantissaLength); exponent = 0; } } for (; mantissaLength >= 8; buffer[index++] = mantissa & 255, mantissa /= 256, mantissaLength -= 8); exponent = exponent << mantissaLength | mantissa; exponentLength += mantissaLength; for (; exponentLength > 0; buffer[index++] = exponent & 255, exponent /= 256, exponentLength -= 8); buffer[--index] |= sign * 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 sign = buffer[index--]; var exponent = sign & 127; var mantissa; sign >>= 7; for (; nBits > 0; exponent = exponent * 256 + buffer[index], index--, nBits -= 8); mantissa = exponent & (1 << -nBits) - 1; exponent >>= -nBits; nBits += mantissaLength; for (; nBits > 0; mantissa = mantissa * 256 + buffer[index], index--, nBits -= 8); if (exponent === 0) { exponent = 1 - eBias; } else if (exponent === eMax) { return mantissa ? NaN : sign ? -Infinity : Infinity; } else { mantissa = mantissa + pow$4(2, mantissaLength); exponent = exponent - eBias; } return (sign ? -1 : 1) * mantissa * pow$4(2, exponent - mantissaLength); }; var ieee754 = { pack: pack, unpack: unpack }; var global$C = global$R; var DESCRIPTORS$r = descriptors; var NATIVE_ARRAY_BUFFER$2 = arrayBufferNative; var FunctionName = functionName; var createNonEnumerableProperty$a = createNonEnumerableProperty$h; var redefineAll$9 = redefineAll$a; var fails$S = fails$15; var anInstance$a = anInstance$b; var toIntegerOrInfinity$a = toIntegerOrInfinity$i; var toLength$a = toLength$d; var toIndex$1 = toIndex$2; var IEEE754 = ieee754; var getPrototypeOf$a = objectGetPrototypeOf$1; var setPrototypeOf$5 = objectSetPrototypeOf$1; var getOwnPropertyNames$4 = objectGetOwnPropertyNames.f; var defineProperty$c = objectDefineProperty.f; var arrayFill = arrayFill$1; var setToStringTag$7 = setToStringTag$b; var InternalStateModule$g = internalState; var PROPER_FUNCTION_NAME$3 = FunctionName.PROPER; var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE; var getInternalState$f = InternalStateModule$g.get; var setInternalState$g = InternalStateModule$g.set; var ARRAY_BUFFER$1 = 'ArrayBuffer'; var DATA_VIEW = 'DataView'; var PROTOTYPE = 'prototype'; var WRONG_LENGTH$1 = 'Wrong length'; var WRONG_INDEX = 'Wrong index'; var NativeArrayBuffer$1 = global$C[ARRAY_BUFFER$1]; var $ArrayBuffer = NativeArrayBuffer$1; var $DataView = global$C[DATA_VIEW]; var $DataViewPrototype = $DataView && $DataView[PROTOTYPE]; var ObjectPrototype$1 = Object.prototype; var RangeError$2 = global$C.RangeError; var packIEEE754 = IEEE754.pack; var unpackIEEE754 = IEEE754.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(number, 23, 4); }; var packFloat64 = function (number) { return packIEEE754(number, 52, 8); }; var addGetter$1 = function (Constructor, key) { defineProperty$c(Constructor[PROTOTYPE], key, { get: function () { return getInternalState$f(this)[key]; } }); }; var get$1 = function (view, count, index, isLittleEndian) { var intIndex = toIndex$1(index); var store = getInternalState$f(view); if (intIndex + count > store.byteLength) throw RangeError$2(WRONG_INDEX); var bytes = getInternalState$f(store.buffer).bytes; var start = intIndex + store.byteOffset; var pack = bytes.slice(start, start + count); return isLittleEndian ? pack : pack.reverse(); }; var set$2 = function (view, count, index, conversion, value, isLittleEndian) { var intIndex = toIndex$1(index); var store = getInternalState$f(view); if (intIndex + count > store.byteLength) throw RangeError$2(WRONG_INDEX); var bytes = getInternalState$f(store.buffer).bytes; var start = intIndex + store.byteOffset; var pack = conversion(+value); for (var i = 0; i < count; i++) bytes[start + i] = pack[isLittleEndian ? i : count - i - 1]; }; if (!NATIVE_ARRAY_BUFFER$2) { $ArrayBuffer = function ArrayBuffer(length) { anInstance$a(this, $ArrayBuffer, ARRAY_BUFFER$1); var byteLength = toIndex$1(length); setInternalState$g(this, { bytes: arrayFill.call(new Array(byteLength), 0), byteLength: byteLength }); if (!DESCRIPTORS$r) this.byteLength = byteLength; }; $DataView = function DataView(buffer, byteOffset, byteLength) { anInstance$a(this, $DataView, DATA_VIEW); anInstance$a(buffer, $ArrayBuffer, DATA_VIEW); var bufferLength = getInternalState$f(buffer).byteLength; var offset = toIntegerOrInfinity$a(byteOffset); if (offset < 0 || offset > bufferLength) throw RangeError$2('Wrong offset'); byteLength = byteLength === undefined ? bufferLength - offset : toLength$a(byteLength); if (offset + byteLength > bufferLength) throw RangeError$2(WRONG_LENGTH$1); setInternalState$g(this, { buffer: buffer, byteLength: byteLength, byteOffset: offset }); if (!DESCRIPTORS$r) { this.buffer = buffer; this.byteLength = byteLength; this.byteOffset = offset; } }; if (DESCRIPTORS$r) { addGetter$1($ArrayBuffer, 'byteLength'); addGetter$1($DataView, 'buffer'); addGetter$1($DataView, 'byteLength'); addGetter$1($DataView, 'byteOffset'); } redefineAll$9($DataView[PROTOTYPE], { getInt8: function getInt8(byteOffset) { return get$1(this, 1, byteOffset)[0] << 24 >> 24; }, getUint8: function getUint8(byteOffset) { return get$1(this, 1, byteOffset)[0]; }, getInt16: function getInt16(byteOffset /* , littleEndian */) { var bytes = get$1(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined); return (bytes[1] << 8 | bytes[0]) << 16 >> 16; }, getUint16: function getUint16(byteOffset /* , littleEndian */) { var bytes = get$1(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined); return bytes[1] << 8 | bytes[0]; }, getInt32: function getInt32(byteOffset /* , littleEndian */) { return unpackInt32(get$1(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)); }, getUint32: function getUint32(byteOffset /* , littleEndian */) { return unpackInt32(get$1(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)) >>> 0; }, getFloat32: function getFloat32(byteOffset /* , littleEndian */) { return unpackIEEE754(get$1(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 23); }, getFloat64: function getFloat64(byteOffset /* , littleEndian */) { return unpackIEEE754(get$1(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 52); }, setInt8: function setInt8(byteOffset, value) { set$2(this, 1, byteOffset, packInt8, value); }, setUint8: function setUint8(byteOffset, value) { set$2(this, 1, byteOffset, packInt8, value); }, setInt16: function setInt16(byteOffset, value /* , littleEndian */) { set$2(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined); }, setUint16: function setUint16(byteOffset, value /* , littleEndian */) { set$2(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined); }, setInt32: function setInt32(byteOffset, value /* , littleEndian */) { set$2(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined); }, setUint32: function setUint32(byteOffset, value /* , littleEndian */) { set$2(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined); }, setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { set$2(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : undefined); }, setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { set$2(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : undefined); } }); } else { var INCORRECT_ARRAY_BUFFER_NAME = PROPER_FUNCTION_NAME$3 && NativeArrayBuffer$1.name !== ARRAY_BUFFER$1; /* eslint-disable no-new -- required for testing */ if (!fails$S(function () { NativeArrayBuffer$1(1); }) || !fails$S(function () { new NativeArrayBuffer$1(-1); }) || fails$S(function () { new NativeArrayBuffer$1(); new NativeArrayBuffer$1(1.5); new NativeArrayBuffer$1(NaN); return INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME; })) { /* eslint-enable no-new -- required for testing */ $ArrayBuffer = function ArrayBuffer(length) { anInstance$a(this, $ArrayBuffer); return new NativeArrayBuffer$1(toIndex$1(length)); }; var ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE] = NativeArrayBuffer$1[PROTOTYPE]; for (var keys$2 = getOwnPropertyNames$4(NativeArrayBuffer$1), j$1 = 0, key$1; keys$2.length > j$1;) { if (!((key$1 = keys$2[j$1++]) in $ArrayBuffer)) { createNonEnumerableProperty$a($ArrayBuffer, key$1, NativeArrayBuffer$1[key$1]); } } ArrayBufferPrototype.constructor = $ArrayBuffer; } else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) { createNonEnumerableProperty$a(NativeArrayBuffer$1, 'name', ARRAY_BUFFER$1); } // WebKit bug - the same parent prototype for typed arrays and data view if (setPrototypeOf$5 && getPrototypeOf$a($DataViewPrototype) !== ObjectPrototype$1) { setPrototypeOf$5($DataViewPrototype, ObjectPrototype$1); } // iOS Safari 7.x bug var testView = new $DataView(new $ArrayBuffer(2)); var $setInt8 = $DataViewPrototype.setInt8; testView.setInt8(0, 2147483648); testView.setInt8(1, 2147483649); if (testView.getInt8(0) || !testView.getInt8(1)) redefineAll$9($DataViewPrototype, { setInt8: function setInt8(byteOffset, value) { $setInt8.call(this, byteOffset, value << 24 >> 24); }, setUint8: function setUint8(byteOffset, value) { $setInt8.call(this, byteOffset, value << 24 >> 24); } }, { unsafe: true }); } setToStringTag$7($ArrayBuffer, ARRAY_BUFFER$1); setToStringTag$7($DataView, DATA_VIEW); var arrayBuffer = { ArrayBuffer: $ArrayBuffer, DataView: $DataView }; var $$3Q = _export; var global$B = global$R; var arrayBufferModule = arrayBuffer; var setSpecies$5 = setSpecies$7; var ARRAY_BUFFER = 'ArrayBuffer'; var ArrayBuffer$4 = arrayBufferModule[ARRAY_BUFFER]; var NativeArrayBuffer = global$B[ARRAY_BUFFER]; // `ArrayBuffer` constructor // https://tc39.es/ecma262/#sec-arraybuffer-constructor $$3Q({ global: true, forced: NativeArrayBuffer !== ArrayBuffer$4 }, { ArrayBuffer: ArrayBuffer$4 }); setSpecies$5(ARRAY_BUFFER); var NATIVE_ARRAY_BUFFER$1 = arrayBufferNative; var DESCRIPTORS$q = descriptors; var global$A = global$R; var isCallable$h = isCallable$z; var isObject$q = isObject$C; var hasOwn$c = hasOwnProperty_1; var classof$6 = classof$b; var tryToString$1 = tryToString$3; var createNonEnumerableProperty$9 = createNonEnumerableProperty$h; var redefine$f = redefine$l.exports; var defineProperty$b = objectDefineProperty.f; var getPrototypeOf$9 = objectGetPrototypeOf$1; var setPrototypeOf$4 = objectSetPrototypeOf$1; var wellKnownSymbol$o = wellKnownSymbol$G; var uid$1 = uid$5; var Int8Array$3 = global$A.Int8Array; var Int8ArrayPrototype = Int8Array$3 && Int8Array$3.prototype; var Uint8ClampedArray = global$A.Uint8ClampedArray; var Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype; var TypedArray$1 = Int8Array$3 && getPrototypeOf$9(Int8Array$3); var TypedArrayPrototype$1 = Int8ArrayPrototype && getPrototypeOf$9(Int8ArrayPrototype); var ObjectPrototype = Object.prototype; var isPrototypeOf$2 = ObjectPrototype.isPrototypeOf; var TO_STRING_TAG$5 = wellKnownSymbol$o('toStringTag'); var TYPED_ARRAY_TAG$1 = uid$1('TYPED_ARRAY_TAG'); var TYPED_ARRAY_CONSTRUCTOR$2 = uid$1('TYPED_ARRAY_CONSTRUCTOR'); // Fixing native typed arrays in Opera Presto crashes the browser, see #595 var NATIVE_ARRAY_BUFFER_VIEWS$3 = NATIVE_ARRAY_BUFFER$1 && !!setPrototypeOf$4 && classof$6(global$A.opera) !== 'Opera'; var TYPED_ARRAY_TAG_REQIRED = 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$q(it)) return false; var klass = classof$6(it); return klass === 'DataView' || hasOwn$c(TypedArrayConstructorsList, klass) || hasOwn$c(BigIntArrayConstructorsList, klass); }; var isTypedArray$1 = function (it) { if (!isObject$q(it)) return false; var klass = classof$6(it); return hasOwn$c(TypedArrayConstructorsList, klass) || hasOwn$c(BigIntArrayConstructorsList, klass); }; var aTypedArray$t = function (it) { if (isTypedArray$1(it)) return it; throw TypeError('Target is not a typed array'); }; var aTypedArrayConstructor$5 = function (C) { if (isCallable$h(C) && (!setPrototypeOf$4 || isPrototypeOf$2.call(TypedArray$1, C))) return C; throw TypeError(tryToString$1(C) + ' is not a typed array constructor'); }; var exportTypedArrayMethod$u = function (KEY, property, forced) { if (!DESCRIPTORS$q) return; if (forced) for (var ARRAY in TypedArrayConstructorsList) { var TypedArrayConstructor = global$A[ARRAY]; if (TypedArrayConstructor && hasOwn$c(TypedArrayConstructor.prototype, KEY)) try { delete TypedArrayConstructor.prototype[KEY]; } catch (error) { /* empty */ } } if (!TypedArrayPrototype$1[KEY] || forced) { redefine$f(TypedArrayPrototype$1, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS$3 && Int8ArrayPrototype[KEY] || property); } }; var exportTypedArrayStaticMethod$3 = function (KEY, property, forced) { var ARRAY, TypedArrayConstructor; if (!DESCRIPTORS$q) return; if (setPrototypeOf$4) { if (forced) for (ARRAY in TypedArrayConstructorsList) { TypedArrayConstructor = global$A[ARRAY]; if (TypedArrayConstructor && hasOwn$c(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 redefine$f(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$A[ARRAY]; if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) { redefine$f(TypedArrayConstructor, KEY, property); } } }; for (NAME$1 in TypedArrayConstructorsList) { Constructor = global$A[NAME$1]; Prototype = Constructor && Constructor.prototype; if (Prototype) createNonEnumerableProperty$9(Prototype, TYPED_ARRAY_CONSTRUCTOR$2, Constructor); else NATIVE_ARRAY_BUFFER_VIEWS$3 = false; } for (NAME$1 in BigIntArrayConstructorsList) { Constructor = global$A[NAME$1]; Prototype = Constructor && Constructor.prototype; if (Prototype) createNonEnumerableProperty$9(Prototype, TYPED_ARRAY_CONSTRUCTOR$2, Constructor); } // WebKit bug - typed arrays constructors prototype is Object.prototype if (!NATIVE_ARRAY_BUFFER_VIEWS$3 || !isCallable$h(TypedArray$1) || TypedArray$1 === Function.prototype) { // eslint-disable-next-line no-shadow -- safe TypedArray$1 = function TypedArray() { throw TypeError('Incorrect invocation'); }; if (NATIVE_ARRAY_BUFFER_VIEWS$3) for (NAME$1 in TypedArrayConstructorsList) { if (global$A[NAME$1]) setPrototypeOf$4(global$A[NAME$1], TypedArray$1); } } if (!NATIVE_ARRAY_BUFFER_VIEWS$3 || !TypedArrayPrototype$1 || TypedArrayPrototype$1 === ObjectPrototype) { TypedArrayPrototype$1 = TypedArray$1.prototype; if (NATIVE_ARRAY_BUFFER_VIEWS$3) for (NAME$1 in TypedArrayConstructorsList) { if (global$A[NAME$1]) setPrototypeOf$4(global$A[NAME$1].prototype, TypedArrayPrototype$1); } } // WebKit bug - one more object in Uint8ClampedArray prototype chain if (NATIVE_ARRAY_BUFFER_VIEWS$3 && getPrototypeOf$9(Uint8ClampedArrayPrototype) !== TypedArrayPrototype$1) { setPrototypeOf$4(Uint8ClampedArrayPrototype, TypedArrayPrototype$1); } if (DESCRIPTORS$q && !hasOwn$c(TypedArrayPrototype$1, TO_STRING_TAG$5)) { TYPED_ARRAY_TAG_REQIRED = true; defineProperty$b(TypedArrayPrototype$1, TO_STRING_TAG$5, { get: function () { return isObject$q(this) ? this[TYPED_ARRAY_TAG$1] : undefined; } }); for (NAME$1 in TypedArrayConstructorsList) if (global$A[NAME$1]) { createNonEnumerableProperty$9(global$A[NAME$1], TYPED_ARRAY_TAG$1, NAME$1); } } var arrayBufferViewCore = { NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS$3, TYPED_ARRAY_CONSTRUCTOR: TYPED_ARRAY_CONSTRUCTOR$2, TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG$1, aTypedArray: aTypedArray$t, aTypedArrayConstructor: aTypedArrayConstructor$5, exportTypedArrayMethod: exportTypedArrayMethod$u, exportTypedArrayStaticMethod: exportTypedArrayStaticMethod$3, isView: isView, isTypedArray: isTypedArray$1, TypedArray: TypedArray$1, TypedArrayPrototype: TypedArrayPrototype$1 }; var $$3P = _export; var ArrayBufferViewCore$x = arrayBufferViewCore; var NATIVE_ARRAY_BUFFER_VIEWS$2 = ArrayBufferViewCore$x.NATIVE_ARRAY_BUFFER_VIEWS; // `ArrayBuffer.isView` method // https://tc39.es/ecma262/#sec-arraybuffer.isview $$3P({ target: 'ArrayBuffer', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS$2 }, { isView: ArrayBufferViewCore$x.isView }); var isConstructor$2 = isConstructor$7; var tryToString = tryToString$3; // `Assert: IsConstructor(argument) is true` var aConstructor$5 = function (argument) { if (isConstructor$2(argument)) return argument; throw TypeError(tryToString(argument) + ' is not a constructor'); }; var anObject$1r = anObject$1C; var aConstructor$4 = aConstructor$5; var wellKnownSymbol$n = wellKnownSymbol$G; var SPECIES$2 = wellKnownSymbol$n('species'); // `SpeciesConstructor` abstract operation // https://tc39.es/ecma262/#sec-speciesconstructor var speciesConstructor$f = function (O, defaultConstructor) { var C = anObject$1r(O).constructor; var S; return C === undefined || (S = anObject$1r(C)[SPECIES$2]) == undefined ? defaultConstructor : aConstructor$4(S); }; var $$3O = _export; var fails$R = fails$15; var ArrayBufferModule$2 = arrayBuffer; var anObject$1q = anObject$1C; var toAbsoluteIndex$2 = toAbsoluteIndex$8; var toLength$9 = toLength$d; var speciesConstructor$e = speciesConstructor$f; var ArrayBuffer$3 = ArrayBufferModule$2.ArrayBuffer; var DataView$2 = ArrayBufferModule$2.DataView; var nativeArrayBufferSlice = ArrayBuffer$3.prototype.slice; var INCORRECT_SLICE = fails$R(function () { return !new ArrayBuffer$3(2).slice(1, undefined).byteLength; }); // `ArrayBuffer.prototype.slice` method // https://tc39.es/ecma262/#sec-arraybuffer.prototype.slice $$3O({ target: 'ArrayBuffer', proto: true, unsafe: true, forced: INCORRECT_SLICE }, { slice: function slice(start, end) { if (nativeArrayBufferSlice !== undefined && end === undefined) { return nativeArrayBufferSlice.call(anObject$1q(this), start); // FF fix } var length = anObject$1q(this).byteLength; var first = toAbsoluteIndex$2(start, length); var fin = toAbsoluteIndex$2(end === undefined ? length : end, length); var result = new (speciesConstructor$e(this, ArrayBuffer$3))(toLength$9(fin - first)); var viewSource = new DataView$2(this); var viewTarget = new DataView$2(result); var index = 0; while (first < fin) { viewTarget.setUint8(index++, viewSource.getUint8(first++)); } return result; } }); var $$3N = _export; var ArrayBufferModule$1 = arrayBuffer; var NATIVE_ARRAY_BUFFER = arrayBufferNative; // `DataView` constructor // https://tc39.es/ecma262/#sec-dataview-constructor $$3N({ global: true, forced: !NATIVE_ARRAY_BUFFER }, { DataView: ArrayBufferModule$1.DataView }); var $$3M = _export; var fails$Q = fails$15; var FORCED$r = fails$Q(function () { return new Date(16e11).getYear() !== 120; }); var getFullYear = Date.prototype.getFullYear; // `Date.prototype.getYear` method // https://tc39.es/ecma262/#sec-date.prototype.getyear $$3M({ target: 'Date', proto: true, forced: FORCED$r }, { getYear: function getYear() { return getFullYear.call(this) - 1900; } }); var $$3L = _export; // `Date.now` method // https://tc39.es/ecma262/#sec-date.now $$3L({ target: 'Date', stat: true }, { now: function now() { return new Date().getTime(); } }); var $$3K = _export; var toIntegerOrInfinity$9 = toIntegerOrInfinity$i; var getTime$2 = Date.prototype.getTime; var setFullYear = Date.prototype.setFullYear; // `Date.prototype.setYear` method // https://tc39.es/ecma262/#sec-date.prototype.setyear $$3K({ target: 'Date', proto: true }, { setYear: function setYear(year) { // validate getTime$2.call(this); var yi = toIntegerOrInfinity$9(year); var yyyy = 0 <= yi && yi <= 99 ? yi + 1900 : yi; return setFullYear.call(this, yyyy); } }); var $$3J = _export; // `Date.prototype.toGMTString` method // https://tc39.es/ecma262/#sec-date.prototype.togmtstring $$3J({ target: 'Date', proto: true }, { toGMTString: Date.prototype.toUTCString }); var toIntegerOrInfinity$8 = toIntegerOrInfinity$i; var toString$p = toString$t; var requireObjectCoercible$g = requireObjectCoercible$j; // `String.prototype.repeat` method implementation // https://tc39.es/ecma262/#sec-string.prototype.repeat var stringRepeat = function repeat(count) { var str = toString$p(requireObjectCoercible$g(this)); var result = ''; var n = toIntegerOrInfinity$8(count); if (n < 0 || n == Infinity) throw RangeError('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 toLength$8 = toLength$d; var toString$o = toString$t; var repeat$2 = stringRepeat; var requireObjectCoercible$f = requireObjectCoercible$j; var ceil$1 = Math.ceil; // `String.prototype.{ padStart, padEnd }` methods implementation var createMethod$5 = function (IS_END) { return function ($this, maxLength, fillString) { var S = toString$o(requireObjectCoercible$f($this)); var intMaxLength = toLength$8(maxLength); var stringLength = S.length; var fillStr = fillString === undefined ? ' ' : toString$o(fillString); var fillLen, stringFiller; if (intMaxLength <= stringLength || fillStr == '') return S; fillLen = intMaxLength - stringLength; stringFiller = repeat$2.call(fillStr, ceil$1(fillLen / fillStr.length)); if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(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$5(false), // `String.prototype.padEnd` method // https://tc39.es/ecma262/#sec-string.prototype.padend end: createMethod$5(true) }; var fails$P = fails$15; var padStart = stringPad.start; var abs$6 = Math.abs; var DatePrototype$2 = Date.prototype; var getTime$1 = DatePrototype$2.getTime; var nativeDateToISOString = DatePrototype$2.toISOString; // `Date.prototype.toISOString` method implementation // https://tc39.es/ecma262/#sec-date.prototype.toisostring // PhantomJS / old WebKit fails here: var dateToIsoString = (fails$P(function () { return nativeDateToISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; }) || !fails$P(function () { nativeDateToISOString.call(new Date(NaN)); })) ? function toISOString() { if (!isFinite(getTime$1.call(this))) throw RangeError('Invalid time value'); var date = this; var year = date.getUTCFullYear(); var milliseconds = date.getUTCMilliseconds(); var sign = year < 0 ? '-' : year > 9999 ? '+' : ''; return sign + padStart(abs$6(year), sign ? 6 : 4, 0) + '-' + padStart(date.getUTCMonth() + 1, 2, 0) + '-' + padStart(date.getUTCDate(), 2, 0) + 'T' + padStart(date.getUTCHours(), 2, 0) + ':' + padStart(date.getUTCMinutes(), 2, 0) + ':' + padStart(date.getUTCSeconds(), 2, 0) + '.' + padStart(milliseconds, 3, 0) + 'Z'; } : nativeDateToISOString; var $$3I = _export; var toISOString = dateToIsoString; // `Date.prototype.toISOString` method // https://tc39.es/ecma262/#sec-date.prototype.toisostring // PhantomJS / old WebKit has a broken implementations $$3I({ target: 'Date', proto: true, forced: Date.prototype.toISOString !== toISOString }, { toISOString: toISOString }); var $$3H = _export; var fails$O = fails$15; var toObject$k = toObject$z; var toPrimitive$1 = toPrimitive$3; var FORCED$q = fails$O(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 $$3H({ target: 'Date', proto: true, forced: FORCED$q }, { // eslint-disable-next-line no-unused-vars -- required for `.length` toJSON: function toJSON(key) { var O = toObject$k(this); var pv = toPrimitive$1(O, 'number'); return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); } }); var anObject$1p = anObject$1C; var ordinaryToPrimitive = ordinaryToPrimitive$2; // `Date.prototype[@@toPrimitive](hint)` method implementation // https://tc39.es/ecma262/#sec-date.prototype-@@toprimitive var dateToPrimitive$1 = function (hint) { anObject$1p(this); if (hint === 'string' || hint === 'default') hint = 'string'; else if (hint !== 'number') throw TypeError('Incorrect hint'); return ordinaryToPrimitive(this, hint); }; var redefine$e = redefine$l.exports; var dateToPrimitive = dateToPrimitive$1; var wellKnownSymbol$m = wellKnownSymbol$G; var TO_PRIMITIVE = wellKnownSymbol$m('toPrimitive'); var DatePrototype$1 = Date.prototype; // `Date.prototype[@@toPrimitive]` method // https://tc39.es/ecma262/#sec-date.prototype-@@toprimitive if (!(TO_PRIMITIVE in DatePrototype$1)) { redefine$e(DatePrototype$1, TO_PRIMITIVE, dateToPrimitive); } var redefine$d = redefine$l.exports; var DatePrototype = Date.prototype; var INVALID_DATE = 'Invalid Date'; var TO_STRING$1 = 'toString'; var nativeDateToString = DatePrototype[TO_STRING$1]; var getTime = DatePrototype.getTime; // `Date.prototype.toString` method // https://tc39.es/ecma262/#sec-date.prototype.tostring if (String(new Date(NaN)) != INVALID_DATE) { redefine$d(DatePrototype, TO_STRING$1, function toString() { var value = getTime.call(this); // eslint-disable-next-line no-self-compare -- NaN check return value === value ? nativeDateToString.call(this) : INVALID_DATE; }); } var $$3G = _export; var toString$n = toString$t; var raw = /[\w*+\-./@]/; var hex$1 = function (code, length) { var result = code.toString(16); while (result.length < length) result = '0' + result; return result; }; // `escape` method // https://tc39.es/ecma262/#sec-escape-string $$3G({ global: true }, { escape: function escape(string) { var str = toString$n(string); var result = ''; var length = str.length; var index = 0; var chr, code; while (index < length) { chr = str.charAt(index++); if (raw.test(chr)) { result += chr; } else { code = chr.charCodeAt(0); if (code < 256) { result += '%' + hex$1(code, 2); } else { result += '%u' + hex$1(code, 4).toUpperCase(); } } } return result; } }); var aCallable$J = aCallable$Q; var isObject$p = isObject$C; var slice$2 = [].slice; var factories = {}; var construct = function (C, argsLength, args) { if (!(argsLength in factories)) { for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']'; // eslint-disable-next-line no-new-func -- we have no proper alternatives, IE8- only factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')'); } return factories[argsLength](C, args); }; // `Function.prototype.bind` method implementation // https://tc39.es/ecma262/#sec-function.prototype.bind var functionBind = Function.bind || function bind(that /* , ...args */) { var fn = aCallable$J(this); var partArgs = slice$2.call(arguments, 1); var boundFunction = function bound(/* args... */) { var args = partArgs.concat(slice$2.call(arguments)); return this instanceof boundFunction ? construct(fn, args.length, args) : fn.apply(that, args); }; if (isObject$p(fn.prototype)) boundFunction.prototype = fn.prototype; return boundFunction; }; var $$3F = _export; var bind$m = functionBind; // `Function.prototype.bind` method // https://tc39.es/ecma262/#sec-function.prototype.bind $$3F({ target: 'Function', proto: true }, { bind: bind$m }); var isCallable$g = isCallable$z; var isObject$o = isObject$C; var definePropertyModule$5 = objectDefineProperty; var getPrototypeOf$8 = objectGetPrototypeOf$1; var wellKnownSymbol$l = wellKnownSymbol$G; var HAS_INSTANCE = wellKnownSymbol$l('hasInstance'); var FunctionPrototype$1 = Function.prototype; // `Function.prototype[@@hasInstance]` method // https://tc39.es/ecma262/#sec-function.prototype-@@hasinstance if (!(HAS_INSTANCE in FunctionPrototype$1)) { definePropertyModule$5.f(FunctionPrototype$1, HAS_INSTANCE, { value: function (O) { if (!isCallable$g(this) || !isObject$o(O)) return false; if (!isObject$o(this.prototype)) return O instanceof this; // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: while (O = getPrototypeOf$8(O)) if (this.prototype === O) return true; return false; } }); } var DESCRIPTORS$p = descriptors; var FUNCTION_NAME_EXISTS = functionName.EXISTS; var defineProperty$a = objectDefineProperty.f; var FunctionPrototype = Function.prototype; var FunctionPrototypeToString = FunctionPrototype.toString; var nameRE = /^\s*function ([^ (]*)/; var NAME = 'name'; // Function instances `.name` property // https://tc39.es/ecma262/#sec-function-instances-name if (DESCRIPTORS$p && !FUNCTION_NAME_EXISTS) { defineProperty$a(FunctionPrototype, NAME, { configurable: true, get: function () { try { return FunctionPrototypeToString.call(this).match(nameRE)[1]; } catch (error) { return ''; } } }); } var $$3E = _export; var global$z = global$R; // `globalThis` object // https://tc39.es/ecma262/#sec-globalthis $$3E({ global: true }, { globalThis: global$z }); var $$3D = _export; var getBuiltIn$q = getBuiltIn$y; var fails$N = fails$15; var $stringify = getBuiltIn$q('JSON', 'stringify'); var re = /[\uD800-\uDFFF]/g; var low = /^[\uD800-\uDBFF]$/; var hi = /^[\uDC00-\uDFFF]$/; var fix = function (match, offset, string) { var prev = string.charAt(offset - 1); var next = string.charAt(offset + 1); if ((low.test(match) && !hi.test(next)) || (hi.test(match) && !low.test(prev))) { return '\\u' + match.charCodeAt(0).toString(16); } return match; }; var FORCED$p = fails$N(function () { return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"' || $stringify('\uDEAD') !== '"\\udead"'; }); if ($stringify) { // `JSON.stringify` method // https://tc39.es/ecma262/#sec-json.stringify // https://github.com/tc39/proposal-well-formed-stringify $$3D({ target: 'JSON', stat: true, forced: FORCED$p }, { // eslint-disable-next-line no-unused-vars -- required for `.length` stringify: function stringify(it, replacer, space) { var result = $stringify.apply(null, arguments); return typeof result == 'string' ? result.replace(re, fix) : result; } }); } var global$y = global$R; var setToStringTag$6 = setToStringTag$b; // JSON[@@toStringTag] property // https://tc39.es/ecma262/#sec-json-@@tostringtag setToStringTag$6(global$y.JSON, 'JSON', true); var internalMetadata = {exports: {}}; var fails$M = fails$15; var freezing = !fails$M(function () { // eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing return Object.isExtensible(Object.preventExtensions({})); }); var $$3C = _export; var hiddenKeys = hiddenKeys$6; var isObject$n = isObject$C; var hasOwn$b = hasOwnProperty_1; var defineProperty$9 = objectDefineProperty.f; var getOwnPropertyNamesModule = objectGetOwnPropertyNames; var getOwnPropertyNamesExternalModule = objectGetOwnPropertyNamesExternal; var uid = uid$5; var FREEZING$4 = freezing; var REQUIRED = false; var METADATA = uid('meta'); var id$1 = 0; // eslint-disable-next-line es/no-object-isextensible -- safe var isExtensible$1 = Object.isExtensible || function () { return true; }; var setMetadata = function (it) { defineProperty$9(it, METADATA, { value: { objectID: 'O' + id$1++, // object ID weakData: {} // weak collections IDs } }); }; var fastKey$1 = function (it, create) { // return a primitive with prefix if (!isObject$n(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; if (!hasOwn$b(it, METADATA)) { // 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].objectID; }; var getWeakData$1 = function (it, create) { if (!hasOwn$b(it, METADATA)) { // 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].weakData; }; // add metadata on freeze-family methods calling var onFreeze$3 = function (it) { if (FREEZING$4 && REQUIRED && isExtensible$1(it) && !hasOwn$b(it, METADATA)) setMetadata(it); return it; }; var enable = function () { meta.enable = function () { /* empty */ }; REQUIRED = true; var getOwnPropertyNames = getOwnPropertyNamesModule.f; var splice = [].splice; var test = {}; test[METADATA] = 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) { splice.call(result, i, 1); break; } } return result; }; $$3C({ 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] = true; var isCallable$f = isCallable$z; var isObject$m = isObject$C; var setPrototypeOf$3 = objectSetPrototypeOf$1; // makes subclassing work correct for wrapped built-ins var inheritIfRequired$4 = function ($this, dummy, Wrapper) { var NewTarget, NewTargetPrototype; if ( // it can work only with native `setPrototypeOf` setPrototypeOf$3 && // we haven't completely correct pre-ES6 way for getting `new.target`, so use this isCallable$f(NewTarget = dummy.constructor) && NewTarget !== Wrapper && isObject$m(NewTargetPrototype = NewTarget.prototype) && NewTargetPrototype !== Wrapper.prototype ) setPrototypeOf$3($this, NewTargetPrototype); return $this; }; var $$3B = _export; var global$x = global$R; var isForced$3 = isForced_1; var redefine$c = redefine$l.exports; var InternalMetadataModule$1 = internalMetadata.exports; var iterate$G = iterate$I; var anInstance$9 = anInstance$b; var isCallable$e = isCallable$z; var isObject$l = isObject$C; var fails$L = fails$15; var checkCorrectnessOfIteration$2 = checkCorrectnessOfIteration$4; var setToStringTag$5 = setToStringTag$b; var inheritIfRequired$3 = inheritIfRequired$4; 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$x[CONSTRUCTOR_NAME]; var NativePrototype = NativeConstructor && NativeConstructor.prototype; var Constructor = NativeConstructor; var exported = {}; var fixMethod = function (KEY) { var nativeMethod = NativePrototype[KEY]; redefine$c(NativePrototype, KEY, KEY == 'add' ? function add(value) { nativeMethod.call(this, value === 0 ? 0 : value); return this; } : KEY == 'delete' ? function (key) { return IS_WEAK && !isObject$l(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key); } : KEY == 'get' ? function get(key) { return IS_WEAK && !isObject$l(key) ? undefined : nativeMethod.call(this, key === 0 ? 0 : key); } : KEY == 'has' ? function has(key) { return IS_WEAK && !isObject$l(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key); } : function set(key, value) { nativeMethod.call(this, key === 0 ? 0 : key, value); return this; } ); }; var REPLACE = isForced$3( CONSTRUCTOR_NAME, !isCallable$e(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails$L(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$L(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$L(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$9(dummy, Constructor, CONSTRUCTOR_NAME); var that = inheritIfRequired$3(new NativeConstructor(), dummy, Constructor); if (iterable != undefined) iterate$G(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; $$3B({ global: true, forced: Constructor != NativeConstructor }, exported); setToStringTag$5(Constructor, CONSTRUCTOR_NAME); if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP); return Constructor; }; var defineProperty$8 = objectDefineProperty.f; var create$a = objectCreate$1; var redefineAll$8 = redefineAll$a; var bind$l = functionBindContext; var anInstance$8 = anInstance$b; var iterate$F = iterate$I; var defineIterator$1 = defineIterator$3; var setSpecies$4 = setSpecies$7; var DESCRIPTORS$o = descriptors; var fastKey = internalMetadata.exports.fastKey; var InternalStateModule$f = internalState; var setInternalState$f = InternalStateModule$f.set; var internalStateGetterFor$1 = InternalStateModule$f.getterFor; var collectionStrong$2 = { getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { var C = wrapper(function (that, iterable) { anInstance$8(that, C, CONSTRUCTOR_NAME); setInternalState$f(that, { type: CONSTRUCTOR_NAME, index: create$a(null), first: undefined, last: undefined, size: 0 }); if (!DESCRIPTORS$o) that.size = 0; if (iterable != undefined) iterate$F(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); }); 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$o) 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; } }; redefineAll$8(C.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$o) 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$o) 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$l(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); 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); } }); redefineAll$8(C.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$o) defineProperty$8(C.prototype, 'size', { get: function () { return getInternalState(this).size; } }); return C; }, setStrong: function (C, 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(C, CONSTRUCTOR_NAME, function (iterated, kind) { setInternalState$f(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 { value: undefined, done: true }; } // return step by kind if (kind == 'keys') return { value: entry.key, done: false }; if (kind == 'values') return { value: entry.value, done: false }; return { value: [entry.key, entry.value], done: 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 var es_map = 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) { return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : log$7(1 + x); }; var $$3A = _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$o = !$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 $$3A({ target: 'Math', stat: true, forced: FORCED$o }, { acosh: function acosh(x) { return (x = +x) < 1 ? NaN : x > 94906265.62425156 ? log$6(x) + LN2$1 : log1p$1(x - 1 + sqrt$2(x - 1) * sqrt$2(x + 1)); } }); var $$3z = _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) { return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : log$5(x + sqrt$1(x * x + 1)); } // `Math.asinh` method // https://tc39.es/ecma262/#sec-math.asinh // Tor Browser bug: Math.asinh(0) -> -0 $$3z({ target: 'Math', stat: true, forced: !($asinh && 1 / $asinh(0) > 0) }, { asinh: asinh }); var $$3y = _export; // eslint-disable-next-line es/no-math-atanh -- required for testing var $atanh = Math.atanh; var log$4 = Math.log; // `Math.atanh` method // https://tc39.es/ecma262/#sec-math.atanh // Tor Browser bug: Math.atanh(-0) -> 0 $$3y({ target: 'Math', stat: true, forced: !($atanh && 1 / $atanh(-0) < 0) }, { atanh: function atanh(x) { return (x = +x) == 0 ? x : log$4((1 + x) / (1 - x)) / 2; } }); // `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) { // eslint-disable-next-line no-self-compare -- NaN check return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; }; var $$3x = _export; var sign$2 = mathSign; var abs$5 = Math.abs; var pow$3 = Math.pow; // `Math.cbrt` method // https://tc39.es/ecma262/#sec-math.cbrt $$3x({ target: 'Math', stat: true }, { cbrt: function cbrt(x) { return sign$2(x = +x) * pow$3(abs$5(x), 1 / 3); } }); var $$3w = _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 $$3w({ target: 'Math', stat: true }, { clz32: function clz32(x) { return (x >>>= 0) ? 31 - floor$7(log$3(x + 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 || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 // Tor Browser bug || $expm1(-2e-17) != -2e-17 ) ? function expm1(x) { return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : exp$2(x) - 1; } : $expm1; var $$3v = _export; var expm1$3 = mathExpm1; // eslint-disable-next-line es/no-math-cosh -- required for testing var $cosh = Math.cosh; var abs$4 = Math.abs; var E$1 = Math.E; // `Math.cosh` method // https://tc39.es/ecma262/#sec-math.cosh $$3v({ target: 'Math', stat: true, forced: !$cosh || $cosh(710) === Infinity }, { cosh: function cosh(x) { var t = expm1$3(abs$4(x) - 1) + 1; return (t + 1 / (t * E$1 * E$1)) * (E$1 / 2); } }); var $$3u = _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 $$3u({ target: 'Math', stat: true, forced: expm1$2 != Math.expm1 }, { expm1: expm1$2 }); var sign$1 = mathSign; var abs$3 = Math.abs; var pow$2 = Math.pow; var EPSILON = pow$2(2, -52); var EPSILON32 = pow$2(2, -23); var MAX32 = pow$2(2, 127) * (2 - EPSILON32); var MIN32 = pow$2(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 $abs = abs$3(x); var $sign = sign$1(x); 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 $$3t = _export; var fround$1 = mathFround; // `Math.fround` method // https://tc39.es/ecma262/#sec-math.fround $$3t({ target: 'Math', stat: true }, { fround: fround$1 }); var $$3s = _export; // eslint-disable-next-line es/no-math-hypot -- required for testing var $hypot = Math.hypot; var abs$2 = Math.abs; var sqrt = Math.sqrt; // Chrome 77 bug // https://bugs.chromium.org/p/v8/issues/detail?id=9546 var BUGGY = !!$hypot && $hypot(Infinity, NaN) !== Infinity; // `Math.hypot` method // https://tc39.es/ecma262/#sec-math.hypot $$3s({ target: 'Math', stat: true, forced: BUGGY }, { // 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$2(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 $$3r = _export; var fails$K = fails$15; // eslint-disable-next-line es/no-math-imul -- required for testing var $imul = Math.imul; var FORCED$n = fails$K(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 $$3r({ target: 'Math', stat: true, forced: FORCED$n }, { 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 $$3q = _export; var log$2 = Math.log; var LOG10E = Math.LOG10E; // `Math.log10` method // https://tc39.es/ecma262/#sec-math.log10 $$3q({ target: 'Math', stat: true }, { log10: function log10(x) { return log$2(x) * LOG10E; } }); var $$3p = _export; var log1p = mathLog1p; // `Math.log1p` method // https://tc39.es/ecma262/#sec-math.log1p $$3p({ target: 'Math', stat: true }, { log1p: log1p }); var $$3o = _export; var log$1 = Math.log; var LN2 = Math.LN2; // `Math.log2` method // https://tc39.es/ecma262/#sec-math.log2 $$3o({ target: 'Math', stat: true }, { log2: function log2(x) { return log$1(x) / LN2; } }); var $$3n = _export; var sign = mathSign; // `Math.sign` method // https://tc39.es/ecma262/#sec-math.sign $$3n({ target: 'Math', stat: true }, { sign: sign }); var $$3m = _export; var fails$J = fails$15; var expm1$1 = mathExpm1; var abs$1 = Math.abs; var exp$1 = Math.exp; var E = Math.E; var FORCED$m = fails$J(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 $$3m({ target: 'Math', stat: true, forced: FORCED$m }, { sinh: function sinh(x) { return abs$1(x = +x) < 1 ? (expm1$1(x) - expm1$1(-x)) / 2 : (exp$1(x - 1) - exp$1(-x - 1)) * (E / 2); } }); var $$3l = _export; var expm1 = mathExpm1; var exp = Math.exp; // `Math.tanh` method // https://tc39.es/ecma262/#sec-math.tanh $$3l({ target: 'Math', stat: true }, { tanh: function tanh(x) { var a = expm1(x = +x); var b = expm1(-x); return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); } }); var setToStringTag$4 = setToStringTag$b; // Math[@@toStringTag] property // https://tc39.es/ecma262/#sec-math-@@tostringtag setToStringTag$4(Math, 'Math', true); var $$3k = _export; var ceil = Math.ceil; var floor$6 = Math.floor; // `Math.trunc` method // https://tc39.es/ecma262/#sec-math.trunc $$3k({ target: 'Math', stat: true }, { trunc: function trunc(it) { return (it > 0 ? floor$6 : ceil)(it); } }); var valueOf = 1.0.valueOf; // `thisNumberValue` abstract operation // https://tc39.es/ecma262/#sec-thisnumbervalue var thisNumberValue$3 = function (value) { return valueOf.call(value); }; // a string of all valid unicode whitespaces var whitespaces$4 = '\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 requireObjectCoercible$e = requireObjectCoercible$j; var toString$m = toString$t; var whitespaces$3 = whitespaces$4; var whitespace = '[' + whitespaces$3 + ']'; var ltrim = RegExp('^' + whitespace + whitespace + '*'); var rtrim = RegExp(whitespace + whitespace + '*$'); // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation var createMethod$4 = function (TYPE) { return function ($this) { var string = toString$m(requireObjectCoercible$e($this)); if (TYPE & 1) string = string.replace(ltrim, ''); if (TYPE & 2) string = string.replace(rtrim, ''); return string; }; }; var stringTrim = { // `String.prototype.{ trimLeft, trimStart }` methods // https://tc39.es/ecma262/#sec-string.prototype.trimstart start: createMethod$4(1), // `String.prototype.{ trimRight, trimEnd }` methods // https://tc39.es/ecma262/#sec-string.prototype.trimend end: createMethod$4(2), // `String.prototype.trim` method // https://tc39.es/ecma262/#sec-string.prototype.trim trim: createMethod$4(3) }; var DESCRIPTORS$n = descriptors; var global$w = global$R; var isForced$2 = isForced_1; var redefine$b = redefine$l.exports; var hasOwn$a = hasOwnProperty_1; var inheritIfRequired$2 = inheritIfRequired$4; var isSymbol$1 = isSymbol$5; var toPrimitive = toPrimitive$3; var fails$I = fails$15; var getOwnPropertyNames$3 = objectGetOwnPropertyNames.f; var getOwnPropertyDescriptor$6 = objectGetOwnPropertyDescriptor.f; var defineProperty$7 = objectDefineProperty.f; var thisNumberValue$2 = thisNumberValue$3; var trim$2 = stringTrim.trim; var NUMBER = 'Number'; var NativeNumber = global$w[NUMBER]; var NumberPrototype = NativeNumber.prototype; // `ToNumeric` abstract operation // https://tc39.es/ecma262/#sec-tonumeric var toNumeric = function (value) { var primValue = toPrimitive(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(argument, 'number'); var first, third, radix, maxCode, digits, length, index, code; if (isSymbol$1(it)) throw TypeError('Cannot convert a Symbol value to a number'); if (typeof it == 'string' && it.length > 2) { it = trim$2(it); first = it.charCodeAt(0); if (first === 43 || first === 45) { third = it.charCodeAt(2); if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix } else if (first === 48) { switch (it.charCodeAt(1)) { case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i default: return +it; } digits = it.slice(2); length = digits.length; for (index = 0; index < length; index++) { code = digits.charCodeAt(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; }; // `Number` constructor // https://tc39.es/ecma262/#sec-number-constructor if (isForced$2(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) { var NumberWrapper = function Number(value) { var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value)); var dummy = this; // check on 1..constructor(foo) case return dummy instanceof NumberWrapper && fails$I(function () { thisNumberValue$2(dummy); }) ? inheritIfRequired$2(Object(n), dummy, NumberWrapper) : n; }; for (var keys$1 = DESCRIPTORS$n ? getOwnPropertyNames$3(NativeNumber) : ( // 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$1.length > j; j++) { if (hasOwn$a(NativeNumber, key = keys$1[j]) && !hasOwn$a(NumberWrapper, key)) { defineProperty$7(NumberWrapper, key, getOwnPropertyDescriptor$6(NativeNumber, key)); } } NumberWrapper.prototype = NumberPrototype; NumberPrototype.constructor = NumberWrapper; redefine$b(global$w, NUMBER, NumberWrapper); } var $$3j = _export; // `Number.EPSILON` constant // https://tc39.es/ecma262/#sec-number.epsilon $$3j({ target: 'Number', stat: true }, { EPSILON: Math.pow(2, -52) }); var global$v = global$R; var globalIsFinite = global$v.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 $$3i = _export; var numberIsFinite$1 = numberIsFinite$2; // `Number.isFinite` method // https://tc39.es/ecma262/#sec-number.isfinite $$3i({ target: 'Number', stat: true }, { isFinite: numberIsFinite$1 }); var isObject$k = isObject$C; var floor$5 = 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$k(it) && isFinite(it) && floor$5(it) === it; }; var $$3h = _export; var isIntegralNumber$2 = isIntegralNumber$3; // `Number.isInteger` method // https://tc39.es/ecma262/#sec-number.isinteger $$3h({ target: 'Number', stat: true }, { isInteger: isIntegralNumber$2 }); var $$3g = _export; // `Number.isNaN` method // https://tc39.es/ecma262/#sec-number.isnan $$3g({ target: 'Number', stat: true }, { isNaN: function isNaN(number) { // eslint-disable-next-line no-self-compare -- NaN check return number != number; } }); var $$3f = _export; var isIntegralNumber$1 = isIntegralNumber$3; var abs = Math.abs; // `Number.isSafeInteger` method // https://tc39.es/ecma262/#sec-number.issafeinteger $$3f({ target: 'Number', stat: true }, { isSafeInteger: function isSafeInteger(number) { return isIntegralNumber$1(number) && abs(number) <= 0x1FFFFFFFFFFFFF; } }); var $$3e = _export; // `Number.MAX_SAFE_INTEGER` constant // https://tc39.es/ecma262/#sec-number.max_safe_integer $$3e({ target: 'Number', stat: true }, { MAX_SAFE_INTEGER: 0x1FFFFFFFFFFFFF }); var $$3d = _export; // `Number.MIN_SAFE_INTEGER` constant // https://tc39.es/ecma262/#sec-number.min_safe_integer $$3d({ target: 'Number', stat: true }, { MIN_SAFE_INTEGER: -0x1FFFFFFFFFFFFF }); var global$u = global$R; var fails$H = fails$15; var toString$l = toString$t; var trim$1 = stringTrim.trim; var whitespaces$2 = whitespaces$4; var $parseFloat$1 = global$u.parseFloat; var Symbol$2 = global$u.Symbol; var ITERATOR$5 = Symbol$2 && Symbol$2.iterator; var FORCED$l = 1 / $parseFloat$1(whitespaces$2 + '-0') !== -Infinity // MS Edge 18- broken with boxed symbols || (ITERATOR$5 && !fails$H(function () { $parseFloat$1(Object(ITERATOR$5)); })); // `parseFloat` method // https://tc39.es/ecma262/#sec-parsefloat-string var numberParseFloat = FORCED$l ? function parseFloat(string) { var trimmedString = trim$1(toString$l(string)); var result = $parseFloat$1(trimmedString); return result === 0 && trimmedString.charAt(0) == '-' ? -0 : result; } : $parseFloat$1; var $$3c = _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 $$3c({ target: 'Number', stat: true, forced: Number.parseFloat != parseFloat$1 }, { parseFloat: parseFloat$1 }); var global$t = global$R; var fails$G = fails$15; var toString$k = toString$t; var trim = stringTrim.trim; var whitespaces$1 = whitespaces$4; var $parseInt$1 = global$t.parseInt; var Symbol$1 = global$t.Symbol; var ITERATOR$4 = Symbol$1 && Symbol$1.iterator; var hex = /^[+-]?0x/i; var FORCED$k = $parseInt$1(whitespaces$1 + '08') !== 8 || $parseInt$1(whitespaces$1 + '0x16') !== 22 // MS Edge 18- broken with boxed symbols || (ITERATOR$4 && !fails$G(function () { $parseInt$1(Object(ITERATOR$4)); })); // `parseInt` method // https://tc39.es/ecma262/#sec-parseint-string-radix var numberParseInt = FORCED$k ? function parseInt(string, radix) { var S = trim(toString$k(string)); return $parseInt$1(S, (radix >>> 0) || (hex.test(S) ? 16 : 10)); } : $parseInt$1; var $$3b = _export; var parseInt$2 = numberParseInt; // `Number.parseInt` method // https://tc39.es/ecma262/#sec-number.parseint // eslint-disable-next-line es/no-number-parseint -- required for testing $$3b({ target: 'Number', stat: true, forced: Number.parseInt != parseInt$2 }, { parseInt: parseInt$2 }); var $$3a = _export; var toIntegerOrInfinity$7 = toIntegerOrInfinity$i; var thisNumberValue$1 = thisNumberValue$3; var repeat$1 = stringRepeat; var fails$F = fails$15; var nativeToFixed = 1.0.toFixed; var floor$4 = Math.floor; 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(data[index]); s = s === '' ? t : s + repeat$1.call('0', 7 - t.length) + t; } } return s; }; var FORCED$j = nativeToFixed && ( 0.00008.toFixed(3) !== '0.000' || 0.9.toFixed(0) !== '1' || 1.255.toFixed(2) !== '1.25' || 1000000000000000128.0.toFixed(0) !== '1000000000000000128' ) || !fails$F(function () { // V8 ~ Android 4.3- nativeToFixed.call({}); }); // `Number.prototype.toFixed` method // https://tc39.es/ecma262/#sec-number.prototype.tofixed $$3a({ target: 'Number', proto: true, forced: FORCED$j }, { toFixed: function toFixed(fractionDigits) { var number = thisNumberValue$1(this); var fractDigits = toIntegerOrInfinity$7(fractionDigits); var data = [0, 0, 0, 0, 0, 0]; var sign = ''; var result = '0'; var e, z, j, k; if (fractDigits < 0 || fractDigits > 20) throw RangeError('Incorrect fraction digits'); // eslint-disable-next-line no-self-compare -- NaN check if (number != number) return 'NaN'; if (number <= -1e21 || number >= 1e21) return String(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.call('0', fractDigits); } } if (fractDigits > 0) { k = result.length; result = sign + (k <= fractDigits ? '0.' + repeat$1.call('0', fractDigits - k) + result : result.slice(0, k - fractDigits) + '.' + result.slice(k - fractDigits)); } else { result = sign + result; } return result; } }); var $$39 = _export; var fails$E = fails$15; var thisNumberValue = thisNumberValue$3; var nativeToPrecision = 1.0.toPrecision; var FORCED$i = fails$E(function () { // IE7- return nativeToPrecision.call(1, undefined) !== '1'; }) || !fails$E(function () { // V8 ~ Android 4.3- nativeToPrecision.call({}); }); // `Number.prototype.toPrecision` method // https://tc39.es/ecma262/#sec-number.prototype.toprecision $$39({ target: 'Number', proto: true, forced: FORCED$i }, { toPrecision: function toPrecision(precision) { return precision === undefined ? nativeToPrecision.call(thisNumberValue(this)) : nativeToPrecision.call(thisNumberValue(this), precision); } }); var DESCRIPTORS$m = descriptors; var fails$D = fails$15; var objectKeys$2 = objectKeys$5; var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols; var propertyIsEnumerableModule = objectPropertyIsEnumerable; var toObject$j = toObject$z; 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$6 = Object.defineProperty; // `Object.assign` method // https://tc39.es/ecma262/#sec-object.assign var objectAssign = !$assign || fails$D(function () { // should have correct order of operations (Edge bug) if (DESCRIPTORS$m && $assign({ b: 1 }, $assign(defineProperty$6({}, 'a', { enumerable: true, get: function () { defineProperty$6(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(); var alphabet = 'abcdefghijklmnopqrst'; A[symbol] = 7; alphabet.split('').forEach(function (chr) { B[chr] = chr; }); return $assign({}, A)[symbol] != 7 || objectKeys$2($assign({}, B)).join('') != alphabet; }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length` var T = toObject$j(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 ? objectKeys$2(S).concat(getOwnPropertySymbols(S)) : objectKeys$2(S); var length = keys.length; var j = 0; var key; while (length > j) { key = keys[j++]; if (!DESCRIPTORS$m || propertyIsEnumerable.call(S, key)) T[key] = S[key]; } } return T; } : $assign; var $$38 = _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 $$38({ target: 'Object', stat: true, forced: Object.assign !== assign$1 }, { assign: assign$1 }); var $$37 = _export; var DESCRIPTORS$l = descriptors; var create$9 = objectCreate$1; // `Object.create` method // https://tc39.es/ecma262/#sec-object.create $$37({ target: 'Object', stat: true, sham: !DESCRIPTORS$l }, { create: create$9 }); var global$s = global$R; var fails$C = fails$15; var WEBKIT$1 = engineWebkitVersion; // Forced replacement object prototype accessors methods var objectPrototypeAccessorsForced = !fails$C(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 -- required for testing __defineSetter__.call(null, key, function () { /* empty */ }); delete global$s[key]; }); var $$36 = _export; var DESCRIPTORS$k = descriptors; var FORCED$h = objectPrototypeAccessorsForced; var aCallable$I = aCallable$Q; var toObject$i = toObject$z; var definePropertyModule$4 = objectDefineProperty; // `Object.prototype.__defineGetter__` method // https://tc39.es/ecma262/#sec-object.prototype.__defineGetter__ if (DESCRIPTORS$k) { $$36({ target: 'Object', proto: true, forced: FORCED$h }, { __defineGetter__: function __defineGetter__(P, getter) { definePropertyModule$4.f(toObject$i(this), P, { get: aCallable$I(getter), enumerable: true, configurable: true }); } }); } var $$35 = _export; var DESCRIPTORS$j = descriptors; var defineProperties$2 = objectDefineProperties; // `Object.defineProperties` method // https://tc39.es/ecma262/#sec-object.defineproperties $$35({ target: 'Object', stat: true, forced: !DESCRIPTORS$j, sham: !DESCRIPTORS$j }, { defineProperties: defineProperties$2 }); var $$34 = _export; var DESCRIPTORS$i = descriptors; var objectDefinePropertyModile = objectDefineProperty; // `Object.defineProperty` method // https://tc39.es/ecma262/#sec-object.defineproperty $$34({ target: 'Object', stat: true, forced: !DESCRIPTORS$i, sham: !DESCRIPTORS$i }, { defineProperty: objectDefinePropertyModile.f }); var $$33 = _export; var DESCRIPTORS$h = descriptors; var FORCED$g = objectPrototypeAccessorsForced; var aCallable$H = aCallable$Q; var toObject$h = toObject$z; var definePropertyModule$3 = objectDefineProperty; // `Object.prototype.__defineSetter__` method // https://tc39.es/ecma262/#sec-object.prototype.__defineSetter__ if (DESCRIPTORS$h) { $$33({ target: 'Object', proto: true, forced: FORCED$g }, { __defineSetter__: function __defineSetter__(P, setter) { definePropertyModule$3.f(toObject$h(this), P, { set: aCallable$H(setter), enumerable: true, configurable: true }); } }); } var DESCRIPTORS$g = descriptors; var objectKeys$1 = objectKeys$5; var toIndexedObject$3 = toIndexedObject$d; var propertyIsEnumerable = objectPropertyIsEnumerable.f; // `Object.{ entries, values }` methods implementation var createMethod$3 = function (TO_ENTRIES) { return function (it) { var O = toIndexedObject$3(it); var keys = objectKeys$1(O); var length = keys.length; var i = 0; var result = []; var key; while (length > i) { key = keys[i++]; if (!DESCRIPTORS$g || propertyIsEnumerable.call(O, key)) { result.push(TO_ENTRIES ? [key, O[key]] : O[key]); } } return result; }; }; var objectToArray = { // `Object.entries` method // https://tc39.es/ecma262/#sec-object.entries entries: createMethod$3(true), // `Object.values` method // https://tc39.es/ecma262/#sec-object.values values: createMethod$3(false) }; var $$32 = _export; var $entries = objectToArray.entries; // `Object.entries` method // https://tc39.es/ecma262/#sec-object.entries $$32({ target: 'Object', stat: true }, { entries: function entries(O) { return $entries(O); } }); var $$31 = _export; var FREEZING$3 = freezing; var fails$B = fails$15; var isObject$j = isObject$C; var onFreeze$2 = internalMetadata.exports.onFreeze; // eslint-disable-next-line es/no-object-freeze -- safe var $freeze = Object.freeze; var FAILS_ON_PRIMITIVES$9 = fails$B(function () { $freeze(1); }); // `Object.freeze` method // https://tc39.es/ecma262/#sec-object.freeze $$31({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$9, sham: !FREEZING$3 }, { freeze: function freeze(it) { return $freeze && isObject$j(it) ? $freeze(onFreeze$2(it)) : it; } }); var $$30 = _export; var iterate$E = iterate$I; var createProperty$1 = createProperty$7; // `Object.fromEntries` method // https://github.com/tc39/proposal-object-from-entries $$30({ target: 'Object', stat: true }, { fromEntries: function fromEntries(iterable) { var obj = {}; iterate$E(iterable, function (k, v) { createProperty$1(obj, k, v); }, { AS_ENTRIES: true }); return obj; } }); var $$2$ = _export; var fails$A = fails$15; var toIndexedObject$2 = toIndexedObject$d; var nativeGetOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f; var DESCRIPTORS$f = descriptors; var FAILS_ON_PRIMITIVES$8 = fails$A(function () { nativeGetOwnPropertyDescriptor$1(1); }); var FORCED$f = !DESCRIPTORS$f || FAILS_ON_PRIMITIVES$8; // `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor $$2$({ target: 'Object', stat: true, forced: FORCED$f, sham: !DESCRIPTORS$f }, { getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) { return nativeGetOwnPropertyDescriptor$1(toIndexedObject$2(it), key); } }); var $$2_ = _export; var DESCRIPTORS$e = descriptors; var ownKeys$1 = ownKeys$3; var toIndexedObject$1 = toIndexedObject$d; var getOwnPropertyDescriptorModule$4 = objectGetOwnPropertyDescriptor; var createProperty = createProperty$7; // `Object.getOwnPropertyDescriptors` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors $$2_({ target: 'Object', stat: true, sham: !DESCRIPTORS$e }, { getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { var O = toIndexedObject$1(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(result, key, descriptor); } return result; } }); var $$2Z = _export; var fails$z = fails$15; var getOwnPropertyNames$2 = objectGetOwnPropertyNamesExternal.f; // eslint-disable-next-line es/no-object-getownpropertynames -- required for testing var FAILS_ON_PRIMITIVES$7 = fails$z(function () { return !Object.getOwnPropertyNames(1); }); // `Object.getOwnPropertyNames` method // https://tc39.es/ecma262/#sec-object.getownpropertynames $$2Z({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$7 }, { getOwnPropertyNames: getOwnPropertyNames$2 }); var $$2Y = _export; var fails$y = fails$15; var toObject$g = toObject$z; var nativeGetPrototypeOf = objectGetPrototypeOf$1; var CORRECT_PROTOTYPE_GETTER$1 = correctPrototypeGetter; var FAILS_ON_PRIMITIVES$6 = fails$y(function () { nativeGetPrototypeOf(1); }); // `Object.getPrototypeOf` method // https://tc39.es/ecma262/#sec-object.getprototypeof $$2Y({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$6, sham: !CORRECT_PROTOTYPE_GETTER$1 }, { getPrototypeOf: function getPrototypeOf(it) { return nativeGetPrototypeOf(toObject$g(it)); } }); var $$2X = _export; var hasOwn$9 = hasOwnProperty_1; // `Object.hasOwn` method // https://github.com/tc39/proposal-accessible-object-hasownproperty $$2X({ target: 'Object', stat: true }, { hasOwn: hasOwn$9 }); // `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 $$2W = _export; var is = sameValue$1; // `Object.is` method // https://tc39.es/ecma262/#sec-object.is $$2W({ target: 'Object', stat: true }, { is: is }); var $$2V = _export; var fails$x = fails$15; var isObject$i = isObject$C; // eslint-disable-next-line es/no-object-isextensible -- safe var $isExtensible = Object.isExtensible; var FAILS_ON_PRIMITIVES$5 = fails$x(function () { $isExtensible(1); }); // `Object.isExtensible` method // https://tc39.es/ecma262/#sec-object.isextensible $$2V({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$5 }, { isExtensible: function isExtensible(it) { return isObject$i(it) ? $isExtensible ? $isExtensible(it) : true : false; } }); var $$2U = _export; var fails$w = fails$15; var isObject$h = isObject$C; // eslint-disable-next-line es/no-object-isfrozen -- safe var $isFrozen = Object.isFrozen; var FAILS_ON_PRIMITIVES$4 = fails$w(function () { $isFrozen(1); }); // `Object.isFrozen` method // https://tc39.es/ecma262/#sec-object.isfrozen $$2U({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$4 }, { isFrozen: function isFrozen(it) { return isObject$h(it) ? $isFrozen ? $isFrozen(it) : false : true; } }); var $$2T = _export; var fails$v = fails$15; var isObject$g = isObject$C; // eslint-disable-next-line es/no-object-issealed -- safe var $isSealed = Object.isSealed; var FAILS_ON_PRIMITIVES$3 = fails$v(function () { $isSealed(1); }); // `Object.isSealed` method // https://tc39.es/ecma262/#sec-object.issealed $$2T({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$3 }, { isSealed: function isSealed(it) { return isObject$g(it) ? $isSealed ? $isSealed(it) : false : true; } }); var $$2S = _export; var toObject$f = toObject$z; var nativeKeys = objectKeys$5; var fails$u = fails$15; var FAILS_ON_PRIMITIVES$2 = fails$u(function () { nativeKeys(1); }); // `Object.keys` method // https://tc39.es/ecma262/#sec-object.keys $$2S({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$2 }, { keys: function keys(it) { return nativeKeys(toObject$f(it)); } }); var $$2R = _export; var DESCRIPTORS$d = descriptors; var FORCED$e = objectPrototypeAccessorsForced; var toObject$e = toObject$z; var toPropertyKey$4 = toPropertyKey$9; var getPrototypeOf$7 = objectGetPrototypeOf$1; var getOwnPropertyDescriptor$5 = objectGetOwnPropertyDescriptor.f; // `Object.prototype.__lookupGetter__` method // https://tc39.es/ecma262/#sec-object.prototype.__lookupGetter__ if (DESCRIPTORS$d) { $$2R({ target: 'Object', proto: true, forced: FORCED$e }, { __lookupGetter__: function __lookupGetter__(P) { var O = toObject$e(this); var key = toPropertyKey$4(P); var desc; do { if (desc = getOwnPropertyDescriptor$5(O, key)) return desc.get; } while (O = getPrototypeOf$7(O)); } }); } var $$2Q = _export; var DESCRIPTORS$c = descriptors; var FORCED$d = objectPrototypeAccessorsForced; var toObject$d = toObject$z; var toPropertyKey$3 = toPropertyKey$9; var getPrototypeOf$6 = objectGetPrototypeOf$1; var getOwnPropertyDescriptor$4 = objectGetOwnPropertyDescriptor.f; // `Object.prototype.__lookupSetter__` method // https://tc39.es/ecma262/#sec-object.prototype.__lookupSetter__ if (DESCRIPTORS$c) { $$2Q({ target: 'Object', proto: true, forced: FORCED$d }, { __lookupSetter__: function __lookupSetter__(P) { var O = toObject$d(this); var key = toPropertyKey$3(P); var desc; do { if (desc = getOwnPropertyDescriptor$4(O, key)) return desc.set; } while (O = getPrototypeOf$6(O)); } }); } var $$2P = _export; var isObject$f = isObject$C; var onFreeze$1 = internalMetadata.exports.onFreeze; var FREEZING$2 = freezing; var fails$t = fails$15; // eslint-disable-next-line es/no-object-preventextensions -- safe var $preventExtensions = Object.preventExtensions; var FAILS_ON_PRIMITIVES$1 = fails$t(function () { $preventExtensions(1); }); // `Object.preventExtensions` method // https://tc39.es/ecma262/#sec-object.preventextensions $$2P({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$1, sham: !FREEZING$2 }, { preventExtensions: function preventExtensions(it) { return $preventExtensions && isObject$f(it) ? $preventExtensions(onFreeze$1(it)) : it; } }); var $$2O = _export; var isObject$e = isObject$C; var onFreeze = internalMetadata.exports.onFreeze; var FREEZING$1 = freezing; var fails$s = fails$15; // eslint-disable-next-line es/no-object-seal -- safe var $seal = Object.seal; var FAILS_ON_PRIMITIVES = fails$s(function () { $seal(1); }); // `Object.seal` method // https://tc39.es/ecma262/#sec-object.seal $$2O({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING$1 }, { seal: function seal(it) { return $seal && isObject$e(it) ? $seal(onFreeze(it)) : it; } }); var $$2N = _export; var setPrototypeOf$2 = objectSetPrototypeOf$1; // `Object.setPrototypeOf` method // https://tc39.es/ecma262/#sec-object.setprototypeof $$2N({ target: 'Object', stat: true }, { setPrototypeOf: setPrototypeOf$2 }); var TO_STRING_TAG_SUPPORT$1 = toStringTagSupport; var classof$5 = classof$b; // `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$5(this) + ']'; }; var TO_STRING_TAG_SUPPORT = toStringTagSupport; var redefine$a = redefine$l.exports; var toString$j = objectToString; // `Object.prototype.toString` method // https://tc39.es/ecma262/#sec-object.prototype.tostring if (!TO_STRING_TAG_SUPPORT) { redefine$a(Object.prototype, 'toString', toString$j, { unsafe: true }); } var $$2M = _export; var $values = objectToArray.values; // `Object.values` method // https://tc39.es/ecma262/#sec-object.values $$2M({ target: 'Object', stat: true }, { values: function values(O) { return $values(O); } }); var $$2L = _export; var $parseFloat = numberParseFloat; // `parseFloat` method // https://tc39.es/ecma262/#sec-parsefloat-string $$2L({ global: true, forced: parseFloat != $parseFloat }, { parseFloat: $parseFloat }); var $$2K = _export; var $parseInt = numberParseInt; // `parseInt` method // https://tc39.es/ecma262/#sec-parseint-string-radix $$2K({ global: true, forced: parseInt != $parseInt }, { parseInt: $parseInt }); var global$r = global$R; var nativePromiseConstructor = global$r.Promise; var userAgent$4 = engineUserAgent; var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$4); var global$q = global$R; var isCallable$d = isCallable$z; var fails$r = fails$15; var bind$k = functionBindContext; var html = html$2; var createElement = documentCreateElement$2; var IS_IOS$1 = engineIsIos; var IS_NODE$3 = engineIsNode; var set$1 = global$q.setImmediate; var clear = global$q.clearImmediate; var process$3 = global$q.process; var MessageChannel = global$q.MessageChannel; var Dispatch = global$q.Dispatch; var counter = 0; var queue = {}; var ONREADYSTATECHANGE = 'onreadystatechange'; var location, defer, channel, port; try { // Deno throws a ReferenceError on `location` access without `--location` flag location = global$q.location; } catch (error) { /* empty */ } var run = function (id) { // eslint-disable-next-line no-prototype-builtins -- safe if (queue.hasOwnProperty(id)) { var fn = queue[id]; delete queue[id]; fn(); } }; var runner = function (id) { return function () { run(id); }; }; var listener = function (event) { run(event.data); }; var post = function (id) { // old engines have not location.origin global$q.postMessage(String(id), location.protocol + '//' + location.host); }; // Node.js 0.9+ & IE10+ has setImmediate, otherwise: if (!set$1 || !clear) { set$1 = function setImmediate(fn) { var args = []; var argumentsLength = arguments.length; var i = 1; while (argumentsLength > i) args.push(arguments[i++]); queue[++counter] = function () { // eslint-disable-next-line no-new-func -- spec requirement (isCallable$d(fn) ? fn : Function(fn)).apply(undefined, args); }; defer(counter); return counter; }; clear = function clearImmediate(id) { delete queue[id]; }; // Node.js 0.8- if (IS_NODE$3) { 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 = listener; defer = bind$k(port.postMessage, port, 1); // Browsers with postMessage, skip WebWorkers // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' } else if ( global$q.addEventListener && isCallable$d(global$q.postMessage) && !global$q.importScripts && location && location.protocol !== 'file:' && !fails$r(post) ) { defer = post; global$q.addEventListener('message', listener, 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$2 = { set: set$1, clear: clear }; var userAgent$3 = engineUserAgent; var global$p = global$R; var engineIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$3) && global$p.Pebble !== undefined; var userAgent$2 = engineUserAgent; var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent$2); var global$o = global$R; var getOwnPropertyDescriptor$3 = objectGetOwnPropertyDescriptor.f; var macrotask = task$2.set; var IS_IOS = engineIsIos; var IS_IOS_PEBBLE = engineIsIosPebble; var IS_WEBOS_WEBKIT = engineIsWebosWebkit; var IS_NODE$2 = engineIsNode; var MutationObserver = global$o.MutationObserver || global$o.WebKitMutationObserver; var document$2 = global$o.document; var process$2 = global$o.process; var Promise$4 = global$o.Promise; // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask` var queueMicrotaskDescriptor = getOwnPropertyDescriptor$3(global$o, 'queueMicrotask'); var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value; var flush, head, last, notify$1, toggle, node, promise, then; // modern engines have queueMicrotask method if (!queueMicrotask) { flush = function () { var parent, fn; if (IS_NODE$2 && (parent = process$2.domain)) parent.exit(); while (head) { fn = head.fn; head = head.next; try { fn(); } catch (error) { if (head) notify$1(); else last = undefined; throw error; } } last = undefined; 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$2 && !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$4 && Promise$4.resolve) { // Promise.resolve without an argument throws an error in LG WebOS 2 promise = Promise$4.resolve(undefined); // workaround of WebKit ~ iOS Safari 10.1 bug promise.constructor = Promise$4; then = promise.then; notify$1 = function () { then.call(promise, flush); }; // Node.js without promises } else if (IS_NODE$2) { notify$1 = function () { process$2.nextTick(flush); }; // for other environments - macrotask based on: // - setImmediate // - MessageChannel // - window.postMessag // - onreadystatechange // - setTimeout } else { notify$1 = function () { // strange IE + webpack dev server bug - use .call(global) macrotask.call(global$o, flush); }; } } var microtask$2 = queueMicrotask || function (fn) { var task = { fn: fn, next: undefined }; if (last) last.next = task; if (!head) { head = task; notify$1(); } last = task; }; var newPromiseCapability$2 = {}; var aCallable$G = aCallable$Q; var PromiseCapability = function (C) { var resolve, reject; this.promise = new C(function ($$resolve, $$reject) { if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); resolve = $$resolve; reject = $$reject; }); this.resolve = aCallable$G(resolve); this.reject = aCallable$G(reject); }; // `NewPromiseCapability` abstract operation // https://tc39.es/ecma262/#sec-newpromisecapability newPromiseCapability$2.f = function (C) { return new PromiseCapability(C); }; var anObject$1o = anObject$1C; var isObject$d = isObject$C; var newPromiseCapability$1 = newPromiseCapability$2; var promiseResolve$2 = function (C, x) { anObject$1o(C); if (isObject$d(x) && x.constructor === C) return x; var promiseCapability = newPromiseCapability$1.f(C); var resolve = promiseCapability.resolve; resolve(x); return promiseCapability.promise; }; var global$n = global$R; var hostReportErrors$2 = function (a, b) { var console = global$n.console; if (console && console.error) { arguments.length === 1 ? console.error(a) : console.error(a, b); } }; var perform$4 = function (exec) { try { return { error: false, value: exec() }; } catch (error) { return { error: true, value: error }; } }; var engineIsBrowser = typeof window == 'object'; var $$2J = _export; var global$m = global$R; var getBuiltIn$p = getBuiltIn$y; var NativePromise$1 = nativePromiseConstructor; var redefine$9 = redefine$l.exports; var redefineAll$7 = redefineAll$a; var setPrototypeOf$1 = objectSetPrototypeOf$1; var setToStringTag$3 = setToStringTag$b; var setSpecies$3 = setSpecies$7; var aCallable$F = aCallable$Q; var isCallable$c = isCallable$z; var isObject$c = isObject$C; var anInstance$7 = anInstance$b; var inspectSource = inspectSource$4; var iterate$D = iterate$I; var checkCorrectnessOfIteration$1 = checkCorrectnessOfIteration$4; var speciesConstructor$d = speciesConstructor$f; var task$1 = task$2.set; var microtask$1 = microtask$2; var promiseResolve$1 = promiseResolve$2; var hostReportErrors$1 = hostReportErrors$2; var newPromiseCapabilityModule$3 = newPromiseCapability$2; var perform$3 = perform$4; var InternalStateModule$e = internalState; var isForced$1 = isForced_1; var wellKnownSymbol$k = wellKnownSymbol$G; var IS_BROWSER = engineIsBrowser; var IS_NODE$1 = engineIsNode; var V8_VERSION = engineV8Version; var SPECIES$1 = wellKnownSymbol$k('species'); var PROMISE = 'Promise'; var getInternalState$e = InternalStateModule$e.get; var setInternalState$e = InternalStateModule$e.set; var getInternalPromiseState = InternalStateModule$e.getterFor(PROMISE); var NativePromisePrototype = NativePromise$1 && NativePromise$1.prototype; var PromiseConstructor = NativePromise$1; var PromiseConstructorPrototype = NativePromisePrototype; var TypeError$1 = global$m.TypeError; var document$1 = global$m.document; var process$1 = global$m.process; var newPromiseCapability = newPromiseCapabilityModule$3.f; var newGenericPromiseCapability = newPromiseCapability; var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$m.dispatchEvent); var NATIVE_REJECTION_EVENT = isCallable$c(global$m.PromiseRejectionEvent); var UNHANDLED_REJECTION = 'unhandledrejection'; var REJECTION_HANDLED = 'rejectionhandled'; var PENDING = 0; var FULFILLED = 1; var REJECTED = 2; var HANDLED = 1; var UNHANDLED = 2; var SUBCLASSING = false; var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen; var FORCED$c = isForced$1(PROMISE, function () { var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(PromiseConstructor); var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(PromiseConstructor); // 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 >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false; // Detect correctness of subclassing with @@species support var promise = new PromiseConstructor(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 && !NATIVE_REJECTION_EVENT; }); var INCORRECT_ITERATION = FORCED$c || !checkCorrectnessOfIteration$1(function (iterable) { PromiseConstructor.all(iterable)['catch'](function () { /* empty */ }); }); // helpers var isThenable = function (it) { var then; return isObject$c(it) && isCallable$c(then = it.then) ? then : false; }; var notify = function (state, isReject) { if (state.notified) return; state.notified = true; var chain = state.reactions; microtask$1(function () { var value = state.value; var ok = state.state == FULFILLED; var index = 0; // variable length - can't use forEach while (chain.length > index) { var reaction = chain[index++]; 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$1('Promise-chain cycle')); } else if (then = isThenable(result)) { then.call(result, resolve, reject); } else resolve(result); } else reject(value); } catch (error) { if (domain && !exited) domain.exit(); reject(error); } } state.reactions = []; 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$m.dispatchEvent(event); } else event = { promise: promise, reason: reason }; if (!NATIVE_REJECTION_EVENT && (handler = global$m['on' + name])) handler(event); else if (name === UNHANDLED_REJECTION) hostReportErrors$1('Unhandled promise rejection', reason); }; var onUnhandled = function (state) { task$1.call(global$m, function () { var promise = state.facade; var value = state.value; var IS_UNHANDLED = isUnhandled(state); var result; if (IS_UNHANDLED) { result = perform$3(function () { if (IS_NODE$1) { 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$1 || isUnhandled(state) ? UNHANDLED : HANDLED; if (result.error) throw result.value; } }); }; var isUnhandled = function (state) { return state.rejection !== HANDLED && !state.parent; }; var onHandleUnhandled = function (state) { task$1.call(global$m, function () { var promise = state.facade; if (IS_NODE$1) { process$1.emit('rejectionHandled', promise); } else dispatchEvent(REJECTION_HANDLED, promise, state.value); }); }; var bind$j = 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$1("Promise can't be resolved itself"); var then = isThenable(value); if (then) { microtask$1(function () { var wrapper = { done: false }; try { then.call(value, bind$j(internalResolve, wrapper, state), bind$j(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$c) { // 25.4.3.1 Promise(executor) PromiseConstructor = function Promise(executor) { anInstance$7(this, PromiseConstructor, PROMISE); aCallable$F(executor); Internal.call(this); var state = getInternalState$e(this); try { executor(bind$j(internalResolve, state), bind$j(internalReject, state)); } catch (error) { internalReject(state, error); } }; PromiseConstructorPrototype = PromiseConstructor.prototype; // eslint-disable-next-line no-unused-vars -- required for `.length` Internal = function Promise(executor) { setInternalState$e(this, { type: PROMISE, done: false, notified: false, parent: false, reactions: [], rejection: false, state: PENDING, value: undefined }); }; Internal.prototype = redefineAll$7(PromiseConstructorPrototype, { // `Promise.prototype.then` method // https://tc39.es/ecma262/#sec-promise.prototype.then then: function then(onFulfilled, onRejected) { var state = getInternalPromiseState(this); var reaction = newPromiseCapability(speciesConstructor$d(this, PromiseConstructor)); reaction.ok = isCallable$c(onFulfilled) ? onFulfilled : true; reaction.fail = isCallable$c(onRejected) && onRejected; reaction.domain = IS_NODE$1 ? process$1.domain : undefined; state.parent = true; state.reactions.push(reaction); if (state.state != PENDING) notify(state, false); return reaction.promise; }, // `Promise.prototype.catch` method // https://tc39.es/ecma262/#sec-promise.prototype.catch 'catch': function (onRejected) { return this.then(undefined, onRejected); } }); OwnPromiseCapability = function () { var promise = new Internal(); var state = getInternalState$e(promise); this.promise = promise; this.resolve = bind$j(internalResolve, state); this.reject = bind$j(internalReject, state); }; newPromiseCapabilityModule$3.f = newPromiseCapability = function (C) { return C === PromiseConstructor || C === PromiseWrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C); }; if (isCallable$c(NativePromise$1) && NativePromisePrototype !== Object.prototype) { nativeThen = NativePromisePrototype.then; if (!SUBCLASSING) { // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs redefine$9(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) { var that = this; return new PromiseConstructor(function (resolve, reject) { nativeThen.call(that, resolve, reject); }).then(onFulfilled, onRejected); // https://github.com/zloirock/core-js/issues/640 }, { unsafe: true }); // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then` redefine$9(NativePromisePrototype, 'catch', PromiseConstructorPrototype['catch'], { unsafe: true }); } // make `.constructor === Promise` work for native promise-based APIs try { delete NativePromisePrototype.constructor; } catch (error) { /* empty */ } // make `instanceof Promise` work for native promise-based APIs if (setPrototypeOf$1) { setPrototypeOf$1(NativePromisePrototype, PromiseConstructorPrototype); } } } $$2J({ global: true, wrap: true, forced: FORCED$c }, { Promise: PromiseConstructor }); setToStringTag$3(PromiseConstructor, PROMISE, false); setSpecies$3(PROMISE); PromiseWrapper = getBuiltIn$p(PROMISE); // statics $$2J({ target: PROMISE, stat: true, forced: FORCED$c }, { // `Promise.reject` method // https://tc39.es/ecma262/#sec-promise.reject reject: function reject(r) { var capability = newPromiseCapability(this); capability.reject.call(undefined, r); return capability.promise; } }); $$2J({ target: PROMISE, stat: true, forced: FORCED$c }, { // `Promise.resolve` method // https://tc39.es/ecma262/#sec-promise.resolve resolve: function resolve(x) { return promiseResolve$1(this, x); } }); $$2J({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, { // `Promise.all` method // https://tc39.es/ecma262/#sec-promise.all all: function all(iterable) { var C = this; var capability = newPromiseCapability(C); var resolve = capability.resolve; var reject = capability.reject; var result = perform$3(function () { var $promiseResolve = aCallable$F(C.resolve); var values = []; var counter = 0; var remaining = 1; iterate$D(iterable, function (promise) { var index = counter++; var alreadyCalled = false; values.push(undefined); remaining++; $promiseResolve.call(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; }, // `Promise.race` method // https://tc39.es/ecma262/#sec-promise.race race: function race(iterable) { var C = this; var capability = newPromiseCapability(C); var reject = capability.reject; var result = perform$3(function () { var $promiseResolve = aCallable$F(C.resolve); iterate$D(iterable, function (promise) { $promiseResolve.call(C, promise).then(capability.resolve, reject); }); }); if (result.error) reject(result.value); return capability.promise; } }); var $$2I = _export; var aCallable$E = aCallable$Q; var newPromiseCapabilityModule$2 = newPromiseCapability$2; var perform$2 = perform$4; var iterate$C = iterate$I; // `Promise.allSettled` method // https://tc39.es/ecma262/#sec-promise.allsettled $$2I({ target: 'Promise', stat: true }, { allSettled: function allSettled(iterable) { var C = this; var capability = newPromiseCapabilityModule$2.f(C); var resolve = capability.resolve; var reject = capability.reject; var result = perform$2(function () { var promiseResolve = aCallable$E(C.resolve); var values = []; var counter = 0; var remaining = 1; iterate$C(iterable, function (promise) { var index = counter++; var alreadyCalled = false; values.push(undefined); remaining++; promiseResolve.call(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 $$2H = _export; var aCallable$D = aCallable$Q; var getBuiltIn$o = getBuiltIn$y; var newPromiseCapabilityModule$1 = newPromiseCapability$2; var perform$1 = perform$4; var iterate$B = iterate$I; var PROMISE_ANY_ERROR = 'No one promise resolved'; // `Promise.any` method // https://tc39.es/ecma262/#sec-promise.any $$2H({ target: 'Promise', stat: true }, { any: function any(iterable) { var C = this; var capability = newPromiseCapabilityModule$1.f(C); var resolve = capability.resolve; var reject = capability.reject; var result = perform$1(function () { var promiseResolve = aCallable$D(C.resolve); var errors = []; var counter = 0; var remaining = 1; var alreadyResolved = false; iterate$B(iterable, function (promise) { var index = counter++; var alreadyRejected = false; errors.push(undefined); remaining++; promiseResolve.call(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 (getBuiltIn$o('AggregateError'))(errors, PROMISE_ANY_ERROR)); }); }); --remaining || reject(new (getBuiltIn$o('AggregateError'))(errors, PROMISE_ANY_ERROR)); }); if (result.error) reject(result.value); return capability.promise; } }); var $$2G = _export; var NativePromise = nativePromiseConstructor; var fails$q = fails$15; var getBuiltIn$n = getBuiltIn$y; var isCallable$b = isCallable$z; var speciesConstructor$c = speciesConstructor$f; var promiseResolve = promiseResolve$2; var redefine$8 = redefine$l.exports; // Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829 var NON_GENERIC = !!NativePromise && fails$q(function () { NativePromise.prototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ }); }); // `Promise.prototype.finally` method // https://tc39.es/ecma262/#sec-promise.prototype.finally $$2G({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, { 'finally': function (onFinally) { var C = speciesConstructor$c(this, getBuiltIn$n('Promise')); var isFunction = isCallable$b(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$b(NativePromise)) { var method = getBuiltIn$n('Promise').prototype['finally']; if (NativePromise.prototype['finally'] !== method) { redefine$8(NativePromise.prototype, 'finally', method, { unsafe: true }); } } var $$2F = _export; var getBuiltIn$m = getBuiltIn$y; var aCallable$C = aCallable$Q; var anObject$1n = anObject$1C; var fails$p = fails$15; var nativeApply = getBuiltIn$m('Reflect', 'apply'); var functionApply = Function.apply; // MS Edge argumentsList argument is optional var OPTIONAL_ARGUMENTS_LIST = !fails$p(function () { nativeApply(function () { /* empty */ }); }); // `Reflect.apply` method // https://tc39.es/ecma262/#sec-reflect.apply $$2F({ target: 'Reflect', stat: true, forced: OPTIONAL_ARGUMENTS_LIST }, { apply: function apply(target, thisArgument, argumentsList) { aCallable$C(target); anObject$1n(argumentsList); return nativeApply ? nativeApply(target, thisArgument, argumentsList) : functionApply.call(target, thisArgument, argumentsList); } }); var $$2E = _export; var getBuiltIn$l = getBuiltIn$y; var aConstructor$3 = aConstructor$5; var anObject$1m = anObject$1C; var isObject$b = isObject$C; var create$8 = objectCreate$1; var bind$i = functionBind; var fails$o = fails$15; var nativeConstruct = getBuiltIn$l('Reflect', 'construct'); // `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$o(function () { function F() { /* empty */ } return !(nativeConstruct(function () { /* empty */ }, [], F) instanceof F); }); var ARGS_BUG = !fails$o(function () { nativeConstruct(function () { /* empty */ }); }); var FORCED$b = NEW_TARGET_BUG || ARGS_BUG; $$2E({ target: 'Reflect', stat: true, forced: FORCED$b, sham: FORCED$b }, { construct: function construct(Target, args /* , newTarget */) { aConstructor$3(Target); anObject$1m(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]; $args.push.apply($args, args); return new (bind$i.apply(Target, $args))(); } // with altered newTarget, not support built-in constructors var proto = newTarget.prototype; var instance = create$8(isObject$b(proto) ? proto : Object.prototype); var result = Function.apply.call(Target, instance, args); return isObject$b(result) ? result : instance; } }); var $$2D = _export; var DESCRIPTORS$b = descriptors; var anObject$1l = anObject$1C; var toPropertyKey$2 = toPropertyKey$9; var definePropertyModule$2 = objectDefineProperty; var fails$n = fails$15; // MS Edge has broken Reflect.defineProperty - throwing instead of returning false var ERROR_INSTEAD_OF_FALSE = fails$n(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 $$2D({ target: 'Reflect', stat: true, forced: ERROR_INSTEAD_OF_FALSE, sham: !DESCRIPTORS$b }, { defineProperty: function defineProperty(target, propertyKey, attributes) { anObject$1l(target); var key = toPropertyKey$2(propertyKey); anObject$1l(attributes); try { definePropertyModule$2.f(target, key, attributes); return true; } catch (error) { return false; } } }); var $$2C = _export; var anObject$1k = anObject$1C; var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f; // `Reflect.deleteProperty` method // https://tc39.es/ecma262/#sec-reflect.deleteproperty $$2C({ target: 'Reflect', stat: true }, { deleteProperty: function deleteProperty(target, propertyKey) { var descriptor = getOwnPropertyDescriptor$2(anObject$1k(target), propertyKey); return descriptor && !descriptor.configurable ? false : delete target[propertyKey]; } }); var hasOwn$8 = hasOwnProperty_1; var isDataDescriptor$2 = function (descriptor) { return descriptor !== undefined && (hasOwn$8(descriptor, 'value') || hasOwn$8(descriptor, 'writable')); }; var $$2B = _export; var isObject$a = isObject$C; var anObject$1j = anObject$1C; var isDataDescriptor$1 = isDataDescriptor$2; var getOwnPropertyDescriptorModule$3 = objectGetOwnPropertyDescriptor; var getPrototypeOf$5 = objectGetPrototypeOf$1; // `Reflect.get` method // https://tc39.es/ecma262/#sec-reflect.get function get(target, propertyKey /* , receiver */) { var receiver = arguments.length < 3 ? target : arguments[2]; var descriptor, prototype; if (anObject$1j(target) === receiver) return target[propertyKey]; descriptor = getOwnPropertyDescriptorModule$3.f(target, propertyKey); if (descriptor) return isDataDescriptor$1(descriptor) ? descriptor.value : descriptor.get === undefined ? undefined : descriptor.get.call(receiver); if (isObject$a(prototype = getPrototypeOf$5(target))) return get(prototype, propertyKey, receiver); } $$2B({ target: 'Reflect', stat: true }, { get: get }); var $$2A = _export; var DESCRIPTORS$a = descriptors; var anObject$1i = anObject$1C; var getOwnPropertyDescriptorModule$2 = objectGetOwnPropertyDescriptor; // `Reflect.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-reflect.getownpropertydescriptor $$2A({ target: 'Reflect', stat: true, sham: !DESCRIPTORS$a }, { getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { return getOwnPropertyDescriptorModule$2.f(anObject$1i(target), propertyKey); } }); var $$2z = _export; var anObject$1h = anObject$1C; var objectGetPrototypeOf = objectGetPrototypeOf$1; var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter; // `Reflect.getPrototypeOf` method // https://tc39.es/ecma262/#sec-reflect.getprototypeof $$2z({ target: 'Reflect', stat: true, sham: !CORRECT_PROTOTYPE_GETTER }, { getPrototypeOf: function getPrototypeOf(target) { return objectGetPrototypeOf(anObject$1h(target)); } }); var $$2y = _export; // `Reflect.has` method // https://tc39.es/ecma262/#sec-reflect.has $$2y({ target: 'Reflect', stat: true }, { has: function has(target, propertyKey) { return propertyKey in target; } }); var $$2x = _export; var anObject$1g = anObject$1C; // eslint-disable-next-line es/no-object-isextensible -- safe var objectIsExtensible = Object.isExtensible; // `Reflect.isExtensible` method // https://tc39.es/ecma262/#sec-reflect.isextensible $$2x({ target: 'Reflect', stat: true }, { isExtensible: function isExtensible(target) { anObject$1g(target); return objectIsExtensible ? objectIsExtensible(target) : true; } }); var $$2w = _export; var ownKeys = ownKeys$3; // `Reflect.ownKeys` method // https://tc39.es/ecma262/#sec-reflect.ownkeys $$2w({ target: 'Reflect', stat: true }, { ownKeys: ownKeys }); var $$2v = _export; var getBuiltIn$k = getBuiltIn$y; var anObject$1f = anObject$1C; var FREEZING = freezing; // `Reflect.preventExtensions` method // https://tc39.es/ecma262/#sec-reflect.preventextensions $$2v({ target: 'Reflect', stat: true, sham: !FREEZING }, { preventExtensions: function preventExtensions(target) { anObject$1f(target); try { var objectPreventExtensions = getBuiltIn$k('Object', 'preventExtensions'); if (objectPreventExtensions) objectPreventExtensions(target); return true; } catch (error) { return false; } } }); var $$2u = _export; var anObject$1e = anObject$1C; var isObject$9 = isObject$C; var isDataDescriptor = isDataDescriptor$2; var fails$m = fails$15; var definePropertyModule$1 = objectDefineProperty; var getOwnPropertyDescriptorModule$1 = objectGetOwnPropertyDescriptor; var getPrototypeOf$4 = objectGetPrototypeOf$1; var createPropertyDescriptor$2 = createPropertyDescriptor$9; // `Reflect.set` method // https://tc39.es/ecma262/#sec-reflect.set function set(target, propertyKey, V /* , receiver */) { var receiver = arguments.length < 4 ? target : arguments[3]; var ownDescriptor = getOwnPropertyDescriptorModule$1.f(anObject$1e(target), propertyKey); var existingDescriptor, prototype, setter; if (!ownDescriptor) { if (isObject$9(prototype = getPrototypeOf$4(target))) { return set(prototype, propertyKey, V, receiver); } ownDescriptor = createPropertyDescriptor$2(0); } if (isDataDescriptor(ownDescriptor)) { if (ownDescriptor.writable === false || !isObject$9(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$2(0, V)); } else { setter = ownDescriptor.set; if (setter === undefined) return false; setter.call(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$m(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; }); $$2u({ target: 'Reflect', stat: true, forced: MS_EDGE_BUG }, { set: set }); var $$2t = _export; var anObject$1d = anObject$1C; var aPossiblePrototype = aPossiblePrototype$2; var objectSetPrototypeOf = objectSetPrototypeOf$1; // `Reflect.setPrototypeOf` method // https://tc39.es/ecma262/#sec-reflect.setprototypeof if (objectSetPrototypeOf) $$2t({ target: 'Reflect', stat: true }, { setPrototypeOf: function setPrototypeOf(target, proto) { anObject$1d(target); aPossiblePrototype(proto); try { objectSetPrototypeOf(target, proto); return true; } catch (error) { return false; } } }); var $$2s = _export; var global$l = global$R; var setToStringTag$2 = setToStringTag$b; $$2s({ global: true }, { Reflect: {} }); // Reflect[@@toStringTag] property // https://tc39.es/ecma262/#sec-reflect-@@tostringtag setToStringTag$2(global$l.Reflect, 'Reflect', true); var isObject$8 = isObject$C; var classof$4 = classofRaw$1; var wellKnownSymbol$j = wellKnownSymbol$G; var MATCH$2 = wellKnownSymbol$j('match'); // `IsRegExp` abstract operation // https://tc39.es/ecma262/#sec-isregexp var isRegexp = function (it) { var isRegExp; return isObject$8(it) && ((isRegExp = it[MATCH$2]) !== undefined ? !!isRegExp : classof$4(it) == 'RegExp'); }; var anObject$1c = anObject$1C; // `RegExp.prototype.flags` getter implementation // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags var regexpFlags$1 = function () { var that = anObject$1c(this); var result = ''; 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.sticky) result += 'y'; return result; }; var regexpStickyHelpers = {}; var fails$l = fails$15; var global$k = global$R; // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError var $RegExp$2 = global$k.RegExp; regexpStickyHelpers.UNSUPPORTED_Y = fails$l(function () { var re = $RegExp$2('a', 'y'); re.lastIndex = 2; return re.exec('abcd') != null; }); regexpStickyHelpers.BROKEN_CARET = fails$l(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 fails$k = fails$15; var global$j = global$R; // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError var $RegExp$1 = global$j.RegExp; var regexpUnsupportedDotAll = fails$k(function () { var re = $RegExp$1('.', 's'); return !(re.dotAll && re.exec('\n') && re.flags === 's'); }); var fails$j = fails$15; var global$i = global$R; // babel-minify and Closure Compiler transpiles RegExp('(?b)', 'g') -> /(?b)/g and it causes SyntaxError var $RegExp = global$i.RegExp; var regexpUnsupportedNcg = fails$j(function () { var re = $RegExp('(?b)', 'g'); return re.exec('b').groups.a !== 'b' || 'b'.replace(re, '$c') !== 'bc'; }); var DESCRIPTORS$9 = descriptors; var global$h = global$R; var isForced = isForced_1; var inheritIfRequired$1 = inheritIfRequired$4; var createNonEnumerableProperty$8 = createNonEnumerableProperty$h; var defineProperty$5 = objectDefineProperty.f; var getOwnPropertyNames$1 = objectGetOwnPropertyNames.f; var isRegExp$4 = isRegexp; var toString$i = toString$t; var getFlags = regexpFlags$1; var stickyHelpers$2 = regexpStickyHelpers; var redefine$7 = redefine$l.exports; var fails$i = fails$15; var hasOwn$7 = hasOwnProperty_1; var enforceInternalState = internalState.enforce; var setSpecies$2 = setSpecies$7; var wellKnownSymbol$i = wellKnownSymbol$G; var UNSUPPORTED_DOT_ALL$2 = regexpUnsupportedDotAll; var UNSUPPORTED_NCG$1 = regexpUnsupportedNcg; var MATCH$1 = wellKnownSymbol$i('match'); var NativeRegExp = global$h.RegExp; var RegExpPrototype$6 = NativeRegExp.prototype; // TODO: Use only propper 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 UNSUPPORTED_Y$3 = stickyHelpers$2.UNSUPPORTED_Y; var BASE_FORCED = DESCRIPTORS$9 && (!CORRECT_NEW || UNSUPPORTED_Y$3 || UNSUPPORTED_DOT_ALL$2 || UNSUPPORTED_NCG$1 || fails$i(function () { re2[MATCH$1] = false; // RegExp constructor can alter flags and IsRegExp works correct with @@match return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || 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 = string.charAt(index); if (chr === '\\') { result += chr + string.charAt(++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 = string.charAt(index); if (chr === '\\') { chr = chr + string.charAt(++index); } else if (chr === ']') { brackets = false; } else if (!brackets) switch (true) { case chr === '[': brackets = true; break; case chr === '(': if (IS_NCG.test(string.slice(index + 1))) { index += 2; ncg = true; } result += chr; groupid++; continue; case chr === '>' && ncg: if (groupname === '' || hasOwn$7(names, groupname)) { throw new SyntaxError('Invalid capture group name'); } names[groupname] = true; named.push([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 = this instanceof RegExpWrapper; 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 || pattern instanceof RegExpWrapper) { pattern = pattern.source; if (flagsAreUndefined) flags = 'flags' in rawPattern ? rawPattern.flags : getFlags.call(rawPattern); } pattern = pattern === undefined ? '' : toString$i(pattern); flags = flags === undefined ? '' : toString$i(flags); rawPattern = pattern; if (UNSUPPORTED_DOT_ALL$2 && 'dotAll' in re1) { dotAll = !!flags && flags.indexOf('s') > -1; if (dotAll) flags = flags.replace(/s/g, ''); } rawFlags = flags; if (UNSUPPORTED_Y$3 && 'sticky' in re1) { sticky = !!flags && flags.indexOf('y') > -1; if (sticky) flags = flags.replace(/y/g, ''); } if (UNSUPPORTED_NCG$1) { handled = handleNCG(pattern); pattern = handled[0]; groups = handled[1]; } result = inheritIfRequired$1(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype$6, RegExpWrapper); if (dotAll || sticky || groups.length) { state = enforceInternalState(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$8(result, 'source', rawPattern === '' ? '(?:)' : rawPattern); } catch (error) { /* empty */ } return result; }; var proxy = function (key) { key in RegExpWrapper || defineProperty$5(RegExpWrapper, key, { configurable: true, get: function () { return NativeRegExp[key]; }, set: function (it) { NativeRegExp[key] = it; } }); }; for (var keys = getOwnPropertyNames$1(NativeRegExp), index = 0; keys.length > index;) { proxy(keys[index++]); } RegExpPrototype$6.constructor = RegExpWrapper; RegExpWrapper.prototype = RegExpPrototype$6; redefine$7(global$h, 'RegExp', RegExpWrapper); } // https://tc39.es/ecma262/#sec-get-regexp-@@species setSpecies$2('RegExp'); var DESCRIPTORS$8 = descriptors; var UNSUPPORTED_DOT_ALL$1 = regexpUnsupportedDotAll; var defineProperty$4 = objectDefineProperty.f; var getInternalState$d = internalState.get; var RegExpPrototype$5 = RegExp.prototype; // `RegExp.prototype.dotAll` getter // https://tc39.es/ecma262/#sec-get-regexp.prototype.dotall if (DESCRIPTORS$8 && UNSUPPORTED_DOT_ALL$1) { defineProperty$4(RegExpPrototype$5, 'dotAll', { configurable: true, get: function () { 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 (this instanceof RegExp) { return !!getInternalState$d(this).dotAll; } throw TypeError('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 toString$h = toString$t; var regexpFlags = regexpFlags$1; var stickyHelpers$1 = regexpStickyHelpers; var shared$2 = shared$7.exports; var create$7 = objectCreate$1; var getInternalState$c = internalState.get; var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll; var UNSUPPORTED_NCG = regexpUnsupportedNcg; var nativeExec = RegExp.prototype.exec; var nativeReplace = shared$2('native-string-replace', String.prototype.replace); var patchedExec = nativeExec; var UPDATES_LAST_INDEX_WRONG = (function () { var re1 = /a/; var re2 = /b*/g; nativeExec.call(re1, 'a'); nativeExec.call(re2, 'a'); return re1.lastIndex !== 0 || re2.lastIndex !== 0; })(); var UNSUPPORTED_Y$2 = stickyHelpers$1.UNSUPPORTED_Y || 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$2 || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG; if (PATCH) { // eslint-disable-next-line max-statements -- TODO patchedExec = function exec(string) { var re = this; var state = getInternalState$c(re); var str = toString$h(string); var raw = state.raw; var result, reCopy, lastIndex, match, i, object, group; if (raw) { raw.lastIndex = re.lastIndex; result = patchedExec.call(raw, str); re.lastIndex = raw.lastIndex; return result; } var groups = state.groups; var sticky = UNSUPPORTED_Y$2 && re.sticky; var flags = regexpFlags.call(re); var source = re.source; var charsAdded = 0; var strCopy = str; if (sticky) { flags = flags.replace('y', ''); if (flags.indexOf('g') === -1) { flags += 'g'; } strCopy = str.slice(re.lastIndex); // Support anchored sticky behavior. if (re.lastIndex > 0 && (!re.multiline || re.multiline && str.charAt(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 = nativeExec.call(sticky ? reCopy : re, strCopy); if (sticky) { if (match) { match.input = match.input.slice(charsAdded); match[0] = match[0].slice(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' work for /(.?)?/ nativeReplace.call(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$7(null); for (i = 0; i < groups.length; i++) { group = groups[i]; object[group[0]] = match[group[1]]; } } return match; }; } var regexpExec$3 = patchedExec; var $$2r = _export; var exec = regexpExec$3; // `RegExp.prototype.exec` method // https://tc39.es/ecma262/#sec-regexp.prototype.exec $$2r({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, { exec: exec }); var DESCRIPTORS$7 = descriptors; var objectDefinePropertyModule = objectDefineProperty; var regExpFlags = regexpFlags$1; var fails$h = fails$15; var FORCED$a = DESCRIPTORS$7 && fails$h(function () { // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe return Object.getOwnPropertyDescriptor(RegExp.prototype, 'flags').get.call({ dotAll: true, sticky: true }) !== 'sy'; }); // `RegExp.prototype.flags` getter // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags if (FORCED$a) objectDefinePropertyModule.f(RegExp.prototype, 'flags', { configurable: true, get: regExpFlags }); var DESCRIPTORS$6 = descriptors; var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y; var defineProperty$3 = objectDefineProperty.f; var getInternalState$b = internalState.get; var RegExpPrototype$4 = RegExp.prototype; // `RegExp.prototype.sticky` getter // https://tc39.es/ecma262/#sec-get-regexp.prototype.sticky if (DESCRIPTORS$6 && UNSUPPORTED_Y$1) { defineProperty$3(RegExpPrototype$4, 'sticky', { configurable: true, get: function () { if (this === RegExpPrototype$4) return undefined; // We can't use InternalStateModule.getterFor because // we don't add metadata for regexps created by a literal. if (this instanceof RegExp) { return !!getInternalState$b(this).sticky; } throw TypeError('Incompatible receiver, RegExp required'); } }); } // TODO: Remove from `core-js@4` since it's moved to entry points var $$2q = _export; var isCallable$a = isCallable$z; var isObject$7 = isObject$C; 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 $$2q({ target: 'RegExp', proto: true, forced: !DELEGATES_TO_EXEC }, { test: function (str) { var exec = this.exec; if (!isCallable$a(exec)) return nativeTest.call(this, str); var result = exec.call(this, str); if (result !== null && !isObject$7(result)) { throw new Error('RegExp exec method returned something other than an Object or null'); } return !!result; } }); var PROPER_FUNCTION_NAME$2 = functionName.PROPER; var redefine$6 = redefine$l.exports; var anObject$1b = anObject$1C; var $toString$2 = toString$t; var fails$g = fails$15; var flags = regexpFlags$1; var TO_STRING = 'toString'; var RegExpPrototype$3 = RegExp.prototype; var nativeToString = RegExpPrototype$3[TO_STRING]; var NOT_GENERIC = fails$g(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; }); // FF44- RegExp#toString has a wrong name var INCORRECT_NAME = PROPER_FUNCTION_NAME$2 && nativeToString.name != TO_STRING; // `RegExp.prototype.toString` method // https://tc39.es/ecma262/#sec-regexp.prototype.tostring if (NOT_GENERIC || INCORRECT_NAME) { redefine$6(RegExp.prototype, TO_STRING, function toString() { var R = anObject$1b(this); var p = $toString$2(R.source); var rf = R.flags; var f = $toString$2(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype$3) ? flags.call(R) : rf); return '/' + p + '/' + f; }, { unsafe: true }); } var collection$2 = collection$4; var collectionStrong = collectionStrong$2; // `Set` constructor // https://tc39.es/ecma262/#sec-set-objects var es_set = collection$2('Set', function (init) { return function Set() { return init(this, arguments.length ? arguments[0] : undefined); }; }, collectionStrong); var $$2p = _export; var requireObjectCoercible$d = requireObjectCoercible$j; var toIntegerOrInfinity$6 = toIntegerOrInfinity$i; var toString$g = toString$t; var fails$f = fails$15; var FORCED$9 = fails$f(function () { return '𠮷'.at(0) !== '\uD842'; }); // `String.prototype.at` method // https://github.com/tc39/proposal-relative-indexing-method $$2p({ target: 'String', proto: true, forced: FORCED$9 }, { at: function at(index) { var S = toString$g(requireObjectCoercible$d(this)); var len = S.length; var relativeIndex = toIntegerOrInfinity$6(index); var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex; return (k < 0 || k >= len) ? undefined : S.charAt(k); } }); var toIntegerOrInfinity$5 = toIntegerOrInfinity$i; var toString$f = toString$t; var requireObjectCoercible$c = requireObjectCoercible$j; var createMethod$2 = function (CONVERT_TO_STRING) { return function ($this, pos) { var S = toString$f(requireObjectCoercible$c($this)); var position = toIntegerOrInfinity$5(pos); var size = S.length; var first, second; if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; first = S.charCodeAt(position); return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? S.charAt(position) : first : CONVERT_TO_STRING ? S.slice(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$2(false), // `String.prototype.at` method // https://github.com/mathiasbynens/String.prototype.at charAt: createMethod$2(true) }; var $$2o = _export; var codeAt$2 = stringMultibyte.codeAt; // `String.prototype.codePointAt` method // https://tc39.es/ecma262/#sec-string.prototype.codepointat $$2o({ target: 'String', proto: true }, { codePointAt: function codePointAt(pos) { return codeAt$2(this, pos); } }); var isRegExp$3 = isRegexp; var notARegexp = function (it) { if (isRegExp$3(it)) { throw TypeError("The method doesn't accept regular expressions"); } return it; }; var wellKnownSymbol$h = wellKnownSymbol$G; var MATCH = wellKnownSymbol$h('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 $$2n = _export; var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f; var toLength$7 = toLength$d; var toString$e = toString$t; var notARegExp$2 = notARegexp; var requireObjectCoercible$b = requireObjectCoercible$j; var correctIsRegExpLogic$2 = correctIsRegexpLogic; // eslint-disable-next-line es/no-string-prototype-endswith -- safe var $endsWith = ''.endsWith; var min$5 = 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$1(String.prototype, 'endsWith'); return descriptor && !descriptor.writable; }(); // `String.prototype.endsWith` method // https://tc39.es/ecma262/#sec-string.prototype.endswith $$2n({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG$1 && !CORRECT_IS_REGEXP_LOGIC$1 }, { endsWith: function endsWith(searchString /* , endPosition = @length */) { var that = toString$e(requireObjectCoercible$b(this)); notARegExp$2(searchString); var endPosition = arguments.length > 1 ? arguments[1] : undefined; var len = that.length; var end = endPosition === undefined ? len : min$5(toLength$7(endPosition), len); var search = toString$e(searchString); return $endsWith ? $endsWith.call(that, search, end) : that.slice(end - search.length, end) === search; } }); var $$2m = _export; var toAbsoluteIndex$1 = toAbsoluteIndex$8; var fromCharCode$1 = String.fromCharCode; // eslint-disable-next-line es/no-string-fromcodepoint -- required for testing var $fromCodePoint = String.fromCodePoint; // length should be 1, old FF problem var INCORRECT_LENGTH = !!$fromCodePoint && $fromCodePoint.length != 1; // `String.fromCodePoint` method // https://tc39.es/ecma262/#sec-string.fromcodepoint $$2m({ target: 'String', stat: true, 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$1(code, 0x10FFFF) !== code) throw RangeError(code + ' is not a valid code point'); elements.push(code < 0x10000 ? fromCharCode$1(code) : fromCharCode$1(((code -= 0x10000) >> 10) + 0xD800, code % 0x400 + 0xDC00) ); } return elements.join(''); } }); var $$2l = _export; var notARegExp$1 = notARegexp; var requireObjectCoercible$a = requireObjectCoercible$j; var toString$d = toString$t; var correctIsRegExpLogic$1 = correctIsRegexpLogic; // `String.prototype.includes` method // https://tc39.es/ecma262/#sec-string.prototype.includes $$2l({ target: 'String', proto: true, forced: !correctIsRegExpLogic$1('includes') }, { includes: function includes(searchString /* , position = 0 */) { return !!~toString$d(requireObjectCoercible$a(this)) .indexOf(toString$d(notARegExp$1(searchString)), arguments.length > 1 ? arguments[1] : undefined); } }); var charAt$3 = stringMultibyte.charAt; var toString$c = toString$t; var InternalStateModule$d = internalState; var defineIterator = defineIterator$3; var STRING_ITERATOR$1 = 'String Iterator'; var setInternalState$d = InternalStateModule$d.set; var getInternalState$a = InternalStateModule$d.getterFor(STRING_ITERATOR$1); // `String.prototype[@@iterator]` method // https://tc39.es/ecma262/#sec-string.prototype-@@iterator defineIterator(String, 'String', function (iterated) { setInternalState$d(this, { type: STRING_ITERATOR$1, string: toString$c(iterated), index: 0 }); // `%StringIteratorPrototype%.next` method // https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next }, function next() { var state = getInternalState$a(this); var string = state.string; var index = state.index; var point; if (index >= string.length) return { value: undefined, done: true }; point = charAt$3(string, index); state.index += point.length; return { value: point, done: false }; }); // TODO: Remove from `core-js@4` since it's moved to entry points var redefine$5 = redefine$l.exports; var regexpExec$2 = regexpExec$3; var fails$e = fails$15; var wellKnownSymbol$g = wellKnownSymbol$G; var createNonEnumerableProperty$7 = createNonEnumerableProperty$h; var SPECIES = wellKnownSymbol$g('species'); var RegExpPrototype$2 = RegExp.prototype; var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) { var SYMBOL = wellKnownSymbol$g(KEY); var DELEGATES_TO_SYMBOL = !fails$e(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$e(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 nativeRegExpMethod = /./[SYMBOL]; var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) { var $exec = regexp.exec; if ($exec === regexpExec$2 || $exec === RegExpPrototype$2.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: nativeRegExpMethod.call(regexp, str, arg2) }; } return { done: true, value: nativeMethod.call(str, regexp, arg2) }; } return { done: false }; }); redefine$5(String.prototype, KEY, methods[0]); redefine$5(RegExpPrototype$2, SYMBOL, methods[1]); } if (SHAM) createNonEnumerableProperty$7(RegExpPrototype$2[SYMBOL], 'sham', true); }; var charAt$2 = stringMultibyte.charAt; // `AdvanceStringIndex` abstract operation // https://tc39.es/ecma262/#sec-advancestringindex var advanceStringIndex$4 = function (S, index, unicode) { return index + (unicode ? charAt$2(S, index).length : 1); }; var anObject$1a = anObject$1C; var isCallable$9 = isCallable$z; var classof$3 = classofRaw$1; var regexpExec$1 = regexpExec$3; // `RegExpExec` abstract operation // https://tc39.es/ecma262/#sec-regexpexec var regexpExecAbstract = function (R, S) { var exec = R.exec; if (isCallable$9(exec)) { var result = exec.call(R, S); if (result !== null) anObject$1a(result); return result; } if (classof$3(R) === 'RegExp') return regexpExec$1.call(R, S); throw TypeError('RegExp#exec called on incompatible receiver'); }; var fixRegExpWellKnownSymbolLogic$3 = fixRegexpWellKnownSymbolLogic; var anObject$19 = anObject$1C; var toLength$6 = toLength$d; var toString$b = toString$t; var requireObjectCoercible$9 = requireObjectCoercible$j; var getMethod$d = getMethod$h; 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$9(this); var matcher = regexp == undefined ? undefined : getMethod$d(regexp, MATCH); return matcher ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](toString$b(O)); }, // `RegExp.prototype[@@match]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@match function (string) { var rx = anObject$19(this); var S = toString$b(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$b(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 $$2k = _export; var createIteratorConstructor$5 = createIteratorConstructor$7; var requireObjectCoercible$8 = requireObjectCoercible$j; var toLength$5 = toLength$d; var toString$a = toString$t; var anObject$18 = anObject$1C; var classof$2 = classofRaw$1; var isRegExp$2 = isRegexp; var getRegExpFlags$1 = regexpFlags$1; var getMethod$c = getMethod$h; var redefine$4 = redefine$l.exports; var fails$d = fails$15; var wellKnownSymbol$f = wellKnownSymbol$G; var speciesConstructor$b = speciesConstructor$f; var advanceStringIndex$2 = advanceStringIndex$4; var regExpExec$2 = regexpExecAbstract; var InternalStateModule$c = internalState; var IS_PURE$D = isPure; var MATCH_ALL = wellKnownSymbol$f('matchAll'); var REGEXP_STRING = 'RegExp String'; var REGEXP_STRING_ITERATOR = REGEXP_STRING + ' Iterator'; var setInternalState$c = InternalStateModule$c.set; var getInternalState$9 = InternalStateModule$c.getterFor(REGEXP_STRING_ITERATOR); var RegExpPrototype$1 = RegExp.prototype; var nativeMatchAll = ''.matchAll; var WORKS_WITH_NON_GLOBAL_REGEX = !!nativeMatchAll && !fails$d(function () { 'a'.matchAll(/./); }); // eslint-disable-next-line max-len -- ignore var $RegExpStringIterator = createIteratorConstructor$5(function RegExpStringIterator(regexp, string, global, fullUnicode) { setInternalState$c(this, { type: REGEXP_STRING_ITERATOR, regexp: regexp, string: string, global: global, unicode: fullUnicode, done: false }); }, REGEXP_STRING, function next() { var state = getInternalState$9(this); if (state.done) return { value: undefined, done: true }; var R = state.regexp; var S = state.string; var match = regExpExec$2(R, S); if (match === null) return { value: undefined, done: state.done = true }; if (state.global) { if (toString$a(match[0]) === '') R.lastIndex = advanceStringIndex$2(S, toLength$5(R.lastIndex), state.unicode); return { value: match, done: false }; } state.done = true; return { value: match, done: false }; }); var $matchAll = function (string) { var R = anObject$18(this); var S = toString$a(string); var C, flagsValue, flags, matcher, global, fullUnicode; C = speciesConstructor$b(R, RegExp); flagsValue = R.flags; if (flagsValue === undefined && R instanceof RegExp && !('flags' in RegExpPrototype$1)) { flagsValue = getRegExpFlags$1.call(R); } flags = flagsValue === undefined ? '' : toString$a(flagsValue); matcher = new C(C === RegExp ? R.source : R, flags); global = !!~flags.indexOf('g'); fullUnicode = !!~flags.indexOf('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 $$2k({ target: 'String', proto: true, forced: WORKS_WITH_NON_GLOBAL_REGEX }, { matchAll: function matchAll(regexp) { var O = requireObjectCoercible$8(this); var flags, S, matcher, rx; if (regexp != null) { if (isRegExp$2(regexp)) { flags = toString$a(requireObjectCoercible$8('flags' in RegExpPrototype$1 ? regexp.flags : getRegExpFlags$1.call(regexp) )); if (!~flags.indexOf('g')) throw TypeError('`.matchAll` does not allow non-global regexes'); } if (WORKS_WITH_NON_GLOBAL_REGEX) return nativeMatchAll.apply(O, arguments); matcher = getMethod$c(regexp, MATCH_ALL); if (matcher === undefined && IS_PURE$D && classof$2(regexp) == 'RegExp') matcher = $matchAll; if (matcher) return matcher.call(regexp, O); } else if (WORKS_WITH_NON_GLOBAL_REGEX) return nativeMatchAll.apply(O, arguments); S = toString$a(O); rx = new RegExp(regexp, 'g'); return rx[MATCH_ALL](S); } }); MATCH_ALL in RegExpPrototype$1 || redefine$4(RegExpPrototype$1, MATCH_ALL, $matchAll); // https://github.com/zloirock/core-js/issues/280 var userAgent$1 = engineUserAgent; var stringPadWebkitBug = /Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(userAgent$1); var $$2j = _export; var $padEnd = stringPad.end; var WEBKIT_BUG$1 = stringPadWebkitBug; // `String.prototype.padEnd` method // https://tc39.es/ecma262/#sec-string.prototype.padend $$2j({ target: 'String', proto: true, forced: WEBKIT_BUG$1 }, { padEnd: function padEnd(maxLength /* , fillString = ' ' */) { return $padEnd(this, maxLength, arguments.length > 1 ? arguments[1] : undefined); } }); var $$2i = _export; var $padStart = stringPad.start; var WEBKIT_BUG = stringPadWebkitBug; // `String.prototype.padStart` method // https://tc39.es/ecma262/#sec-string.prototype.padstart $$2i({ target: 'String', proto: true, forced: WEBKIT_BUG }, { padStart: function padStart(maxLength /* , fillString = ' ' */) { return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined); } }); var $$2h = _export; var toIndexedObject = toIndexedObject$d; var toObject$c = toObject$z; var toString$9 = toString$t; var lengthOfArrayLike$9 = lengthOfArrayLike$q; var ArrayPrototype = Array.prototype; var push$3 = ArrayPrototype.push; var join = ArrayPrototype.join; // `String.raw` method // https://tc39.es/ecma262/#sec-string.raw $$2h({ target: 'String', stat: true }, { raw: function raw(template) { var rawTemplate = toIndexedObject(toObject$c(template).raw); var literalSegments = lengthOfArrayLike$9(rawTemplate); var argumentsLength = arguments.length; var elements = []; var i = 0; while (literalSegments > i) { push$3.call(elements, toString$9(rawTemplate[i++])); if (i === literalSegments) return join.call(elements, ''); if (i < argumentsLength) push$3.call(elements, toString$9(arguments[i])); } } }); var $$2g = _export; var repeat = stringRepeat; // `String.prototype.repeat` method // https://tc39.es/ecma262/#sec-string.prototype.repeat $$2g({ target: 'String', proto: true }, { repeat: repeat }); var toObject$b = toObject$z; var floor$3 = Math.floor; var replace$1 = ''.replace; 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$1.call(replacement, symbols, function (match, ch) { var capture; switch (ch.charAt(0)) { case '$': return '$'; case '&': return matched; case '`': return str.slice(0, position); case "'": return str.slice(tailPos); case '<': capture = namedCaptures[ch.slice(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 ? ch.charAt(1) : captures[f - 1] + ch.charAt(1); return match; } capture = captures[n - 1]; } return capture === undefined ? '' : capture; }); }; var fixRegExpWellKnownSymbolLogic$2 = fixRegexpWellKnownSymbolLogic; var fails$c = fails$15; var anObject$17 = anObject$1C; var isCallable$8 = isCallable$z; var toIntegerOrInfinity$4 = toIntegerOrInfinity$i; var toLength$4 = toLength$d; var toString$8 = toString$t; var requireObjectCoercible$7 = requireObjectCoercible$j; var advanceStringIndex$1 = advanceStringIndex$4; var getMethod$b = getMethod$h; var getSubstitution$1 = getSubstitution$2; var regExpExec$1 = regexpExecAbstract; var wellKnownSymbol$e = wellKnownSymbol$G; var REPLACE$1 = wellKnownSymbol$e('replace'); var max$3 = Math.max; var min$4 = Math.min; 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$c(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$7(this); var replacer = searchValue == undefined ? undefined : getMethod$b(searchValue, REPLACE$1); return replacer ? replacer.call(searchValue, O, replaceValue) : nativeReplace.call(toString$8(O), searchValue, replaceValue); }, // `RegExp.prototype[@@replace]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace function (string, replaceValue) { var rx = anObject$17(this); var S = toString$8(string); if ( typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1 && replaceValue.indexOf('$<') === -1 ) { var res = maybeCallNative(nativeReplace, rx, S, replaceValue); if (res.done) return res.value; } var functionalReplace = isCallable$8(replaceValue); if (!functionalReplace) replaceValue = toString$8(replaceValue); var global = rx.global; if (global) { var fullUnicode = rx.unicode; rx.lastIndex = 0; } var results = []; while (true) { var result = regExpExec$1(rx, S); if (result === null) break; results.push(result); if (!global) break; var matchStr = toString$8(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$8(result[0]); var position = max$3(min$4(toIntegerOrInfinity$4(result.index), S.length), 0); var captures = []; // 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++) captures.push(maybeToString(result[j])); var namedCaptures = result.groups; if (functionalReplace) { var replacerArgs = [matched].concat(captures, position, S); if (namedCaptures !== undefined) replacerArgs.push(namedCaptures); var replacement = toString$8(replaceValue.apply(undefined, replacerArgs)); } else { replacement = getSubstitution$1(matched, S, position, captures, namedCaptures, replaceValue); } if (position >= nextSourcePosition) { accumulatedResult += S.slice(nextSourcePosition, position) + replacement; nextSourcePosition = position + matched.length; } } return accumulatedResult + S.slice(nextSourcePosition); } ]; }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE); var $$2f = _export; var requireObjectCoercible$6 = requireObjectCoercible$j; var isCallable$7 = isCallable$z; var isRegExp$1 = isRegexp; var toString$7 = toString$t; var getMethod$a = getMethod$h; var getRegExpFlags = regexpFlags$1; var getSubstitution = getSubstitution$2; var wellKnownSymbol$d = wellKnownSymbol$G; var REPLACE = wellKnownSymbol$d('replace'); var RegExpPrototype = RegExp.prototype; var max$2 = Math.max; var stringIndexOf = function (string, searchValue, fromIndex) { if (fromIndex > string.length) return -1; if (searchValue === '') return fromIndex; return string.indexOf(searchValue, fromIndex); }; // `String.prototype.replaceAll` method // https://tc39.es/ecma262/#sec-string.prototype.replaceall $$2f({ target: 'String', proto: true }, { replaceAll: function replaceAll(searchValue, replaceValue) { var O = requireObjectCoercible$6(this); var IS_REG_EXP, flags, replacer, string, searchString, functionalReplace, searchLength, advanceBy, replacement; var position = 0; var endOfLastMatch = 0; var result = ''; if (searchValue != null) { IS_REG_EXP = isRegExp$1(searchValue); if (IS_REG_EXP) { flags = toString$7(requireObjectCoercible$6('flags' in RegExpPrototype ? searchValue.flags : getRegExpFlags.call(searchValue) )); if (!~flags.indexOf('g')) throw TypeError('`.replaceAll` does not allow non-global regexes'); } replacer = getMethod$a(searchValue, REPLACE); if (replacer) { return replacer.call(searchValue, O, replaceValue); } } string = toString$7(O); searchString = toString$7(searchValue); functionalReplace = isCallable$7(replaceValue); if (!functionalReplace) replaceValue = toString$7(replaceValue); searchLength = searchString.length; advanceBy = max$2(1, searchLength); position = stringIndexOf(string, searchString, 0); while (position !== -1) { if (functionalReplace) { replacement = toString$7(replaceValue(searchString, position, string)); } else { replacement = getSubstitution(searchString, string, position, [], undefined, replaceValue); } result += string.slice(endOfLastMatch, position) + replacement; endOfLastMatch = position + searchLength; position = stringIndexOf(string, searchString, position + advanceBy); } if (endOfLastMatch < string.length) { result += string.slice(endOfLastMatch); } return result; } }); var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic; var anObject$16 = anObject$1C; var requireObjectCoercible$5 = requireObjectCoercible$j; var sameValue = sameValue$1; var toString$6 = toString$t; var getMethod$9 = getMethod$h; 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$5(this); var searcher = regexp == undefined ? undefined : getMethod$9(regexp, SEARCH); return searcher ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](toString$6(O)); }, // `RegExp.prototype[@@search]` method // https://tc39.es/ecma262/#sec-regexp.prototype-@@search function (string) { var rx = anObject$16(this); var S = toString$6(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 fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic; var isRegExp = isRegexp; var anObject$15 = anObject$1C; var requireObjectCoercible$4 = requireObjectCoercible$j; var speciesConstructor$a = speciesConstructor$f; var advanceStringIndex = advanceStringIndex$4; var toLength$3 = toLength$d; var toString$5 = toString$t; var getMethod$8 = getMethod$h; var callRegExpExec = regexpExecAbstract; var regexpExec = regexpExec$3; var stickyHelpers = regexpStickyHelpers; var fails$b = fails$15; var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y; var arrayPush = [].push; var min$3 = Math.min; var MAX_UINT32 = 0xFFFFFFFF; // 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$b(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$5(requireObjectCoercible$4(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 nativeSplit.call(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 = regexpExec.call(separatorCopy, string)) { lastIndex = separatorCopy.lastIndex; if (lastIndex > lastLastIndex) { output.push(string.slice(lastLastIndex, match.index)); if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(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 || !separatorCopy.test('')) output.push(''); } else output.push(string.slice(lastLastIndex)); return output.length > lim ? output.slice(0, lim) : output; }; // Chakra, V8 } else if ('0'.split(undefined, 0).length) { internalSplit = function (separator, limit) { return separator === undefined && limit === 0 ? [] : nativeSplit.call(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$4(this); var splitter = separator == undefined ? undefined : getMethod$8(separator, SPLIT); return splitter ? splitter.call(separator, O, limit) : internalSplit.call(toString$5(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$15(this); var S = toString$5(string); var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit); if (res.done) return res.value; var C = speciesConstructor$a(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 ? S.slice(q) : S); var e; if ( z === null || (e = min$3(toLength$3(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p ) { q = advanceStringIndex(S, q, unicodeMatching); } else { A.push(S.slice(p, q)); if (A.length === lim) return A; for (var i = 1; i <= z.length - 1; i++) { A.push(z[i]); if (A.length === lim) return A; } q = p = e; } } A.push(S.slice(p)); return A; } ]; }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y); var $$2e = _export; var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f; var toLength$2 = toLength$d; var toString$4 = toString$t; var notARegExp = notARegexp; var requireObjectCoercible$3 = requireObjectCoercible$j; var correctIsRegExpLogic = correctIsRegexpLogic; // eslint-disable-next-line es/no-string-prototype-startswith -- safe var $startsWith = ''.startsWith; var min$2 = 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(String.prototype, 'startsWith'); return descriptor && !descriptor.writable; }(); // `String.prototype.startsWith` method // https://tc39.es/ecma262/#sec-string.prototype.startswith $$2e({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, { startsWith: function startsWith(searchString /* , position = 0 */) { var that = toString$4(requireObjectCoercible$3(this)); notARegExp(searchString); var index = toLength$2(min$2(arguments.length > 1 ? arguments[1] : undefined, that.length)); var search = toString$4(searchString); return $startsWith ? $startsWith.call(that, search, index) : that.slice(index, index + search.length) === search; } }); var $$2d = _export; var requireObjectCoercible$2 = requireObjectCoercible$j; var toIntegerOrInfinity$3 = toIntegerOrInfinity$i; var toString$3 = toString$t; var slice$1 = ''.slice; var max$1 = Math.max; var min$1 = Math.min; // eslint-disable-next-line unicorn/prefer-string-slice -- required for testing var FORCED$8 = !''.substr || 'ab'.substr(-1) !== 'b'; // `String.prototype.substr` method // https://tc39.es/ecma262/#sec-string.prototype.substr $$2d({ target: 'String', proto: true, forced: FORCED$8 }, { substr: function substr(start, length) { var that = toString$3(requireObjectCoercible$2(this)); var size = that.length; var intStart = toIntegerOrInfinity$3(start); var intLength, intEnd; if (intStart === Infinity) intStart = 0; if (intStart < 0) intStart = max$1(size + intStart, 0); intLength = length === undefined ? size : toIntegerOrInfinity$3(length); if (intLength <= 0 || intLength === Infinity) return ''; intEnd = min$1(intStart + intLength, size); return intStart >= intEnd ? '' : slice$1.call(that, intStart, intEnd); } }); var PROPER_FUNCTION_NAME$1 = functionName.PROPER; var fails$a = fails$15; var whitespaces = whitespaces$4; 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$a(function () { return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() !== non || (PROPER_FUNCTION_NAME$1 && whitespaces[METHOD_NAME].name !== METHOD_NAME); }); }; var $$2c = _export; var $trim = stringTrim.trim; var forcedStringTrimMethod$2 = stringTrimForced; // `String.prototype.trim` method // https://tc39.es/ecma262/#sec-string.prototype.trim $$2c({ target: 'String', proto: true, forced: forcedStringTrimMethod$2('trim') }, { trim: function trim() { return $trim(this); } }); var $$2b = _export; var $trimEnd = stringTrim.end; var forcedStringTrimMethod$1 = stringTrimForced; var FORCED$7 = forcedStringTrimMethod$1('trimEnd'); var trimEnd = FORCED$7 ? function trimEnd() { return $trimEnd(this); // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe } : ''.trimEnd; // `String.prototype.{ trimEnd, trimRight }` methods // https://tc39.es/ecma262/#sec-string.prototype.trimend // https://tc39.es/ecma262/#String.prototype.trimright $$2b({ target: 'String', proto: true, name: 'trimEnd', forced: FORCED$7 }, { trimEnd: trimEnd, trimRight: trimEnd }); var $$2a = _export; var $trimStart = stringTrim.start; var forcedStringTrimMethod = stringTrimForced; var FORCED$6 = forcedStringTrimMethod('trimStart'); var trimStart = FORCED$6 ? function trimStart() { return $trimStart(this); // eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe } : ''.trimStart; // `String.prototype.{ trimStart, trimLeft }` methods // https://tc39.es/ecma262/#sec-string.prototype.trimstart // https://tc39.es/ecma262/#String.prototype.trimleft $$2a({ target: 'String', proto: true, name: 'trimStart', forced: FORCED$6 }, { trimStart: trimStart, trimLeft: trimStart }); var requireObjectCoercible$1 = requireObjectCoercible$j; var toString$2 = toString$t; var quot = /"/g; // `CreateHTML` abstract operation // https://tc39.es/ecma262/#sec-createhtml var createHtml = function (string, tag, attribute, value) { var S = toString$2(requireObjectCoercible$1(string)); var p1 = '<' + tag; if (attribute !== '') p1 += ' ' + attribute + '="' + toString$2(value).replace(quot, '"') + '"'; return p1 + '>' + S + ''; }; var fails$9 = fails$15; // check the existence of a method, lowercase // of a tag and escaping quotes in arguments var stringHtmlForced = function (METHOD_NAME) { return fails$9(function () { var test = ''[METHOD_NAME]('"'); return test !== test.toLowerCase() || test.split('"').length > 3; }); }; var $$29 = _export; var createHTML$c = createHtml; var forcedStringHTMLMethod$c = stringHtmlForced; // `String.prototype.anchor` method // https://tc39.es/ecma262/#sec-string.prototype.anchor $$29({ target: 'String', proto: true, forced: forcedStringHTMLMethod$c('anchor') }, { anchor: function anchor(name) { return createHTML$c(this, 'a', 'name', name); } }); var $$28 = _export; var createHTML$b = createHtml; var forcedStringHTMLMethod$b = stringHtmlForced; // `String.prototype.big` method // https://tc39.es/ecma262/#sec-string.prototype.big $$28({ target: 'String', proto: true, forced: forcedStringHTMLMethod$b('big') }, { big: function big() { return createHTML$b(this, 'big', '', ''); } }); var $$27 = _export; var createHTML$a = createHtml; var forcedStringHTMLMethod$a = stringHtmlForced; // `String.prototype.blink` method // https://tc39.es/ecma262/#sec-string.prototype.blink $$27({ target: 'String', proto: true, forced: forcedStringHTMLMethod$a('blink') }, { blink: function blink() { return createHTML$a(this, 'blink', '', ''); } }); var $$26 = _export; var createHTML$9 = createHtml; var forcedStringHTMLMethod$9 = stringHtmlForced; // `String.prototype.bold` method // https://tc39.es/ecma262/#sec-string.prototype.bold $$26({ target: 'String', proto: true, forced: forcedStringHTMLMethod$9('bold') }, { bold: function bold() { return createHTML$9(this, 'b', '', ''); } }); var $$25 = _export; var createHTML$8 = createHtml; var forcedStringHTMLMethod$8 = stringHtmlForced; // `String.prototype.fixed` method // https://tc39.es/ecma262/#sec-string.prototype.fixed $$25({ target: 'String', proto: true, forced: forcedStringHTMLMethod$8('fixed') }, { fixed: function fixed() { return createHTML$8(this, 'tt', '', ''); } }); var $$24 = _export; var createHTML$7 = createHtml; var forcedStringHTMLMethod$7 = stringHtmlForced; // `String.prototype.fontcolor` method // https://tc39.es/ecma262/#sec-string.prototype.fontcolor $$24({ target: 'String', proto: true, forced: forcedStringHTMLMethod$7('fontcolor') }, { fontcolor: function fontcolor(color) { return createHTML$7(this, 'font', 'color', color); } }); var $$23 = _export; var createHTML$6 = createHtml; var forcedStringHTMLMethod$6 = stringHtmlForced; // `String.prototype.fontsize` method // https://tc39.es/ecma262/#sec-string.prototype.fontsize $$23({ target: 'String', proto: true, forced: forcedStringHTMLMethod$6('fontsize') }, { fontsize: function fontsize(size) { return createHTML$6(this, 'font', 'size', size); } }); var $$22 = _export; var createHTML$5 = createHtml; var forcedStringHTMLMethod$5 = stringHtmlForced; // `String.prototype.italics` method // https://tc39.es/ecma262/#sec-string.prototype.italics $$22({ target: 'String', proto: true, forced: forcedStringHTMLMethod$5('italics') }, { italics: function italics() { return createHTML$5(this, 'i', '', ''); } }); var $$21 = _export; var createHTML$4 = createHtml; var forcedStringHTMLMethod$4 = stringHtmlForced; // `String.prototype.link` method // https://tc39.es/ecma262/#sec-string.prototype.link $$21({ target: 'String', proto: true, forced: forcedStringHTMLMethod$4('link') }, { link: function link(url) { return createHTML$4(this, 'a', 'href', url); } }); var $$20 = _export; var createHTML$3 = createHtml; var forcedStringHTMLMethod$3 = stringHtmlForced; // `String.prototype.small` method // https://tc39.es/ecma262/#sec-string.prototype.small $$20({ target: 'String', proto: true, forced: forcedStringHTMLMethod$3('small') }, { small: function small() { return createHTML$3(this, 'small', '', ''); } }); var $$1$ = _export; var createHTML$2 = createHtml; var forcedStringHTMLMethod$2 = stringHtmlForced; // `String.prototype.strike` method // https://tc39.es/ecma262/#sec-string.prototype.strike $$1$({ target: 'String', proto: true, forced: forcedStringHTMLMethod$2('strike') }, { strike: function strike() { return createHTML$2(this, 'strike', '', ''); } }); var $$1_ = _export; var createHTML$1 = createHtml; var forcedStringHTMLMethod$1 = stringHtmlForced; // `String.prototype.sub` method // https://tc39.es/ecma262/#sec-string.prototype.sub $$1_({ target: 'String', proto: true, forced: forcedStringHTMLMethod$1('sub') }, { sub: function sub() { return createHTML$1(this, 'sub', '', ''); } }); var $$1Z = _export; var createHTML = createHtml; var forcedStringHTMLMethod = stringHtmlForced; // `String.prototype.sup` method // https://tc39.es/ecma262/#sec-string.prototype.sup $$1Z({ 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$g = global$R; var fails$8 = fails$15; var checkCorrectnessOfIteration = checkCorrectnessOfIteration$4; var NATIVE_ARRAY_BUFFER_VIEWS$1 = arrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS; var ArrayBuffer$2 = global$g.ArrayBuffer; var Int8Array$2 = global$g.Int8Array; var typedArrayConstructorsRequireWrappers = !NATIVE_ARRAY_BUFFER_VIEWS$1 || !fails$8(function () { Int8Array$2(1); }) || !fails$8(function () { new Int8Array$2(-1); }) || !checkCorrectnessOfIteration(function (iterable) { new Int8Array$2(); new Int8Array$2(null); new Int8Array$2(1.5); new Int8Array$2(iterable); }, true) || fails$8(function () { // Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill return new Int8Array$2(new ArrayBuffer$2(2), 1, undefined).length !== 1; }); var toIntegerOrInfinity$2 = toIntegerOrInfinity$i; var toPositiveInteger$5 = function (it) { var result = toIntegerOrInfinity$2(it); if (result < 0) throw RangeError("The argument can't be less than 0"); return result; }; var toPositiveInteger$4 = toPositiveInteger$5; var toOffset$2 = function (it, BYTES) { var offset = toPositiveInteger$4(it); if (offset % BYTES) throw RangeError('Wrong offset'); return offset; }; var aConstructor$2 = aConstructor$5; var toObject$a = toObject$z; var lengthOfArrayLike$8 = lengthOfArrayLike$q; var getIterator$8 = getIterator$b; var getIteratorMethod$5 = getIteratorMethod$9; var isArrayIteratorMethod = isArrayIteratorMethod$3; var bind$h = functionBindContext; var aTypedArrayConstructor$4 = arrayBufferViewCore.aTypedArrayConstructor; 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$5(O); var i, length, result, step, iterator, next; if (iteratorMethod && !isArrayIteratorMethod(iteratorMethod)) { iterator = getIterator$8(O, iteratorMethod); next = iterator.next; O = []; while (!(step = next.call(iterator)).done) { O.push(step.value); } } if (mapping && argumentsLength > 2) { mapfn = bind$h(mapfn, arguments[2], 2); } length = lengthOfArrayLike$8(O); result = new (aTypedArrayConstructor$4(C))(length); for (i = 0; length > i; i++) { result[i] = mapping ? mapfn(O[i], i) : O[i]; } return result; }; var $$1Y = _export; var global$f = global$R; var DESCRIPTORS$5 = descriptors; var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS$3 = typedArrayConstructorsRequireWrappers; var ArrayBufferViewCore$w = arrayBufferViewCore; var ArrayBufferModule = arrayBuffer; var anInstance$6 = anInstance$b; var createPropertyDescriptor$1 = createPropertyDescriptor$9; var createNonEnumerableProperty$6 = createNonEnumerableProperty$h; var isIntegralNumber = isIntegralNumber$3; var toLength$1 = toLength$d; var toIndex = toIndex$2; var toOffset$1 = toOffset$2; var toPropertyKey$1 = toPropertyKey$9; var hasOwn$6 = hasOwnProperty_1; var classof$1 = classof$b; var isObject$6 = isObject$C; var isSymbol = isSymbol$5; var create$6 = objectCreate$1; var setPrototypeOf = objectSetPrototypeOf$1; var getOwnPropertyNames = objectGetOwnPropertyNames.f; var typedArrayFrom$1 = typedArrayFrom$2; var forEach$1 = arrayIteration.forEach; var setSpecies$1 = setSpecies$7; var definePropertyModule = objectDefineProperty; var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor; var InternalStateModule$b = internalState; var inheritIfRequired = inheritIfRequired$4; var getInternalState$8 = InternalStateModule$b.get; var setInternalState$b = InternalStateModule$b.set; var nativeDefineProperty = definePropertyModule.f; var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; var round = Math.round; var RangeError$1 = global$f.RangeError; var ArrayBuffer$1 = ArrayBufferModule.ArrayBuffer; var DataView$1 = ArrayBufferModule.DataView; var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore$w.NATIVE_ARRAY_BUFFER_VIEWS; var TYPED_ARRAY_CONSTRUCTOR$1 = ArrayBufferViewCore$w.TYPED_ARRAY_CONSTRUCTOR; var TYPED_ARRAY_TAG = ArrayBufferViewCore$w.TYPED_ARRAY_TAG; var TypedArray = ArrayBufferViewCore$w.TypedArray; var TypedArrayPrototype = ArrayBufferViewCore$w.TypedArrayPrototype; var aTypedArrayConstructor$3 = ArrayBufferViewCore$w.aTypedArrayConstructor; var isTypedArray = ArrayBufferViewCore$w.isTypedArray; var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; var WRONG_LENGTH = 'Wrong length'; var fromList = function (C, list) { var index = 0; var length = list.length; var result = new (aTypedArrayConstructor$3(C))(length); while (length > index) result[index] = list[index++]; return result; }; var addGetter = function (it, key) { nativeDefineProperty(it, key, { get: function () { return getInternalState$8(this)[key]; } }); }; var isArrayBuffer = function (it) { var klass; return it instanceof ArrayBuffer$1 || (klass = classof$1(it)) == 'ArrayBuffer' || klass == 'SharedArrayBuffer'; }; var isTypedArrayIndex = function (target, key) { return isTypedArray(target) && !isSymbol(key) && key in target && isIntegralNumber(+key) && key >= 0; }; var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) { key = toPropertyKey$1(key); return isTypedArrayIndex(target, key) ? createPropertyDescriptor$1(2, target[key]) : nativeGetOwnPropertyDescriptor(target, key); }; var wrappedDefineProperty = function defineProperty(target, key, descriptor) { key = toPropertyKey$1(key); if (isTypedArrayIndex(target, key) && isObject$6(descriptor) && hasOwn$6(descriptor, 'value') && !hasOwn$6(descriptor, 'get') && !hasOwn$6(descriptor, 'set') // TODO: add validation descriptor w/o calling accessors && !descriptor.configurable && (!hasOwn$6(descriptor, 'writable') || descriptor.writable) && (!hasOwn$6(descriptor, 'enumerable') || descriptor.enumerable) ) { target[key] = descriptor.value; return target; } return nativeDefineProperty(target, key, descriptor); }; if (DESCRIPTORS$5) { if (!NATIVE_ARRAY_BUFFER_VIEWS) { getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor; definePropertyModule.f = wrappedDefineProperty; addGetter(TypedArrayPrototype, 'buffer'); addGetter(TypedArrayPrototype, 'byteOffset'); addGetter(TypedArrayPrototype, 'byteLength'); addGetter(TypedArrayPrototype, 'length'); } $$1Y({ 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$f[CONSTRUCTOR_NAME]; var TypedArrayConstructor = NativeTypedArrayConstructor; var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype; var exported = {}; var getter = function (that, index) { var data = getInternalState$8(that); return data.view[GETTER](index * BYTES + data.byteOffset, true); }; var setter = function (that, index, value) { var data = getInternalState$8(that); if (CLAMPED) value = (value = round(value)) < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF; data.view[SETTER](index * BYTES + data.byteOffset, 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$6(that, TypedArrayConstructor, CONSTRUCTOR_NAME); var index = 0; var byteOffset = 0; var buffer, byteLength, length; if (!isObject$6(data)) { length = toIndex(data); byteLength = length * BYTES; buffer = new ArrayBuffer$1(byteLength); } else if (isArrayBuffer(data)) { buffer = data; byteOffset = toOffset$1(offset, BYTES); var $len = data.byteLength; if ($length === undefined) { if ($len % BYTES) throw RangeError$1(WRONG_LENGTH); byteLength = $len - byteOffset; if (byteLength < 0) throw RangeError$1(WRONG_LENGTH); } else { byteLength = toLength$1($length) * BYTES; if (byteLength + byteOffset > $len) throw RangeError$1(WRONG_LENGTH); } length = byteLength / BYTES; } else if (isTypedArray(data)) { return fromList(TypedArrayConstructor, data); } else { return typedArrayFrom$1.call(TypedArrayConstructor, data); } setInternalState$b(that, { buffer: buffer, byteOffset: byteOffset, byteLength: byteLength, length: length, view: new DataView$1(buffer) }); while (index < length) addElement(that, index++); }); if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray); TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create$6(TypedArrayPrototype); } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS$3) { TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) { anInstance$6(dummy, TypedArrayConstructor, CONSTRUCTOR_NAME); return inheritIfRequired(function () { if (!isObject$6(data)) return new NativeTypedArrayConstructor(toIndex(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 typedArrayFrom$1.call(TypedArrayConstructor, data); }(), dummy, TypedArrayConstructor); }); if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray); forEach$1(getOwnPropertyNames(NativeTypedArrayConstructor), function (key) { if (!(key in TypedArrayConstructor)) { createNonEnumerableProperty$6(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]); } }); TypedArrayConstructor.prototype = TypedArrayConstructorPrototype; } if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) { createNonEnumerableProperty$6(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor); } createNonEnumerableProperty$6(TypedArrayConstructorPrototype, TYPED_ARRAY_CONSTRUCTOR$1, TypedArrayConstructor); if (TYPED_ARRAY_TAG) { createNonEnumerableProperty$6(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME); } exported[CONSTRUCTOR_NAME] = TypedArrayConstructor; $$1Y({ global: true, forced: TypedArrayConstructor != NativeTypedArrayConstructor, sham: !NATIVE_ARRAY_BUFFER_VIEWS }, exported); if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) { createNonEnumerableProperty$6(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES); } if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) { createNonEnumerableProperty$6(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES); } setSpecies$1(CONSTRUCTOR_NAME); }; } else typedArrayConstructor.exports = function () { /* empty */ }; var createTypedArrayConstructor$8 = typedArrayConstructor.exports; // `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 = typedArrayConstructor.exports; // `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 = typedArrayConstructor.exports; // `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 = typedArrayConstructor.exports; // `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 = typedArrayConstructor.exports; // `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 = typedArrayConstructor.exports; // `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 = typedArrayConstructor.exports; // `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 = typedArrayConstructor.exports; // `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 = typedArrayConstructor.exports; // `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$v = arrayBufferViewCore; var lengthOfArrayLike$7 = lengthOfArrayLike$q; var toIntegerOrInfinity$1 = toIntegerOrInfinity$i; var aTypedArray$s = ArrayBufferViewCore$v.aTypedArray; var exportTypedArrayMethod$t = ArrayBufferViewCore$v.exportTypedArrayMethod; // `%TypedArray%.prototype.at` method // https://github.com/tc39/proposal-relative-indexing-method exportTypedArrayMethod$t('at', function at(index) { var O = aTypedArray$s(this); var len = lengthOfArrayLike$7(O); var relativeIndex = toIntegerOrInfinity$1(index); var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex; return (k < 0 || k >= len) ? undefined : O[k]; }); var ArrayBufferViewCore$u = arrayBufferViewCore; var $copyWithin = arrayCopyWithin; var aTypedArray$r = ArrayBufferViewCore$u.aTypedArray; var exportTypedArrayMethod$s = ArrayBufferViewCore$u.exportTypedArrayMethod; // `%TypedArray%.prototype.copyWithin` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.copywithin exportTypedArrayMethod$s('copyWithin', function copyWithin(target, start /* , end */) { return $copyWithin.call(aTypedArray$r(this), target, start, arguments.length > 2 ? arguments[2] : undefined); }); var ArrayBufferViewCore$t = arrayBufferViewCore; var $every$1 = arrayIteration.every; var aTypedArray$q = ArrayBufferViewCore$t.aTypedArray; var exportTypedArrayMethod$r = ArrayBufferViewCore$t.exportTypedArrayMethod; // `%TypedArray%.prototype.every` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.every exportTypedArrayMethod$r('every', function every(callbackfn /* , thisArg */) { return $every$1(aTypedArray$q(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }); var ArrayBufferViewCore$s = arrayBufferViewCore; var $fill = arrayFill$1; var aTypedArray$p = ArrayBufferViewCore$s.aTypedArray; var exportTypedArrayMethod$q = ArrayBufferViewCore$s.exportTypedArrayMethod; // `%TypedArray%.prototype.fill` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill // eslint-disable-next-line no-unused-vars -- required for `.length` exportTypedArrayMethod$q('fill', function fill(value /* , start, end */) { return $fill.apply(aTypedArray$p(this), arguments); }); var arrayFromConstructorAndList$3 = function (Constructor, list) { var index = 0; var length = list.length; var result = new Constructor(length); while (length > index) result[index] = list[index++]; return result; }; var ArrayBufferViewCore$r = arrayBufferViewCore; var speciesConstructor$9 = speciesConstructor$f; var TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore$r.TYPED_ARRAY_CONSTRUCTOR; var aTypedArrayConstructor$2 = ArrayBufferViewCore$r.aTypedArrayConstructor; // a part of `TypedArraySpeciesCreate` abstract operation // https://tc39.es/ecma262/#typedarray-species-create var typedArraySpeciesConstructor$5 = function (originalArray) { return aTypedArrayConstructor$2(speciesConstructor$9(originalArray, originalArray[TYPED_ARRAY_CONSTRUCTOR])); }; var arrayFromConstructorAndList$2 = arrayFromConstructorAndList$3; var typedArraySpeciesConstructor$4 = typedArraySpeciesConstructor$5; var typedArrayFromSpeciesAndList = function (instance, list) { return arrayFromConstructorAndList$2(typedArraySpeciesConstructor$4(instance), list); }; var ArrayBufferViewCore$q = arrayBufferViewCore; var $filter = arrayIteration.filter; var fromSpeciesAndList$3 = typedArrayFromSpeciesAndList; var aTypedArray$o = ArrayBufferViewCore$q.aTypedArray; var exportTypedArrayMethod$p = ArrayBufferViewCore$q.exportTypedArrayMethod; // `%TypedArray%.prototype.filter` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.filter exportTypedArrayMethod$p('filter', function filter(callbackfn /* , thisArg */) { var list = $filter(aTypedArray$o(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); return fromSpeciesAndList$3(this, list); }); var ArrayBufferViewCore$p = arrayBufferViewCore; var $find$1 = arrayIteration.find; var aTypedArray$n = ArrayBufferViewCore$p.aTypedArray; var exportTypedArrayMethod$o = ArrayBufferViewCore$p.exportTypedArrayMethod; // `%TypedArray%.prototype.find` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.find exportTypedArrayMethod$o('find', function find(predicate /* , thisArg */) { return $find$1(aTypedArray$n(this), predicate, arguments.length > 1 ? arguments[1] : undefined); }); var ArrayBufferViewCore$o = arrayBufferViewCore; var $findIndex = arrayIteration.findIndex; var aTypedArray$m = ArrayBufferViewCore$o.aTypedArray; var exportTypedArrayMethod$n = ArrayBufferViewCore$o.exportTypedArrayMethod; // `%TypedArray%.prototype.findIndex` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.findindex exportTypedArrayMethod$n('findIndex', function findIndex(predicate /* , thisArg */) { return $findIndex(aTypedArray$m(this), predicate, arguments.length > 1 ? arguments[1] : undefined); }); var ArrayBufferViewCore$n = arrayBufferViewCore; var $forEach$1 = arrayIteration.forEach; var aTypedArray$l = ArrayBufferViewCore$n.aTypedArray; var exportTypedArrayMethod$m = ArrayBufferViewCore$n.exportTypedArrayMethod; // `%TypedArray%.prototype.forEach` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.foreach exportTypedArrayMethod$m('forEach', function forEach(callbackfn /* , thisArg */) { $forEach$1(aTypedArray$l(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }); var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS$2 = 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$2); var ArrayBufferViewCore$m = arrayBufferViewCore; var $includes = arrayIncludes.includes; var aTypedArray$k = ArrayBufferViewCore$m.aTypedArray; var exportTypedArrayMethod$l = ArrayBufferViewCore$m.exportTypedArrayMethod; // `%TypedArray%.prototype.includes` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.includes exportTypedArrayMethod$l('includes', function includes(searchElement /* , fromIndex */) { return $includes(aTypedArray$k(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); }); var ArrayBufferViewCore$l = arrayBufferViewCore; var $indexOf = arrayIncludes.indexOf; var aTypedArray$j = ArrayBufferViewCore$l.aTypedArray; var exportTypedArrayMethod$k = ArrayBufferViewCore$l.exportTypedArrayMethod; // `%TypedArray%.prototype.indexOf` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.indexof exportTypedArrayMethod$k('indexOf', function indexOf(searchElement /* , fromIndex */) { return $indexOf(aTypedArray$j(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); }); var global$e = global$R; var PROPER_FUNCTION_NAME = functionName.PROPER; var ArrayBufferViewCore$k = arrayBufferViewCore; var ArrayIterators = es_array_iterator; var wellKnownSymbol$c = wellKnownSymbol$G; var ITERATOR$3 = wellKnownSymbol$c('iterator'); var Uint8Array$1 = global$e.Uint8Array; var arrayValues = ArrayIterators.values; var arrayKeys = ArrayIterators.keys; var arrayEntries = ArrayIterators.entries; var aTypedArray$i = ArrayBufferViewCore$k.aTypedArray; var exportTypedArrayMethod$j = ArrayBufferViewCore$k.exportTypedArrayMethod; var nativeTypedArrayIterator = Uint8Array$1 && Uint8Array$1.prototype[ITERATOR$3]; var PROPER_ARRAY_VALUES_NAME = !!nativeTypedArrayIterator && nativeTypedArrayIterator.name === 'values'; var typedArrayValues = function values() { return arrayValues.call(aTypedArray$i(this)); }; // `%TypedArray%.prototype.entries` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.entries exportTypedArrayMethod$j('entries', function entries() { return arrayEntries.call(aTypedArray$i(this)); }); // `%TypedArray%.prototype.keys` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.keys exportTypedArrayMethod$j('keys', function keys() { return arrayKeys.call(aTypedArray$i(this)); }); // `%TypedArray%.prototype.values` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.values exportTypedArrayMethod$j('values', typedArrayValues, PROPER_FUNCTION_NAME && !PROPER_ARRAY_VALUES_NAME); // `%TypedArray%.prototype[@@iterator]` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype-@@iterator exportTypedArrayMethod$j(ITERATOR$3, typedArrayValues, PROPER_FUNCTION_NAME && !PROPER_ARRAY_VALUES_NAME); var ArrayBufferViewCore$j = arrayBufferViewCore; var aTypedArray$h = ArrayBufferViewCore$j.aTypedArray; var exportTypedArrayMethod$i = ArrayBufferViewCore$j.exportTypedArrayMethod; var $join = [].join; // `%TypedArray%.prototype.join` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.join // eslint-disable-next-line no-unused-vars -- required for `.length` exportTypedArrayMethod$i('join', function join(separator) { return $join.apply(aTypedArray$h(this), arguments); }); var ArrayBufferViewCore$i = arrayBufferViewCore; var $lastIndexOf = arrayLastIndexOf; var aTypedArray$g = ArrayBufferViewCore$i.aTypedArray; var exportTypedArrayMethod$h = ArrayBufferViewCore$i.exportTypedArrayMethod; // `%TypedArray%.prototype.lastIndexOf` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.lastindexof // eslint-disable-next-line no-unused-vars -- required for `.length` exportTypedArrayMethod$h('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */) { return $lastIndexOf.apply(aTypedArray$g(this), arguments); }); var ArrayBufferViewCore$h = arrayBufferViewCore; var $map = arrayIteration.map; var typedArraySpeciesConstructor$3 = typedArraySpeciesConstructor$5; var aTypedArray$f = ArrayBufferViewCore$h.aTypedArray; var exportTypedArrayMethod$g = ArrayBufferViewCore$h.exportTypedArrayMethod; // `%TypedArray%.prototype.map` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.map exportTypedArrayMethod$g('map', function map(mapfn /* , thisArg */) { return $map(aTypedArray$f(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) { return new (typedArraySpeciesConstructor$3(O))(length); }); }); var ArrayBufferViewCore$g = arrayBufferViewCore; var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS$1 = typedArrayConstructorsRequireWrappers; var aTypedArrayConstructor$1 = ArrayBufferViewCore$g.aTypedArrayConstructor; var exportTypedArrayStaticMethod$1 = ArrayBufferViewCore$g.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$1); var ArrayBufferViewCore$f = arrayBufferViewCore; var $reduce = arrayReduce.left; var aTypedArray$e = ArrayBufferViewCore$f.aTypedArray; var exportTypedArrayMethod$f = ArrayBufferViewCore$f.exportTypedArrayMethod; // `%TypedArray%.prototype.reduce` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduce exportTypedArrayMethod$f('reduce', function reduce(callbackfn /* , initialValue */) { return $reduce(aTypedArray$e(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); }); var ArrayBufferViewCore$e = arrayBufferViewCore; var $reduceRight = arrayReduce.right; var aTypedArray$d = ArrayBufferViewCore$e.aTypedArray; var exportTypedArrayMethod$e = ArrayBufferViewCore$e.exportTypedArrayMethod; // `%TypedArray%.prototype.reduceRicht` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.reduceright exportTypedArrayMethod$e('reduceRight', function reduceRight(callbackfn /* , initialValue */) { return $reduceRight(aTypedArray$d(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); }); var ArrayBufferViewCore$d = arrayBufferViewCore; var aTypedArray$c = ArrayBufferViewCore$d.aTypedArray; var exportTypedArrayMethod$d = ArrayBufferViewCore$d.exportTypedArrayMethod; var floor$2 = Math.floor; // `%TypedArray%.prototype.reverse` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.reverse exportTypedArrayMethod$d('reverse', function reverse() { var that = this; var length = aTypedArray$c(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 ArrayBufferViewCore$c = arrayBufferViewCore; var lengthOfArrayLike$6 = lengthOfArrayLike$q; var toOffset = toOffset$2; var toObject$9 = toObject$z; var fails$7 = fails$15; var aTypedArray$b = ArrayBufferViewCore$c.aTypedArray; var exportTypedArrayMethod$c = ArrayBufferViewCore$c.exportTypedArrayMethod; var FORCED$5 = fails$7(function () { // eslint-disable-next-line es/no-typed-arrays -- required for testing new Int8Array(1).set({}); }); // `%TypedArray%.prototype.set` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.set exportTypedArrayMethod$c('set', function set(arrayLike /* , offset */) { aTypedArray$b(this); var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1); var length = this.length; var src = toObject$9(arrayLike); var len = lengthOfArrayLike$6(src); var index = 0; if (len + offset > length) throw RangeError('Wrong length'); while (index < len) this[offset + index] = src[index++]; }, FORCED$5); var ArrayBufferViewCore$b = arrayBufferViewCore; var typedArraySpeciesConstructor$2 = typedArraySpeciesConstructor$5; var fails$6 = fails$15; var aTypedArray$a = ArrayBufferViewCore$b.aTypedArray; var exportTypedArrayMethod$b = ArrayBufferViewCore$b.exportTypedArrayMethod; var $slice$1 = [].slice; var FORCED$4 = fails$6(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$b('slice', function slice(start, end) { var list = $slice$1.call(aTypedArray$a(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$4); var ArrayBufferViewCore$a = arrayBufferViewCore; var $some$1 = arrayIteration.some; var aTypedArray$9 = ArrayBufferViewCore$a.aTypedArray; var exportTypedArrayMethod$a = ArrayBufferViewCore$a.exportTypedArrayMethod; // `%TypedArray%.prototype.some` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.some exportTypedArrayMethod$a('some', function some(callbackfn /* , thisArg */) { return $some$1(aTypedArray$9(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }); var ArrayBufferViewCore$9 = arrayBufferViewCore; var global$d = global$R; var fails$5 = fails$15; var aCallable$B = aCallable$Q; var lengthOfArrayLike$5 = lengthOfArrayLike$q; var internalSort = arraySort; var FF = engineFfVersion; var IE_OR_EDGE = engineIsIeOrEdge; var V8 = engineV8Version; var WEBKIT = engineWebkitVersion; var aTypedArray$8 = ArrayBufferViewCore$9.aTypedArray; var exportTypedArrayMethod$9 = ArrayBufferViewCore$9.exportTypedArrayMethod; var Uint16Array = global$d.Uint16Array; var nativeSort = Uint16Array && Uint16Array.prototype.sort; // WebKit var ACCEPT_INCORRECT_ARGUMENTS = !!nativeSort && !fails$5(function () { var array = new Uint16Array(2); array.sort(null); array.sort({}); }); var STABLE_SORT = !!nativeSort && !fails$5(function () { // feature detection can be too slow, so check engines versions if (V8) return V8 < 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; } array.sort(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$9('sort', function sort(comparefn) { var array = this; if (comparefn !== undefined) aCallable$B(comparefn); if (STABLE_SORT) return nativeSort.call(array, comparefn); aTypedArray$8(array); var arrayLength = lengthOfArrayLike$5(array); var items = Array(arrayLength); var index; for (index = 0; index < arrayLength; index++) { items[index] = array[index]; } items = internalSort(array, getSortCompare(comparefn)); for (index = 0; index < arrayLength; index++) { array[index] = items[index]; } return array; }, !STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS); var ArrayBufferViewCore$8 = arrayBufferViewCore; var toLength = toLength$d; var toAbsoluteIndex = toAbsoluteIndex$8; var typedArraySpeciesConstructor$1 = typedArraySpeciesConstructor$5; var aTypedArray$7 = ArrayBufferViewCore$8.aTypedArray; var exportTypedArrayMethod$8 = ArrayBufferViewCore$8.exportTypedArrayMethod; // `%TypedArray%.prototype.subarray` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.subarray exportTypedArrayMethod$8('subarray', function subarray(begin, end) { var O = aTypedArray$7(this); var length = O.length; var beginIndex = toAbsoluteIndex(begin, length); var C = typedArraySpeciesConstructor$1(O); return new C( O.buffer, O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT, toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - beginIndex) ); }); var global$c = global$R; var ArrayBufferViewCore$7 = arrayBufferViewCore; var fails$4 = fails$15; var Int8Array$1 = global$c.Int8Array; var aTypedArray$6 = ArrayBufferViewCore$7.aTypedArray; var exportTypedArrayMethod$7 = ArrayBufferViewCore$7.exportTypedArrayMethod; var $toLocaleString = [].toLocaleString; var $slice = [].slice; // iOS Safari 6.x fails here var TO_LOCALE_STRING_BUG = !!Int8Array$1 && fails$4(function () { $toLocaleString.call(new Int8Array$1(1)); }); var FORCED$3 = fails$4(function () { return [1, 2].toLocaleString() != new Int8Array$1([1, 2]).toLocaleString(); }) || !fails$4(function () { Int8Array$1.prototype.toLocaleString.call([1, 2]); }); // `%TypedArray%.prototype.toLocaleString` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.tolocalestring exportTypedArrayMethod$7('toLocaleString', function toLocaleString() { return $toLocaleString.apply(TO_LOCALE_STRING_BUG ? $slice.call(aTypedArray$6(this)) : aTypedArray$6(this), arguments); }, FORCED$3); var exportTypedArrayMethod$6 = arrayBufferViewCore.exportTypedArrayMethod; var fails$3 = fails$15; var global$b = global$R; var Uint8Array = global$b.Uint8Array; var Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || {}; var arrayToString = [].toString; var arrayJoin = [].join; if (fails$3(function () { arrayToString.call({}); })) { arrayToString = function toString() { return arrayJoin.call(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 $$1X = _export; var toString$1 = toString$t; var fromCharCode = String.fromCharCode; var hex2 = /^[\da-f]{2}$/i; var hex4 = /^[\da-f]{4}$/i; // `unescape` method // https://tc39.es/ecma262/#sec-unescape-string $$1X({ global: true }, { unescape: function unescape(string) { var str = toString$1(string); var result = ''; var length = str.length; var index = 0; var chr, slice; while (index < length) { chr = str.charAt(index++); if (chr === '%') { if (str.charAt(index) === 'u') { slice = str.slice(index + 1, index + 5); if (hex4.test(slice)) { result += fromCharCode(parseInt(slice, 16)); index += 5; continue; } } else { slice = str.slice(index, index + 2); if (hex2.test(slice)) { result += fromCharCode(parseInt(slice, 16)); index += 2; continue; } } } result += chr; } return result; } }); var es_weakMap = {exports: {}}; var redefineAll$6 = redefineAll$a; var getWeakData = internalMetadata.exports.getWeakData; var anObject$14 = anObject$1C; var isObject$5 = isObject$C; var anInstance$5 = anInstance$b; var iterate$A = iterate$I; var ArrayIterationModule = arrayIteration; var hasOwn$5 = hasOwnProperty_1; var InternalStateModule$a = internalState; var setInternalState$a = InternalStateModule$a.set; var internalStateGetterFor = InternalStateModule$a.getterFor; var find$1 = ArrayIterationModule.find; var findIndex = ArrayIterationModule.findIndex; var id = 0; // fallback for uncaught frozen keys var uncaughtFrozenStore = function (store) { return store.frozen || (store.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) this.entries.splice(index, 1); return !!~index; } }; var collectionWeak$2 = { getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { var C = wrapper(function (that, iterable) { anInstance$5(that, C, CONSTRUCTOR_NAME); setInternalState$a(that, { type: CONSTRUCTOR_NAME, id: id++, frozen: undefined }); if (iterable != undefined) iterate$A(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); }); var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); var define = function (that, key, value) { var state = getInternalState(that); var data = getWeakData(anObject$14(key), true); if (data === true) uncaughtFrozenStore(state).set(key, value); else data[state.id] = value; return that; }; redefineAll$6(C.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$5(key)) return false; var data = getWeakData(key); if (data === true) return uncaughtFrozenStore(state)['delete'](key); return data && hasOwn$5(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$5(key)) return false; var data = getWeakData(key); if (data === true) return uncaughtFrozenStore(state).has(key); return data && hasOwn$5(data, state.id); } }); redefineAll$6(C.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$5(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 C; } }; var global$a = global$R; var redefineAll$5 = redefineAll$a; var InternalMetadataModule = internalMetadata.exports; var collection$1 = collection$4; var collectionWeak$1 = collectionWeak$2; var isObject$4 = isObject$C; var enforceIternalState = internalState.enforce; var NATIVE_WEAK_MAP = nativeWeakMap; var IS_IE11 = !global$a.ActiveXObject && 'ActiveXObject' in global$a; // eslint-disable-next-line es/no-object-isextensible -- safe var isExtensible = Object.isExtensible; 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 = es_weakMap.exports = collection$1('WeakMap', wrapper, collectionWeak$1); // 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 && IS_IE11) { InternalWeakMap = collectionWeak$1.getConstructor(wrapper, 'WeakMap', true); InternalMetadataModule.enable(); var WeakMapPrototype = $WeakMap.prototype; var nativeDelete = WeakMapPrototype['delete']; var nativeHas = WeakMapPrototype.has; var nativeGet = WeakMapPrototype.get; var nativeSet = WeakMapPrototype.set; redefineAll$5(WeakMapPrototype, { 'delete': function (key) { if (isObject$4(key) && !isExtensible(key)) { var state = enforceIternalState(this); if (!state.frozen) state.frozen = new InternalWeakMap(); return nativeDelete.call(this, key) || state.frozen['delete'](key); } return nativeDelete.call(this, key); }, has: function has(key) { if (isObject$4(key) && !isExtensible(key)) { var state = enforceIternalState(this); if (!state.frozen) state.frozen = new InternalWeakMap(); return nativeHas.call(this, key) || state.frozen.has(key); } return nativeHas.call(this, key); }, get: function get(key) { if (isObject$4(key) && !isExtensible(key)) { var state = enforceIternalState(this); if (!state.frozen) state.frozen = new InternalWeakMap(); return nativeHas.call(this, key) ? nativeGet.call(this, key) : state.frozen.get(key); } return nativeGet.call(this, key); }, set: function set(key, value) { if (isObject$4(key) && !isExtensible(key)) { var state = enforceIternalState(this); if (!state.frozen) state.frozen = new InternalWeakMap(); nativeHas.call(this, key) ? nativeSet.call(this, key, value) : state.frozen.set(key, value); } else nativeSet.call(this, key, value); 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 global$9 = global$R; var shared$1 = sharedStore; var isCallable$6 = isCallable$z; var getPrototypeOf$3 = objectGetPrototypeOf$1; var redefine$3 = redefine$l.exports; var wellKnownSymbol$b = wellKnownSymbol$G; var USE_FUNCTION_CONSTRUCTOR = 'USE_FUNCTION_CONSTRUCTOR'; var ASYNC_ITERATOR$3 = wellKnownSymbol$b('asyncIterator'); var AsyncIterator = global$9.AsyncIterator; var PassedAsyncIteratorPrototype = shared$1.AsyncIteratorPrototype; var AsyncIteratorPrototype$4, prototype; if (PassedAsyncIteratorPrototype) { AsyncIteratorPrototype$4 = PassedAsyncIteratorPrototype; } else if (isCallable$6(AsyncIterator)) { AsyncIteratorPrototype$4 = AsyncIterator.prototype; } else if (shared$1[USE_FUNCTION_CONSTRUCTOR] || global$9[USE_FUNCTION_CONSTRUCTOR]) { try { // eslint-disable-next-line no-new-func -- we have no alternatives without usage of modern syntax prototype = getPrototypeOf$3(getPrototypeOf$3(getPrototypeOf$3(Function('return async function*(){}()')()))); if (getPrototypeOf$3(prototype) === Object.prototype) AsyncIteratorPrototype$4 = prototype; } catch (error) { /* empty */ } } if (!AsyncIteratorPrototype$4) AsyncIteratorPrototype$4 = {}; if (!isCallable$6(AsyncIteratorPrototype$4[ASYNC_ITERATOR$3])) { redefine$3(AsyncIteratorPrototype$4, ASYNC_ITERATOR$3, function () { return this; }); } var asyncIteratorPrototype = AsyncIteratorPrototype$4; var anObject$13 = anObject$1C; var create$5 = objectCreate$1; var getMethod$7 = getMethod$h; var redefineAll$4 = redefineAll$a; var InternalStateModule$9 = internalState; var getBuiltIn$j = getBuiltIn$y; var AsyncIteratorPrototype$3 = asyncIteratorPrototype; var Promise$3 = getBuiltIn$j('Promise'); var setInternalState$9 = InternalStateModule$9.set; var getInternalState$7 = InternalStateModule$9.get; var asyncFromSyncIteratorContinuation = function (result, resolve, reject) { var done = result.done; Promise$3.resolve(result.value).then(function (value) { resolve({ done: done, value: value }); }, reject); }; var AsyncFromSyncIterator$3 = function AsyncIterator(iterator) { setInternalState$9(this, { iterator: anObject$13(iterator), next: iterator.next }); }; AsyncFromSyncIterator$3.prototype = redefineAll$4(create$5(AsyncIteratorPrototype$3), { next: function next(arg) { var state = getInternalState$7(this); var hasArg = !!arguments.length; return new Promise$3(function (resolve, reject) { var result = anObject$13(state.next.apply(state.iterator, hasArg ? [arg] : [])); asyncFromSyncIteratorContinuation(result, resolve, reject); }); }, 'return': function (arg) { var iterator = getInternalState$7(this).iterator; var hasArg = !!arguments.length; return new Promise$3(function (resolve, reject) { var $return = getMethod$7(iterator, 'return'); if ($return === undefined) return resolve({ done: true, value: arg }); var result = anObject$13($return.apply(iterator, hasArg ? [arg] : [])); asyncFromSyncIteratorContinuation(result, resolve, reject); }); }, 'throw': function (arg) { var iterator = getInternalState$7(this).iterator; var hasArg = !!arguments.length; return new Promise$3(function (resolve, reject) { var $throw = getMethod$7(iterator, 'throw'); if ($throw === undefined) return reject(arg); var result = anObject$13($throw.apply(iterator, hasArg ? [arg] : [])); asyncFromSyncIteratorContinuation(result, resolve, reject); }); } }); var asyncFromSyncIterator = AsyncFromSyncIterator$3; var AsyncFromSyncIterator$2 = asyncFromSyncIterator; var anObject$12 = anObject$1C; var getIterator$7 = getIterator$b; var getMethod$6 = getMethod$h; var wellKnownSymbol$a = wellKnownSymbol$G; var ASYNC_ITERATOR$2 = wellKnownSymbol$a('asyncIterator'); var getAsyncIterator$3 = function (it, usingIterator) { var method = arguments.length < 2 ? getMethod$6(it, ASYNC_ITERATOR$2) : usingIterator; return method ? anObject$12(method.call(it)) : new AsyncFromSyncIterator$2(getIterator$7(it)); }; var global$8 = global$R; var entryVirtual = function (CONSTRUCTOR) { return global$8[CONSTRUCTOR].prototype; }; // https://github.com/tc39/proposal-iterator-helpers // https://github.com/tc39/proposal-array-from-async var aCallable$A = aCallable$Q; var anObject$11 = anObject$1C; var getBuiltIn$i = getBuiltIn$y; var getMethod$5 = getMethod$h; var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; var createMethod$1 = 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 (iterator, fn, target) { anObject$11(iterator); var Promise = getBuiltIn$i('Promise'); var next = aCallable$A(iterator.next); var index = 0; var MAPPING = fn !== undefined; if (MAPPING || !IS_TO_ARRAY) aCallable$A(fn); return new Promise(function (resolve, reject) { var closeIteration = function (method, argument) { try { var returnMethod = getMethod$5(iterator, 'return'); if (returnMethod) { return Promise.resolve(returnMethod.call(iterator)).then(function () { method(argument); }, function (error) { reject(error); }); } } catch (error2) { return reject(error2); } method(argument); }; var onError = function (error) { closeIteration(reject, error); }; var loop = function () { try { if (IS_TO_ARRAY && (index > MAX_SAFE_INTEGER) && MAPPING) { throw TypeError('The allowed number of iterations has been exceeded'); } Promise.resolve(anObject$11(next.call(iterator))).then(function (step) { try { if (anObject$11(step).done) { if (IS_TO_ARRAY) { target.length = index; resolve(target); } else resolve(IS_SOME ? false : IS_EVERY || undefined); } else { var value = step.value; if (MAPPING) { Promise.resolve(IS_TO_ARRAY ? fn(value, index) : fn(value)).then(function (result) { if (IS_FOR_EACH) { loop(); } else if (IS_EVERY) { result ? loop() : closeIteration(resolve, false); } else if (IS_TO_ARRAY) { target[index++] = result; loop(); } else { result ? closeIteration(resolve, IS_SOME || value) : loop(); } }, onError); } else { target[index++] = value; loop(); } } } catch (error) { onError(error); } }, onError); } catch (error2) { onError(error2); } }; loop(); }); }; }; var asyncIteratorIteration = { toArray: createMethod$1(0), forEach: createMethod$1(1), every: createMethod$1(2), some: createMethod$1(3), find: createMethod$1(4) }; var bind$g = functionBindContext; var toObject$8 = toObject$z; var isConstructor$1 = isConstructor$7; var getAsyncIterator$2 = getAsyncIterator$3; var getIterator$6 = getIterator$b; var getIteratorMethod$4 = getIteratorMethod$9; var getMethod$4 = getMethod$h; var getVirtual = entryVirtual; var getBuiltIn$h = getBuiltIn$y; var wellKnownSymbol$9 = wellKnownSymbol$G; var AsyncFromSyncIterator$1 = asyncFromSyncIterator; var toArray = asyncIteratorIteration.toArray; var ASYNC_ITERATOR$1 = wellKnownSymbol$9('asyncIterator'); var arrayIterator = getVirtual('Array').values; // `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$h('Promise'))(function (resolve) { var O = toObject$8(asyncItems); if (mapfn !== undefined) mapfn = bind$g(mapfn, thisArg, 2); var usingAsyncIterator = getMethod$4(O, ASYNC_ITERATOR$1); var usingSyncIterator = usingAsyncIterator ? undefined : getIteratorMethod$4(O) || arrayIterator; var A = isConstructor$1(C) ? new C() : []; var iterator = usingAsyncIterator ? getAsyncIterator$2(O, usingAsyncIterator) : new AsyncFromSyncIterator$1(getIterator$6(O, usingSyncIterator)); resolve(toArray(iterator, mapfn, A)); }); }; var $$1W = _export; var fromAsync = arrayFromAsync$1; // `Array.fromAsync` method // https://github.com/tc39/proposal-array-from-async $$1W({ target: 'Array', stat: true }, { fromAsync: fromAsync }); // TODO: remove from `core-js@4` var $$1V = _export; var $filterReject$3 = arrayIteration.filterReject; var addToUnscopables$7 = addToUnscopables$h; // `Array.prototype.filterOut` method // https://github.com/tc39/proposal-array-filtering $$1V({ target: 'Array', proto: true }, { filterOut: function filterOut(callbackfn /* , thisArg */) { return $filterReject$3(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); addToUnscopables$7('filterOut'); var $$1U = _export; var $filterReject$2 = arrayIteration.filterReject; var addToUnscopables$6 = addToUnscopables$h; // `Array.prototype.filterReject` method // https://github.com/tc39/proposal-array-filtering $$1U({ target: 'Array', proto: true }, { filterReject: function filterReject(callbackfn /* , thisArg */) { return $filterReject$2(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); addToUnscopables$6('filterReject'); var bind$f = functionBindContext; var IndexedObject$1 = indexedObject; var toObject$7 = toObject$z; var lengthOfArrayLike$4 = lengthOfArrayLike$q; // `Array.prototype.{ findLast, findLastIndex }` methods implementation var createMethod = function (TYPE) { var IS_FIND_LAST_INDEX = TYPE == 1; return function ($this, callbackfn, that) { var O = toObject$7($this); var self = IndexedObject$1(O); var boundFunction = bind$f(callbackfn, that, 3); var index = lengthOfArrayLike$4(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(0), // `Array.prototype.findLastIndex` method // https://github.com/tc39/proposal-array-find-from-last findLastIndex: createMethod(1) }; var $$1T = _export; var $findLast$1 = arrayIterationFromLast.findLast; var addToUnscopables$5 = addToUnscopables$h; // `Array.prototype.findLast` method // https://github.com/tc39/proposal-array-find-from-last $$1T({ target: 'Array', proto: true }, { findLast: function findLast(callbackfn /* , that = undefined */) { return $findLast$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); addToUnscopables$5('findLast'); var $$1S = _export; var $findLastIndex$1 = arrayIterationFromLast.findLastIndex; var addToUnscopables$4 = addToUnscopables$h; // `Array.prototype.findLastIndex` method // https://github.com/tc39/proposal-array-find-from-last $$1S({ target: 'Array', proto: true }, { findLastIndex: function findLastIndex(callbackfn /* , that = undefined */) { return $findLastIndex$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); addToUnscopables$4('findLastIndex'); var bind$e = functionBindContext; var IndexedObject = indexedObject; var toObject$6 = toObject$z; var toPropertyKey = toPropertyKey$9; var lengthOfArrayLike$3 = lengthOfArrayLike$q; var objectCreate = objectCreate$1; var arrayFromConstructorAndList$1 = arrayFromConstructorAndList$3; var push$2 = [].push; var arrayGroupBy = function ($this, callbackfn, that, specificConstructor) { var O = toObject$6($this); var self = IndexedObject(O); var boundFunction = bind$e(callbackfn, that, 3); var target = objectCreate(null); var length = lengthOfArrayLike$3(self); var index = 0; var Constructor, key, value; for (;length > index; index++) { value = self[index]; key = toPropertyKey(boundFunction(value, index, O)); // in some IE10 builds, `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$2.call(target[key], value); else target[key] = [value]; } if (specificConstructor) { Constructor = specificConstructor(O); if (Constructor !== Array) { for (key in target) target[key] = arrayFromConstructorAndList$1(Constructor, target[key]); } } return target; }; var $$1R = _export; var $groupBy$1 = arrayGroupBy; var arraySpeciesConstructor = arraySpeciesConstructor$2; var addToUnscopables$3 = addToUnscopables$h; // `Array.prototype.groupBy` method // https://github.com/tc39/proposal-array-grouping $$1R({ target: 'Array', proto: true }, { groupBy: function groupBy(callbackfn /* , thisArg */) { var thisArg = arguments.length > 1 ? arguments[1] : undefined; return $groupBy$1(this, callbackfn, thisArg, arraySpeciesConstructor); } }); addToUnscopables$3('groupBy'); var $$1Q = _export; var isArray = isArray$8; // eslint-disable-next-line es/no-object-isfrozen -- safe var isFrozen = Object.isFrozen; var isFrozenStringArray = function (array, allowUndefined) { if (!isFrozen || !isArray(array) || !isFrozen(array)) return false; var index = 0; var length = array.length; var element; while (index < length) { element = array[index++]; if (!(typeof element === 'string' || (allowUndefined && typeof element === 'undefined'))) { return false; } } return length !== 0; }; // `Array.isTemplateObject` method // https://github.com/tc39/proposal-array-is-template-object $$1Q({ target: 'Array', stat: true }, { isTemplateObject: function isTemplateObject(value) { if (!isFrozenStringArray(value, true)) return false; var raw = value.raw; if (raw.length !== value.length || !isFrozenStringArray(raw, false)) return false; return true; } }); var DESCRIPTORS$4 = descriptors; var addToUnscopables$2 = addToUnscopables$h; var toObject$5 = toObject$z; var lengthOfArrayLike$2 = lengthOfArrayLike$q; var defineProperty$2 = objectDefineProperty.f; // `Array.prototype.lastIndex` getter // https://github.com/keithamus/proposal-array-last if (DESCRIPTORS$4 && !('lastIndex' in [])) { defineProperty$2(Array.prototype, 'lastIndex', { configurable: true, get: function lastIndex() { var O = toObject$5(this); var len = lengthOfArrayLike$2(O); return len == 0 ? 0 : len - 1; } }); addToUnscopables$2('lastIndex'); } var DESCRIPTORS$3 = descriptors; var addToUnscopables$1 = addToUnscopables$h; var toObject$4 = toObject$z; var lengthOfArrayLike$1 = lengthOfArrayLike$q; var defineProperty$1 = objectDefineProperty.f; // `Array.prototype.lastIndex` accessor // https://github.com/keithamus/proposal-array-last if (DESCRIPTORS$3 && !('lastItem' in [])) { defineProperty$1(Array.prototype, 'lastItem', { configurable: true, get: function lastItem() { var O = toObject$4(this); var len = lengthOfArrayLike$1(O); return len == 0 ? undefined : O[len - 1]; }, set: function lastItem(value) { var O = toObject$4(this); var len = lengthOfArrayLike$1(O); return O[len == 0 ? 0 : len - 1] = value; } }); addToUnscopables$1('lastItem'); } var aCallable$z = aCallable$Q; var lengthOfArrayLike = lengthOfArrayLike$q; var toObject$3 = toObject$z; var getBuiltIn$g = getBuiltIn$y; var arraySpeciesCreate = arraySpeciesCreate$6; var push$1 = [].push; // `Array.prototype.uniqueBy` method // https://github.com/tc39/proposal-array-unique var arrayUniqueBy$1 = function uniqueBy(resolver) { var that = toObject$3(this); var length = lengthOfArrayLike(that); var result = arraySpeciesCreate(that, 0); var Map = getBuiltIn$g('Map'); var map = new Map(); var resolverFunction, index, item, key; if (resolver != null) resolverFunction = aCallable$z(resolver); else resolverFunction = function (value) { return value; }; for (index = 0; index < length; index++) { item = that[index]; key = resolverFunction(item); if (!map.has(key)) map.set(key, item); } map.forEach(function (value) { push$1.call(result, value); }); return result; }; var $$1P = _export; var addToUnscopables = addToUnscopables$h; var uniqueBy = arrayUniqueBy$1; // `Array.prototype.uniqueBy` method // https://github.com/tc39/proposal-array-unique $$1P({ target: 'Array', proto: true }, { uniqueBy: uniqueBy }); addToUnscopables('uniqueBy'); // https://github.com/tc39/proposal-iterator-helpers var $$1O = _export; var anInstance$4 = anInstance$b; var createNonEnumerableProperty$5 = createNonEnumerableProperty$h; var hasOwn$4 = hasOwnProperty_1; var wellKnownSymbol$8 = wellKnownSymbol$G; var AsyncIteratorPrototype$2 = asyncIteratorPrototype; var IS_PURE$C = isPure; var TO_STRING_TAG$4 = wellKnownSymbol$8('toStringTag'); var AsyncIteratorConstructor = function AsyncIterator() { anInstance$4(this, AsyncIteratorConstructor); }; AsyncIteratorConstructor.prototype = AsyncIteratorPrototype$2; if (!hasOwn$4(AsyncIteratorPrototype$2, TO_STRING_TAG$4)) { createNonEnumerableProperty$5(AsyncIteratorPrototype$2, TO_STRING_TAG$4, 'AsyncIterator'); } if (!hasOwn$4(AsyncIteratorPrototype$2, 'constructor') || AsyncIteratorPrototype$2.constructor === Object) { createNonEnumerableProperty$5(AsyncIteratorPrototype$2, 'constructor', AsyncIteratorConstructor); } $$1O({ global: true, forced: IS_PURE$C }, { AsyncIterator: AsyncIteratorConstructor }); var aCallable$y = aCallable$Q; var anObject$10 = anObject$1C; var create$4 = objectCreate$1; var createNonEnumerableProperty$4 = createNonEnumerableProperty$h; var redefineAll$3 = redefineAll$a; var wellKnownSymbol$7 = wellKnownSymbol$G; var InternalStateModule$8 = internalState; var getBuiltIn$f = getBuiltIn$y; var getMethod$3 = getMethod$h; var AsyncIteratorPrototype$1 = asyncIteratorPrototype; var Promise$2 = getBuiltIn$f('Promise'); var setInternalState$8 = InternalStateModule$8.set; var getInternalState$6 = InternalStateModule$8.get; var TO_STRING_TAG$3 = wellKnownSymbol$7('toStringTag'); var asyncIteratorCreateProxy = function (nextHandler, IS_ITERATOR) { var AsyncIteratorProxy = function AsyncIterator(state) { state.next = aCallable$y(state.iterator.next); state.done = false; state.ignoreArgument = !IS_ITERATOR; setInternalState$8(this, state); }; AsyncIteratorProxy.prototype = redefineAll$3(create$4(AsyncIteratorPrototype$1), { next: function next(arg) { var that = this; var hasArgument = !!arguments.length; return new Promise$2(function (resolve) { var state = getInternalState$6(that); var args = hasArgument ? [state.ignoreArgument ? undefined : arg] : IS_ITERATOR ? [] : [undefined]; state.ignoreArgument = false; resolve(state.done ? { done: true, value: undefined } : anObject$10(nextHandler.call(state, Promise$2, args))); }); }, 'return': function (value) { var that = this; return new Promise$2(function (resolve, reject) { var state = getInternalState$6(that); var iterator = state.iterator; state.done = true; var $$return = getMethod$3(iterator, 'return'); if ($$return === undefined) return resolve({ done: true, value: value }); Promise$2.resolve($$return.call(iterator, value)).then(function (result) { anObject$10(result); resolve({ done: true, value: value }); }, reject); }); }, 'throw': function (value) { var that = this; return new Promise$2(function (resolve, reject) { var state = getInternalState$6(that); var iterator = state.iterator; state.done = true; var $$throw = getMethod$3(iterator, 'throw'); if ($$throw === undefined) return reject(value); resolve($$throw.call(iterator, value)); }); } }); if (!IS_ITERATOR) { createNonEnumerableProperty$4(AsyncIteratorProxy.prototype, TO_STRING_TAG$3, 'Generator'); } return AsyncIteratorProxy; }; // https://github.com/tc39/proposal-iterator-helpers var $$1N = _export; var anObject$$ = anObject$1C; var createAsyncIteratorProxy$6 = asyncIteratorCreateProxy; var AsyncIteratorProxy$6 = createAsyncIteratorProxy$6(function (Promise, args) { var state = this; var iterator = state.iterator; return Promise.resolve(anObject$$(state.next.apply(iterator, args))).then(function (step) { if (anObject$$(step).done) { state.done = true; return { done: true, value: undefined }; } return { done: false, value: [state.index++, step.value] }; }); }); $$1N({ target: 'AsyncIterator', proto: true, real: true }, { asIndexedPairs: function asIndexedPairs() { return new AsyncIteratorProxy$6({ iterator: anObject$$(this), index: 0 }); } }); // https://github.com/tc39/proposal-iterator-helpers var $$1M = _export; var anObject$_ = anObject$1C; var toPositiveInteger$3 = toPositiveInteger$5; var createAsyncIteratorProxy$5 = asyncIteratorCreateProxy; var AsyncIteratorProxy$5 = createAsyncIteratorProxy$5(function (Promise, args) { var state = this; return new Promise(function (resolve, reject) { var loop = function () { try { Promise.resolve( anObject$_(state.next.apply(state.iterator, state.remaining ? [] : args)) ).then(function (step) { try { if (anObject$_(step).done) { state.done = true; resolve({ done: true, value: undefined }); } else if (state.remaining) { state.remaining--; loop(); } else resolve({ done: false, value: step.value }); } catch (err) { reject(err); } }, reject); } catch (error) { reject(error); } }; loop(); }); }); $$1M({ target: 'AsyncIterator', proto: true, real: true }, { drop: function drop(limit) { return new AsyncIteratorProxy$5({ iterator: anObject$_(this), remaining: toPositiveInteger$3(limit) }); } }); // https://github.com/tc39/proposal-iterator-helpers var $$1L = _export; var $every = asyncIteratorIteration.every; $$1L({ target: 'AsyncIterator', proto: true, real: true }, { every: function every(fn) { return $every(this, fn); } }); // https://github.com/tc39/proposal-iterator-helpers var $$1K = _export; var aCallable$x = aCallable$Q; var anObject$Z = anObject$1C; var createAsyncIteratorProxy$4 = asyncIteratorCreateProxy; var AsyncIteratorProxy$4 = createAsyncIteratorProxy$4(function (Promise, args) { var state = this; var filterer = state.filterer; return new Promise(function (resolve, reject) { var loop = function () { try { Promise.resolve(anObject$Z(state.next.apply(state.iterator, args))).then(function (step) { try { if (anObject$Z(step).done) { state.done = true; resolve({ done: true, value: undefined }); } else { var value = step.value; Promise.resolve(filterer(value)).then(function (selected) { selected ? resolve({ done: false, value: value }) : loop(); }, reject); } } catch (err) { reject(err); } }, reject); } catch (error) { reject(error); } }; loop(); }); }); $$1K({ target: 'AsyncIterator', proto: true, real: true }, { filter: function filter(filterer) { return new AsyncIteratorProxy$4({ iterator: anObject$Z(this), filterer: aCallable$x(filterer) }); } }); // https://github.com/tc39/proposal-iterator-helpers var $$1J = _export; var $find = asyncIteratorIteration.find; $$1J({ target: 'AsyncIterator', proto: true, real: true }, { find: function find(fn) { return $find(this, fn); } }); // https://github.com/tc39/proposal-iterator-helpers var $$1I = _export; var aCallable$w = aCallable$Q; var anObject$Y = anObject$1C; var createAsyncIteratorProxy$3 = asyncIteratorCreateProxy; var getAsyncIterator$1 = getAsyncIterator$3; var AsyncIteratorProxy$3 = createAsyncIteratorProxy$3(function (Promise) { var state = this; var mapper = state.mapper; var innerIterator; return new Promise(function (resolve, reject) { var outerLoop = function () { try { Promise.resolve(anObject$Y(state.next.call(state.iterator))).then(function (step) { try { if (anObject$Y(step).done) { state.done = true; resolve({ done: true, value: undefined }); } else { Promise.resolve(mapper(step.value)).then(function (mapped) { try { state.innerIterator = innerIterator = getAsyncIterator$1(mapped); state.innerNext = aCallable$w(innerIterator.next); return innerLoop(); } catch (error2) { reject(error2); } }, reject); } } catch (error1) { reject(error1); } }, reject); } catch (error) { reject(error); } }; var innerLoop = function () { if (innerIterator = state.innerIterator) { try { Promise.resolve(anObject$Y(state.innerNext.call(innerIterator))).then(function (result) { try { if (anObject$Y(result).done) { state.innerIterator = state.innerNext = null; outerLoop(); } else resolve({ done: false, value: result.value }); } catch (error1) { reject(error1); } }, reject); } catch (error) { reject(error); } } else outerLoop(); }; innerLoop(); }); }); $$1I({ target: 'AsyncIterator', proto: true, real: true }, { flatMap: function flatMap(mapper) { return new AsyncIteratorProxy$3({ iterator: anObject$Y(this), mapper: aCallable$w(mapper), innerIterator: null, innerNext: null }); } }); // https://github.com/tc39/proposal-iterator-helpers var $$1H = _export; var $forEach = asyncIteratorIteration.forEach; $$1H({ target: 'AsyncIterator', proto: true, real: true }, { forEach: function forEach(fn) { return $forEach(this, fn); } }); // https://github.com/tc39/proposal-iterator-helpers var $$1G = _export; var anObject$X = anObject$1C; var toObject$2 = toObject$z; var AsyncIteratorPrototype = asyncIteratorPrototype; var createAsyncIteratorProxy$2 = asyncIteratorCreateProxy; var getAsyncIterator = getAsyncIterator$3; var getIterator$5 = getIterator$b; var getIteratorMethod$3 = getIteratorMethod$9; var getMethod$2 = getMethod$h; var wellKnownSymbol$6 = wellKnownSymbol$G; var AsyncFromSyncIterator = asyncFromSyncIterator; var ASYNC_ITERATOR = wellKnownSymbol$6('asyncIterator'); var isPrototypeOf$1 = {}.isPrototypeOf; var AsyncIteratorProxy$2 = createAsyncIteratorProxy$2(function (Promise, args) { return anObject$X(this.next.apply(this.iterator, args)); }, true); $$1G({ target: 'AsyncIterator', stat: true }, { from: function from(O) { var object = toObject$2(O); var usingIterator = getMethod$2(object, ASYNC_ITERATOR); var iterator; if (usingIterator) { iterator = getAsyncIterator(object, usingIterator); if (isPrototypeOf$1.call(AsyncIteratorPrototype, iterator)) return iterator; } if (iterator === undefined) { usingIterator = getIteratorMethod$3(object); if (usingIterator) return new AsyncFromSyncIterator(getIterator$5(object, usingIterator)); } return new AsyncIteratorProxy$2({ iterator: iterator !== undefined ? iterator : object }); } }); // https://github.com/tc39/proposal-iterator-helpers var $$1F = _export; var aCallable$v = aCallable$Q; var anObject$W = anObject$1C; var createAsyncIteratorProxy$1 = asyncIteratorCreateProxy; var AsyncIteratorProxy$1 = createAsyncIteratorProxy$1(function (Promise, args) { var state = this; var mapper = state.mapper; return Promise.resolve(anObject$W(state.next.apply(state.iterator, args))).then(function (step) { if (anObject$W(step).done) { state.done = true; return { done: true, value: undefined }; } return Promise.resolve(mapper(step.value)).then(function (value) { return { done: false, value: value }; }); }); }); $$1F({ target: 'AsyncIterator', proto: true, real: true }, { map: function map(mapper) { return new AsyncIteratorProxy$1({ iterator: anObject$W(this), mapper: aCallable$v(mapper) }); } }); // https://github.com/tc39/proposal-iterator-helpers var $$1E = _export; var aCallable$u = aCallable$Q; var anObject$V = anObject$1C; var getBuiltIn$e = getBuiltIn$y; var Promise$1 = getBuiltIn$e('Promise'); $$1E({ target: 'AsyncIterator', proto: true, real: true }, { reduce: function reduce(reducer /* , initialValue */) { var iterator = anObject$V(this); var next = aCallable$u(iterator.next); var noInitial = arguments.length < 2; var accumulator = noInitial ? undefined : arguments[1]; aCallable$u(reducer); return new Promise$1(function (resolve, reject) { var loop = function () { try { Promise$1.resolve(anObject$V(next.call(iterator))).then(function (step) { try { if (anObject$V(step).done) { noInitial ? reject(TypeError('Reduce of empty iterator with no initial value')) : resolve(accumulator); } else { var value = step.value; if (noInitial) { noInitial = false; accumulator = value; loop(); } else { Promise$1.resolve(reducer(accumulator, value)).then(function (result) { accumulator = result; loop(); }, reject); } } } catch (err) { reject(err); } }, reject); } catch (error) { reject(error); } }; loop(); }); } }); // https://github.com/tc39/proposal-iterator-helpers var $$1D = _export; var $some = asyncIteratorIteration.some; $$1D({ target: 'AsyncIterator', proto: true, real: true }, { some: function some(fn) { return $some(this, fn); } }); // https://github.com/tc39/proposal-iterator-helpers var $$1C = _export; var anObject$U = anObject$1C; var toPositiveInteger$2 = toPositiveInteger$5; var createAsyncIteratorProxy = asyncIteratorCreateProxy; var AsyncIteratorProxy = createAsyncIteratorProxy(function (Promise, args) { var iterator = this.iterator; var returnMethod, result; if (!this.remaining--) { result = { done: true, value: undefined }; this.done = true; returnMethod = iterator['return']; if (returnMethod !== undefined) { return Promise.resolve(returnMethod.call(iterator)).then(function () { return result; }); } return result; } return this.next.apply(iterator, args); }); $$1C({ target: 'AsyncIterator', proto: true, real: true }, { take: function take(limit) { return new AsyncIteratorProxy({ iterator: anObject$U(this), remaining: toPositiveInteger$2(limit) }); } }); // https://github.com/tc39/proposal-iterator-helpers var $$1B = _export; var $toArray = asyncIteratorIteration.toArray; $$1B({ target: 'AsyncIterator', proto: true, real: true }, { toArray: function toArray() { return $toArray(this, undefined, []); } }); var InternalStateModule$7 = internalState; var createIteratorConstructor$4 = createIteratorConstructor$7; var isObject$3 = isObject$C; var defineProperties$1 = objectDefineProperties; var DESCRIPTORS$2 = descriptors; var INCORRECT_RANGE = 'Incorrect Number.range arguments'; var NUMERIC_RANGE_ITERATOR = 'NumericRangeIterator'; var setInternalState$7 = InternalStateModule$7.set; var getInternalState$5 = InternalStateModule$7.getterFor(NUMERIC_RANGE_ITERATOR); var $RangeIterator = createIteratorConstructor$4(function NumericRangeIterator(start, end, option, type, zero, one) { if (typeof start != type || (end !== Infinity && end !== -Infinity && typeof end != type)) { throw new TypeError(INCORRECT_RANGE); } if (start === Infinity || start === -Infinity) { throw new RangeError(INCORRECT_RANGE); } var ifIncrease = end > start; var inclusiveEnd = false; var step; if (option === undefined) { step = undefined; } else if (isObject$3(option)) { step = option.step; inclusiveEnd = !!option.inclusive; } else if (typeof option == type) { step = option; } else { throw new TypeError(INCORRECT_RANGE); } if (step == null) { step = ifIncrease ? one : -one; } if (typeof step != type) { throw new TypeError(INCORRECT_RANGE); } if (step === Infinity || step === -Infinity || (step === zero && start !== end)) { throw new RangeError(INCORRECT_RANGE); } // eslint-disable-next-line no-self-compare -- NaN check var hitsEnd = start != start || end != end || step != step || (end > start) !== (step > zero); setInternalState$7(this, { type: NUMERIC_RANGE_ITERATOR, start: start, end: end, step: step, inclusiveEnd: inclusiveEnd, hitsEnd: hitsEnd, currentCount: zero, zero: zero }); if (!DESCRIPTORS$2) { 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 { value: undefined, done: 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.inclusiveEnd; var endCondition; if (end > start) { endCondition = inclusiveEnd ? currentYieldingValue > end : currentYieldingValue >= end; } else { endCondition = inclusiveEnd ? end > currentYieldingValue : end >= currentYieldingValue; } if (endCondition) { return { value: undefined, done: state.hitsEnd = true }; } return { value: currentYieldingValue, done: false }; }); var getter = function (fn) { return { get: fn, set: function () { /* empty */ }, configurable: true, enumerable: false }; }; if (DESCRIPTORS$2) { defineProperties$1($RangeIterator.prototype, { start: getter(function () { return getInternalState$5(this).start; }), end: getter(function () { return getInternalState$5(this).end; }), inclusive: getter(function () { return getInternalState$5(this).inclusiveEnd; }), step: getter(function () { return getInternalState$5(this).step; }) }); } var numericRangeIterator = $RangeIterator; /* eslint-disable es/no-bigint -- safe */ var $$1A = _export; var NumericRangeIterator$1 = numericRangeIterator; // `BigInt.range` method // https://github.com/tc39/proposal-Number.range if (typeof BigInt == 'function') { $$1A({ target: 'BigInt', stat: true }, { range: function range(start, end, option) { return new NumericRangeIterator$1(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 Map$2 = es_map; var WeakMap$1 = es_weakMap.exports; var create$3 = objectCreate$1; var isObject$2 = isObject$C; var Node = function () { // keys this.object = null; this.symbol = null; // child nodes this.primitives = null; this.objectsByIndex = create$3(null); }; Node.prototype.get = function (key, initializer) { return this[key] || (this[key] = initializer()); }; Node.prototype.next = function (i, it, IS_OBJECT) { var store = IS_OBJECT ? this.objectsByIndex[i] || (this.objectsByIndex[i] = new WeakMap$1()) : this.primitives || (this.primitives = new Map$2()); var entry = store.get(it); if (!entry) store.set(it, entry = new Node()); return entry; }; var root = new Node(); 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$2(it = arguments[i])) active = active.next(i, it, true); } if (this === Object && active === root) throw TypeError('Composite keys must contain a non-primitive component'); for (i = 0; i < length; i++) { if (!isObject$2(it = arguments[i])) active = active.next(i, it, false); } return active; }; var $$1z = _export; var getCompositeKeyNode$1 = compositeKey; var getBuiltIn$d = getBuiltIn$y; var create$2 = objectCreate$1; var initializer = function () { var freeze = getBuiltIn$d('Object', 'freeze'); return freeze ? freeze(create$2(null)) : create$2(null); }; // https://github.com/tc39/proposal-richer-keys/tree/master/compositeKey $$1z({ global: true }, { compositeKey: function compositeKey() { return getCompositeKeyNode$1.apply(Object, arguments).get('object', initializer); } }); var $$1y = _export; var getCompositeKeyNode = compositeKey; var getBuiltIn$c = getBuiltIn$y; // https://github.com/tc39/proposal-richer-keys/tree/master/compositeKey $$1y({ global: true }, { compositeSymbol: function compositeSymbol() { if (arguments.length === 1 && typeof arguments[0] === 'string') return getBuiltIn$c('Symbol')['for'](arguments[0]); return getCompositeKeyNode.apply(null, arguments).get('symbol', getBuiltIn$c('Symbol')); } }); // https://github.com/tc39/proposal-iterator-helpers var $$1x = _export; var global$7 = global$R; var anInstance$3 = anInstance$b; var isCallable$5 = isCallable$z; var createNonEnumerableProperty$3 = createNonEnumerableProperty$h; var fails$2 = fails$15; var hasOwn$3 = hasOwnProperty_1; var wellKnownSymbol$5 = wellKnownSymbol$G; var IteratorPrototype$2 = iteratorsCore.IteratorPrototype; var TO_STRING_TAG$2 = wellKnownSymbol$5('toStringTag'); var NativeIterator = global$7.Iterator; // FF56- have non-standard global helper `Iterator` var FORCED$2 = !isCallable$5(NativeIterator) || NativeIterator.prototype !== IteratorPrototype$2 // FF44- non-standard `Iterator` passes previous tests || !fails$2(function () { NativeIterator({}); }); var IteratorConstructor = function Iterator() { anInstance$3(this, IteratorConstructor); }; if (!hasOwn$3(IteratorPrototype$2, TO_STRING_TAG$2)) { createNonEnumerableProperty$3(IteratorPrototype$2, TO_STRING_TAG$2, 'Iterator'); } if (FORCED$2 || !hasOwn$3(IteratorPrototype$2, 'constructor') || IteratorPrototype$2.constructor === Object) { createNonEnumerableProperty$3(IteratorPrototype$2, 'constructor', IteratorConstructor); } IteratorConstructor.prototype = IteratorPrototype$2; $$1x({ global: true, forced: FORCED$2 }, { Iterator: IteratorConstructor }); var aCallable$t = aCallable$Q; var anObject$T = anObject$1C; var create$1 = objectCreate$1; var createNonEnumerableProperty$2 = createNonEnumerableProperty$h; var redefineAll$2 = redefineAll$a; var wellKnownSymbol$4 = wellKnownSymbol$G; var InternalStateModule$6 = internalState; var getMethod$1 = getMethod$h; var IteratorPrototype$1 = iteratorsCore.IteratorPrototype; var setInternalState$6 = InternalStateModule$6.set; var getInternalState$4 = InternalStateModule$6.get; var TO_STRING_TAG$1 = wellKnownSymbol$4('toStringTag'); var iteratorCreateProxy = function (nextHandler, IS_ITERATOR) { var IteratorProxy = function Iterator(state) { state.next = aCallable$t(state.iterator.next); state.done = false; state.ignoreArg = !IS_ITERATOR; setInternalState$6(this, state); }; IteratorProxy.prototype = redefineAll$2(create$1(IteratorPrototype$1), { next: function next(arg) { var state = getInternalState$4(this); var args = arguments.length ? [state.ignoreArg ? undefined : arg] : IS_ITERATOR ? [] : [undefined]; state.ignoreArg = false; var result = state.done ? undefined : nextHandler.call(state, args); return { done: state.done, value: result }; }, 'return': function (value) { var state = getInternalState$4(this); var iterator = state.iterator; state.done = true; var $$return = getMethod$1(iterator, 'return'); return { done: true, value: $$return ? anObject$T($$return.call(iterator, value)).value : value }; }, 'throw': function (value) { var state = getInternalState$4(this); var iterator = state.iterator; state.done = true; var $$throw = getMethod$1(iterator, 'throw'); if ($$throw) return $$throw.call(iterator, value); throw value; } }); if (!IS_ITERATOR) { createNonEnumerableProperty$2(IteratorProxy.prototype, TO_STRING_TAG$1, 'Generator'); } return IteratorProxy; }; // https://github.com/tc39/proposal-iterator-helpers var $$1w = _export; var anObject$S = anObject$1C; var createIteratorProxy$6 = iteratorCreateProxy; var IteratorProxy$6 = createIteratorProxy$6(function (args) { var result = anObject$S(this.next.apply(this.iterator, args)); var done = this.done = !!result.done; if (!done) return [this.index++, result.value]; }); $$1w({ target: 'Iterator', proto: true, real: true }, { asIndexedPairs: function asIndexedPairs() { return new IteratorProxy$6({ iterator: anObject$S(this), index: 0 }); } }); // https://github.com/tc39/proposal-iterator-helpers var $$1v = _export; var anObject$R = anObject$1C; var toPositiveInteger$1 = toPositiveInteger$5; var createIteratorProxy$5 = iteratorCreateProxy; var IteratorProxy$5 = createIteratorProxy$5(function (args) { var iterator = this.iterator; var next = this.next; var result, done; while (this.remaining) { this.remaining--; result = anObject$R(next.call(iterator)); done = this.done = !!result.done; if (done) return; } result = anObject$R(next.apply(iterator, args)); done = this.done = !!result.done; if (!done) return result.value; }); $$1v({ target: 'Iterator', proto: true, real: true }, { drop: function drop(limit) { return new IteratorProxy$5({ iterator: anObject$R(this), remaining: toPositiveInteger$1(limit) }); } }); // https://github.com/tc39/proposal-iterator-helpers var $$1u = _export; var iterate$z = iterate$I; var aCallable$s = aCallable$Q; var anObject$Q = anObject$1C; $$1u({ target: 'Iterator', proto: true, real: true }, { every: function every(fn) { anObject$Q(this); aCallable$s(fn); return !iterate$z(this, function (value, stop) { if (!fn(value)) return stop(); }, { IS_ITERATOR: true, INTERRUPTED: true }).stopped; } }); // https://github.com/tc39/proposal-iterator-helpers var $$1t = _export; var aCallable$r = aCallable$Q; var anObject$P = anObject$1C; var createIteratorProxy$4 = iteratorCreateProxy; var callWithSafeIterationClosing$1 = callWithSafeIterationClosing$3; var IteratorProxy$4 = createIteratorProxy$4(function (args) { var iterator = this.iterator; var filterer = this.filterer; var next = this.next; var result, done, value; while (true) { result = anObject$P(next.apply(iterator, args)); done = this.done = !!result.done; if (done) return; value = result.value; if (callWithSafeIterationClosing$1(iterator, filterer, value)) return value; } }); $$1t({ target: 'Iterator', proto: true, real: true }, { filter: function filter(filterer) { return new IteratorProxy$4({ iterator: anObject$P(this), filterer: aCallable$r(filterer) }); } }); // https://github.com/tc39/proposal-iterator-helpers var $$1s = _export; var iterate$y = iterate$I; var aCallable$q = aCallable$Q; var anObject$O = anObject$1C; $$1s({ target: 'Iterator', proto: true, real: true }, { find: function find(fn) { anObject$O(this); aCallable$q(fn); return iterate$y(this, function (value, stop) { if (fn(value)) return stop(value); }, { IS_ITERATOR: true, INTERRUPTED: true }).result; } }); // https://github.com/tc39/proposal-iterator-helpers var $$1r = _export; var aCallable$p = aCallable$Q; var anObject$N = anObject$1C; var getIteratorMethod$2 = getIteratorMethod$9; var createIteratorProxy$3 = iteratorCreateProxy; var iteratorClose$1 = iteratorClose$4; var IteratorProxy$3 = createIteratorProxy$3(function () { var iterator = this.iterator; var mapper = this.mapper; var result, mapped, iteratorMethod, innerIterator; while (true) { try { if (innerIterator = this.innerIterator) { result = anObject$N(this.innerNext.call(innerIterator)); if (!result.done) return result.value; this.innerIterator = this.innerNext = null; } result = anObject$N(this.next.call(iterator)); if (this.done = !!result.done) return; mapped = mapper(result.value); iteratorMethod = getIteratorMethod$2(mapped); if (!iteratorMethod) { throw TypeError('.flatMap callback should return an iterable object'); } this.innerIterator = innerIterator = anObject$N(iteratorMethod.call(mapped)); this.innerNext = aCallable$p(innerIterator.next); } catch (error) { iteratorClose$1(iterator, 'throw', error); } } }); $$1r({ target: 'Iterator', proto: true, real: true }, { flatMap: function flatMap(mapper) { return new IteratorProxy$3({ iterator: anObject$N(this), mapper: aCallable$p(mapper), innerIterator: null, innerNext: null }); } }); // https://github.com/tc39/proposal-iterator-helpers var $$1q = _export; var iterate$x = iterate$I; var anObject$M = anObject$1C; $$1q({ target: 'Iterator', proto: true, real: true }, { forEach: function forEach(fn) { iterate$x(anObject$M(this), fn, { IS_ITERATOR: true }); } }); // https://github.com/tc39/proposal-iterator-helpers var $$1p = _export; var anObject$L = anObject$1C; var toObject$1 = toObject$z; var IteratorPrototype = iteratorsCore.IteratorPrototype; var createIteratorProxy$2 = iteratorCreateProxy; var getIterator$4 = getIterator$b; var getIteratorMethod$1 = getIteratorMethod$9; var isPrototypeOf = {}.isPrototypeOf; var IteratorProxy$2 = createIteratorProxy$2(function (args) { var result = anObject$L(this.next.apply(this.iterator, args)); var done = this.done = !!result.done; if (!done) return result.value; }, true); $$1p({ target: 'Iterator', stat: true }, { from: function from(O) { var object = toObject$1(O); var usingIterator = getIteratorMethod$1(object); var iterator; if (usingIterator) { iterator = getIterator$4(object, usingIterator); if (isPrototypeOf.call(IteratorPrototype, iterator)) return iterator; } else { iterator = object; } return new IteratorProxy$2({ iterator: iterator }); } }); // https://github.com/tc39/proposal-iterator-helpers var $$1o = _export; var aCallable$o = aCallable$Q; var anObject$K = anObject$1C; var createIteratorProxy$1 = iteratorCreateProxy; var callWithSafeIterationClosing = callWithSafeIterationClosing$3; var IteratorProxy$1 = createIteratorProxy$1(function (args) { var iterator = this.iterator; var result = anObject$K(this.next.apply(iterator, args)); var done = this.done = !!result.done; if (!done) return callWithSafeIterationClosing(iterator, this.mapper, result.value); }); $$1o({ target: 'Iterator', proto: true, real: true }, { map: function map(mapper) { return new IteratorProxy$1({ iterator: anObject$K(this), mapper: aCallable$o(mapper) }); } }); // https://github.com/tc39/proposal-iterator-helpers var $$1n = _export; var iterate$w = iterate$I; var aCallable$n = aCallable$Q; var anObject$J = anObject$1C; $$1n({ target: 'Iterator', proto: true, real: true }, { reduce: function reduce(reducer /* , initialValue */) { anObject$J(this); aCallable$n(reducer); var noInitial = arguments.length < 2; var accumulator = noInitial ? undefined : arguments[1]; iterate$w(this, function (value) { if (noInitial) { noInitial = false; accumulator = value; } else { accumulator = reducer(accumulator, value); } }, { IS_ITERATOR: true }); if (noInitial) throw TypeError('Reduce of empty iterator with no initial value'); return accumulator; } }); // https://github.com/tc39/proposal-iterator-helpers var $$1m = _export; var iterate$v = iterate$I; var aCallable$m = aCallable$Q; var anObject$I = anObject$1C; $$1m({ target: 'Iterator', proto: true, real: true }, { some: function some(fn) { anObject$I(this); aCallable$m(fn); return iterate$v(this, function (value, stop) { if (fn(value)) return stop(); }, { IS_ITERATOR: true, INTERRUPTED: true }).stopped; } }); // https://github.com/tc39/proposal-iterator-helpers var $$1l = _export; var anObject$H = anObject$1C; var toPositiveInteger = toPositiveInteger$5; var createIteratorProxy = iteratorCreateProxy; var iteratorClose = iteratorClose$4; var IteratorProxy = createIteratorProxy(function (args) { var iterator = this.iterator; if (!this.remaining--) { this.done = true; return iteratorClose(iterator, 'normal', undefined); } var result = anObject$H(this.next.apply(iterator, args)); var done = this.done = !!result.done; if (!done) return result.value; }); $$1l({ target: 'Iterator', proto: true, real: true }, { take: function take(limit) { return new IteratorProxy({ iterator: anObject$H(this), remaining: toPositiveInteger(limit) }); } }); // https://github.com/tc39/proposal-iterator-helpers var $$1k = _export; var iterate$u = iterate$I; var anObject$G = anObject$1C; var push = [].push; $$1k({ target: 'Iterator', proto: true, real: true }, { toArray: function toArray() { var result = []; iterate$u(anObject$G(this), push, { that: result, IS_ITERATOR: true }); return result; } }); var aCallable$l = aCallable$Q; var anObject$F = anObject$1C; // https://github.com/tc39/collection-methods var collectionDeleteAll$4 = function (/* ...elements */) { var collection = anObject$F(this); var remover = aCallable$l(collection['delete']); var allDeleted = true; var wasDeleted; for (var k = 0, len = arguments.length; k < len; k++) { wasDeleted = remover.call(collection, arguments[k]); allDeleted = allDeleted && wasDeleted; } return !!allDeleted; }; var $$1j = _export; var IS_PURE$B = isPure; var collectionDeleteAll$3 = collectionDeleteAll$4; // `Map.prototype.deleteAll` method // https://github.com/tc39/proposal-collection-methods $$1j({ target: 'Map', proto: true, real: true, forced: IS_PURE$B }, { deleteAll: function deleteAll(/* ...elements */) { return collectionDeleteAll$3.apply(this, arguments); } }); var anObject$E = anObject$1C; // `Map.prototype.emplace` method // https://github.com/thumbsupep/proposal-upsert var mapEmplace = function emplace(key, handler) { var map = anObject$E(this); var value = (map.has(key) && 'update' in handler) ? handler.update(map.get(key), key, map) : handler.insert(key, map); map.set(key, value); return value; }; var $$1i = _export; var IS_PURE$A = isPure; var $emplace$1 = mapEmplace; // `Map.prototype.emplace` method // https://github.com/thumbsupep/proposal-upsert $$1i({ target: 'Map', proto: true, real: true, forced: IS_PURE$A }, { emplace: $emplace$1 }); var getMapIterator$a = function (it) { // eslint-disable-next-line es/no-map -- safe return Map.prototype.entries.call(it); }; var $$1h = _export; var IS_PURE$z = isPure; var anObject$D = anObject$1C; var bind$d = functionBindContext; var getMapIterator$9 = getMapIterator$a; var iterate$t = iterate$I; // `Map.prototype.every` method // https://github.com/tc39/proposal-collection-methods $$1h({ target: 'Map', proto: true, real: true, forced: IS_PURE$z }, { every: function every(callbackfn /* , thisArg */) { var map = anObject$D(this); var iterator = getMapIterator$9(map); var boundFunction = bind$d(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); return !iterate$t(iterator, function (key, value, stop) { if (!boundFunction(value, key, map)) return stop(); }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).stopped; } }); var $$1g = _export; var IS_PURE$y = isPure; var getBuiltIn$b = getBuiltIn$y; var aCallable$k = aCallable$Q; var anObject$C = anObject$1C; var bind$c = functionBindContext; var speciesConstructor$8 = speciesConstructor$f; var getMapIterator$8 = getMapIterator$a; var iterate$s = iterate$I; // `Map.prototype.filter` method // https://github.com/tc39/proposal-collection-methods $$1g({ target: 'Map', proto: true, real: true, forced: IS_PURE$y }, { filter: function filter(callbackfn /* , thisArg */) { var map = anObject$C(this); var iterator = getMapIterator$8(map); var boundFunction = bind$c(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); var newMap = new (speciesConstructor$8(map, getBuiltIn$b('Map')))(); var setter = aCallable$k(newMap.set); iterate$s(iterator, function (key, value) { if (boundFunction(value, key, map)) setter.call(newMap, key, value); }, { AS_ENTRIES: true, IS_ITERATOR: true }); return newMap; } }); var $$1f = _export; var IS_PURE$x = isPure; var anObject$B = anObject$1C; var bind$b = functionBindContext; var getMapIterator$7 = getMapIterator$a; var iterate$r = iterate$I; // `Map.prototype.find` method // https://github.com/tc39/proposal-collection-methods $$1f({ target: 'Map', proto: true, real: true, forced: IS_PURE$x }, { find: function find(callbackfn /* , thisArg */) { var map = anObject$B(this); var iterator = getMapIterator$7(map); var boundFunction = bind$b(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); return iterate$r(iterator, function (key, value, stop) { if (boundFunction(value, key, map)) return stop(value); }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).result; } }); var $$1e = _export; var IS_PURE$w = isPure; var anObject$A = anObject$1C; var bind$a = functionBindContext; var getMapIterator$6 = getMapIterator$a; var iterate$q = iterate$I; // `Map.prototype.findKey` method // https://github.com/tc39/proposal-collection-methods $$1e({ target: 'Map', proto: true, real: true, forced: IS_PURE$w }, { findKey: function findKey(callbackfn /* , thisArg */) { var map = anObject$A(this); var iterator = getMapIterator$6(map); var boundFunction = bind$a(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); return iterate$q(iterator, function (key, value, stop) { if (boundFunction(value, key, map)) return stop(key); }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).result; } }); // https://tc39.github.io/proposal-setmap-offrom/ var aCallable$j = aCallable$Q; var aConstructor$1 = aConstructor$5; var bind$9 = functionBindContext; var iterate$p = iterate$I; 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$j(mapFn); if (source == undefined) return new this(); array = []; if (mapping) { n = 0; boundFunction = bind$9(mapFn, length > 2 ? arguments[2] : undefined, 2); iterate$p(source, function (nextItem) { array.push(boundFunction(nextItem, n++)); }); } else { iterate$p(source, array.push, { that: array }); } return new this(array); }; var $$1d = _export; var from$4 = collectionFrom; // `Map.from` method // https://tc39.github.io/proposal-setmap-offrom/#sec-map.from $$1d({ target: 'Map', stat: true }, { from: from$4 }); var $$1c = _export; var aCallable$i = aCallable$Q; var getIterator$3 = getIterator$b; var iterate$o = iterate$I; // `Map.groupBy` method // https://github.com/tc39/proposal-collection-methods $$1c({ target: 'Map', stat: true }, { groupBy: function groupBy(iterable, keyDerivative) { aCallable$i(keyDerivative); var iterator = getIterator$3(iterable); var newMap = new this(); var has = aCallable$i(newMap.has); var get = aCallable$i(newMap.get); var set = aCallable$i(newMap.set); iterate$o(iterator, function (element) { var derivedKey = keyDerivative(element); if (!has.call(newMap, derivedKey)) set.call(newMap, derivedKey, [element]); else get.call(newMap, derivedKey).push(element); }, { IS_ITERATOR: true }); return newMap; } }); // `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 $$1b = _export; var IS_PURE$v = isPure; var anObject$z = anObject$1C; var getMapIterator$5 = getMapIterator$a; var sameValueZero = sameValueZero$1; var iterate$n = iterate$I; // `Map.prototype.includes` method // https://github.com/tc39/proposal-collection-methods $$1b({ target: 'Map', proto: true, real: true, forced: IS_PURE$v }, { includes: function includes(searchElement) { return iterate$n(getMapIterator$5(anObject$z(this)), function (key, value, stop) { if (sameValueZero(value, searchElement)) return stop(); }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).stopped; } }); var $$1a = _export; var iterate$m = iterate$I; var aCallable$h = aCallable$Q; // `Map.keyBy` method // https://github.com/tc39/proposal-collection-methods $$1a({ target: 'Map', stat: true }, { keyBy: function keyBy(iterable, keyDerivative) { var newMap = new this(); aCallable$h(keyDerivative); var setter = aCallable$h(newMap.set); iterate$m(iterable, function (element) { setter.call(newMap, keyDerivative(element), element); }); return newMap; } }); var $$19 = _export; var IS_PURE$u = isPure; var anObject$y = anObject$1C; var getMapIterator$4 = getMapIterator$a; var iterate$l = iterate$I; // `Map.prototype.keyOf` method // https://github.com/tc39/proposal-collection-methods $$19({ target: 'Map', proto: true, real: true, forced: IS_PURE$u }, { keyOf: function keyOf(searchElement) { return iterate$l(getMapIterator$4(anObject$y(this)), function (key, value, stop) { if (value === searchElement) return stop(key); }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).result; } }); var $$18 = _export; var IS_PURE$t = isPure; var getBuiltIn$a = getBuiltIn$y; var aCallable$g = aCallable$Q; var anObject$x = anObject$1C; var bind$8 = functionBindContext; var speciesConstructor$7 = speciesConstructor$f; var getMapIterator$3 = getMapIterator$a; var iterate$k = iterate$I; // `Map.prototype.mapKeys` method // https://github.com/tc39/proposal-collection-methods $$18({ target: 'Map', proto: true, real: true, forced: IS_PURE$t }, { mapKeys: function mapKeys(callbackfn /* , thisArg */) { var map = anObject$x(this); var iterator = getMapIterator$3(map); var boundFunction = bind$8(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); var newMap = new (speciesConstructor$7(map, getBuiltIn$a('Map')))(); var setter = aCallable$g(newMap.set); iterate$k(iterator, function (key, value) { setter.call(newMap, boundFunction(value, key, map), value); }, { AS_ENTRIES: true, IS_ITERATOR: true }); return newMap; } }); var $$17 = _export; var IS_PURE$s = isPure; var getBuiltIn$9 = getBuiltIn$y; var aCallable$f = aCallable$Q; var anObject$w = anObject$1C; var bind$7 = functionBindContext; var speciesConstructor$6 = speciesConstructor$f; var getMapIterator$2 = getMapIterator$a; var iterate$j = iterate$I; // `Map.prototype.mapValues` method // https://github.com/tc39/proposal-collection-methods $$17({ target: 'Map', proto: true, real: true, forced: IS_PURE$s }, { mapValues: function mapValues(callbackfn /* , thisArg */) { var map = anObject$w(this); var iterator = getMapIterator$2(map); var boundFunction = bind$7(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); var newMap = new (speciesConstructor$6(map, getBuiltIn$9('Map')))(); var setter = aCallable$f(newMap.set); iterate$j(iterator, function (key, value) { setter.call(newMap, key, boundFunction(value, key, map)); }, { AS_ENTRIES: true, IS_ITERATOR: true }); return newMap; } }); var $$16 = _export; var IS_PURE$r = isPure; var aCallable$e = aCallable$Q; var anObject$v = anObject$1C; var iterate$i = iterate$I; // `Map.prototype.merge` method // https://github.com/tc39/proposal-collection-methods $$16({ target: 'Map', proto: true, real: true, forced: IS_PURE$r }, { // eslint-disable-next-line no-unused-vars -- required for `.length` merge: function merge(iterable /* ...iterbles */) { var map = anObject$v(this); var setter = aCallable$e(map.set); var argumentsLength = arguments.length; var i = 0; while (i < argumentsLength) { iterate$i(arguments[i++], setter, { that: map, AS_ENTRIES: true }); } return map; } }); // https://tc39.github.io/proposal-setmap-offrom/ var collectionOf = function of() { var length = arguments.length; var A = new Array(length); while (length--) A[length] = arguments[length]; return new this(A); }; var $$15 = _export; var of$3 = collectionOf; // `Map.of` method // https://tc39.github.io/proposal-setmap-offrom/#sec-map.of $$15({ target: 'Map', stat: true }, { of: of$3 }); var $$14 = _export; var IS_PURE$q = isPure; var anObject$u = anObject$1C; var aCallable$d = aCallable$Q; var getMapIterator$1 = getMapIterator$a; var iterate$h = iterate$I; // `Map.prototype.reduce` method // https://github.com/tc39/proposal-collection-methods $$14({ target: 'Map', proto: true, real: true, forced: IS_PURE$q }, { reduce: function reduce(callbackfn /* , initialValue */) { var map = anObject$u(this); var iterator = getMapIterator$1(map); var noInitial = arguments.length < 2; var accumulator = noInitial ? undefined : arguments[1]; aCallable$d(callbackfn); iterate$h(iterator, function (key, value) { if (noInitial) { noInitial = false; accumulator = value; } else { accumulator = callbackfn(accumulator, value, key, map); } }, { AS_ENTRIES: true, IS_ITERATOR: true }); if (noInitial) throw TypeError('Reduce of empty map with no initial value'); return accumulator; } }); var $$13 = _export; var IS_PURE$p = isPure; var anObject$t = anObject$1C; var bind$6 = functionBindContext; var getMapIterator = getMapIterator$a; var iterate$g = iterate$I; // `Set.prototype.some` method // https://github.com/tc39/proposal-collection-methods $$13({ target: 'Map', proto: true, real: true, forced: IS_PURE$p }, { some: function some(callbackfn /* , thisArg */) { var map = anObject$t(this); var iterator = getMapIterator(map); var boundFunction = bind$6(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); return iterate$g(iterator, function (key, value, stop) { if (boundFunction(value, key, map)) return stop(); }, { AS_ENTRIES: true, IS_ITERATOR: true, INTERRUPTED: true }).stopped; } }); var $$12 = _export; var IS_PURE$o = isPure; var anObject$s = anObject$1C; var aCallable$c = aCallable$Q; // `Set.prototype.update` method // https://github.com/tc39/proposal-collection-methods $$12({ target: 'Map', proto: true, real: true, forced: IS_PURE$o }, { update: function update(key, callback /* , thunk */) { var map = anObject$s(this); var length = arguments.length; aCallable$c(callback); var isPresentInMap = map.has(key); if (!isPresentInMap && length < 3) { throw TypeError('Updating absent value'); } var value = isPresentInMap ? map.get(key) : aCallable$c(length > 2 ? arguments[2] : undefined)(key, map); map.set(key, callback(value, key, map)); return map; } }); var isCallable$4 = isCallable$z; var anObject$r = anObject$1C; // `Map.prototype.upsert` method // https://github.com/thumbsupep/proposal-upsert var mapUpsert = function upsert(key, updateFn /* , insertFn */) { var map = anObject$r(this); var insertFn = arguments.length > 2 ? arguments[2] : undefined; var value; if (!isCallable$4(updateFn) && !isCallable$4(insertFn)) { throw TypeError('At least one callback required'); } if (map.has(key)) { value = map.get(key); if (isCallable$4(updateFn)) { value = updateFn(value); map.set(key, value); } } else if (isCallable$4(insertFn)) { value = insertFn(); map.set(key, value); } return value; }; // TODO: remove from `core-js@4` var $$11 = _export; var IS_PURE$n = isPure; var $upsert$2 = mapUpsert; // `Map.prototype.updateOrInsert` method (replaced by `Map.prototype.emplace`) // https://github.com/thumbsupep/proposal-upsert $$11({ target: 'Map', proto: true, real: true, name: 'upsert', forced: IS_PURE$n }, { updateOrInsert: $upsert$2 }); // TODO: remove from `core-js@4` var $$10 = _export; var IS_PURE$m = isPure; var $upsert$1 = mapUpsert; // `Map.prototype.upsert` method (replaced by `Map.prototype.emplace`) // https://github.com/thumbsupep/proposal-upsert $$10({ target: 'Map', proto: true, real: true, forced: IS_PURE$m }, { upsert: $upsert$1 }); var $$$ = _export; var min = Math.min; var max = Math.max; // `Math.clamp` method // https://rwaldron.github.io/proposal-math-extensions/ $$$({ target: 'Math', stat: true }, { clamp: function clamp(x, lower, upper) { return min(upper, max(lower, x)); } }); var $$_ = _export; // `Math.DEG_PER_RAD` constant // https://rwaldron.github.io/proposal-math-extensions/ $$_({ target: 'Math', stat: true }, { DEG_PER_RAD: Math.PI / 180 }); var $$Z = _export; var RAD_PER_DEG = 180 / Math.PI; // `Math.degrees` method // https://rwaldron.github.io/proposal-math-extensions/ $$Z({ target: 'Math', stat: 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) { if ( arguments.length === 0 /* eslint-disable no-self-compare -- NaN check */ || x != x || inLow != inLow || inHigh != inHigh || outLow != outLow || outHigh != outHigh /* eslint-enable no-self-compare -- NaN check */ ) return NaN; if (x === Infinity || x === -Infinity) return x; return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow; }; var $$Y = _export; var scale$1 = mathScale; var fround = mathFround; // `Math.fscale` method // https://rwaldron.github.io/proposal-math-extensions/ $$Y({ target: 'Math', stat: true }, { fscale: function fscale(x, inLow, inHigh, outLow, outHigh) { return fround(scale$1(x, inLow, inHigh, outLow, outHigh)); } }); var $$X = _export; // `Math.iaddh` method // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 // TODO: Remove from `core-js@4` $$X({ target: 'Math', stat: 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 $$W = _export; // `Math.imulh` method // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 // TODO: Remove from `core-js@4` $$W({ target: 'Math', stat: 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 $$V = _export; // `Math.isubh` method // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 // TODO: Remove from `core-js@4` $$V({ target: 'Math', stat: 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 $$U = _export; // `Math.RAD_PER_DEG` constant // https://rwaldron.github.io/proposal-math-extensions/ $$U({ target: 'Math', stat: true }, { RAD_PER_DEG: 180 / Math.PI }); var $$T = _export; var DEG_PER_RAD = Math.PI / 180; // `Math.radians` method // https://rwaldron.github.io/proposal-math-extensions/ $$T({ target: 'Math', stat: true }, { radians: function radians(degrees) { return degrees * DEG_PER_RAD; } }); var $$S = _export; var scale = mathScale; // `Math.scale` method // https://rwaldron.github.io/proposal-math-extensions/ $$S({ target: 'Math', stat: true }, { scale: scale }); var $$R = _export; var anObject$q = anObject$1C; var numberIsFinite = numberIsFinite$2; var createIteratorConstructor$3 = createIteratorConstructor$7; var InternalStateModule$5 = internalState; var SEEDED_RANDOM = 'Seeded Random'; var SEEDED_RANDOM_GENERATOR = SEEDED_RANDOM + ' Generator'; var setInternalState$5 = InternalStateModule$5.set; var getInternalState$3 = InternalStateModule$5.getterFor(SEEDED_RANDOM_GENERATOR); var SEED_TYPE_ERROR = 'Math.seededPRNG() argument should have a "seed" field with a finite value.'; var $SeededRandomGenerator = createIteratorConstructor$3(function SeededRandomGenerator(seed) { setInternalState$5(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 { value: (seed & 1073741823) / 1073741823, done: false }; }); // `Math.seededPRNG` method // https://github.com/tc39/proposal-seeded-random // based on https://github.com/tc39/proposal-seeded-random/blob/78b8258835b57fc2100d076151ab506bc3202ae6/demo.html $$R({ target: 'Math', stat: true, forced: true }, { seededPRNG: function seededPRNG(it) { var seed = anObject$q(it).seed; if (!numberIsFinite(seed)) throw TypeError(SEED_TYPE_ERROR); return new $SeededRandomGenerator(seed); } }); var $$Q = _export; // `Math.signbit` method // https://github.com/tc39/proposal-Math.signbit $$Q({ target: 'Math', stat: true }, { signbit: function signbit(x) { return (x = +x) == x && x == 0 ? 1 / x == -Infinity : x < 0; } }); var $$P = _export; // `Math.umulh` method // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 // TODO: Remove from `core-js@4` $$P({ target: 'Math', stat: 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 $$O = _export; var toIntegerOrInfinity = toIntegerOrInfinity$i; var parseInt$1 = numberParseInt; var INVALID_NUMBER_REPRESENTATION = 'Invalid number representation'; var INVALID_RADIX = 'Invalid radix'; var valid = /^[\da-z]+$/; // `Number.fromString` method // https://github.com/tc39/proposal-number-fromstring $$O({ target: 'Number', stat: true }, { fromString: function fromString(string, radix) { var sign = 1; var R, mathNum; if (typeof string != 'string') throw TypeError(INVALID_NUMBER_REPRESENTATION); if (!string.length) throw SyntaxError(INVALID_NUMBER_REPRESENTATION); if (string.charAt(0) == '-') { sign = -1; string = string.slice(1); if (!string.length) throw SyntaxError(INVALID_NUMBER_REPRESENTATION); } R = radix === undefined ? 10 : toIntegerOrInfinity(radix); if (R < 2 || R > 36) throw RangeError(INVALID_RADIX); if (!valid.test(string) || (mathNum = parseInt$1(string, R)).toString(R) !== string) { throw SyntaxError(INVALID_NUMBER_REPRESENTATION); } return sign * mathNum; } }); var $$N = _export; var NumericRangeIterator = numericRangeIterator; // `Number.range` method // https://github.com/tc39/proposal-Number.range $$N({ target: 'Number', stat: true }, { range: function range(start, end, option) { return new NumericRangeIterator(start, end, option, 'number', 0, 1); } }); var InternalStateModule$4 = internalState; var createIteratorConstructor$2 = createIteratorConstructor$7; var hasOwn$2 = hasOwnProperty_1; var objectKeys = objectKeys$5; var toObject = toObject$z; var OBJECT_ITERATOR = 'Object Iterator'; var setInternalState$4 = InternalStateModule$4.set; var getInternalState$2 = InternalStateModule$4.getterFor(OBJECT_ITERATOR); var objectIterator = createIteratorConstructor$2(function ObjectIterator(source, mode) { var object = toObject(source); setInternalState$4(this, { type: OBJECT_ITERATOR, mode: mode, object: object, keys: objectKeys(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 { value: undefined, done: true }; } var key = keys[state.index++]; var object = state.object; if (!hasOwn$2(object, key)) continue; switch (state.mode) { case 'keys': return { value: key, done: false }; case 'values': return { value: object[key], done: false }; } /* entries */ return { value: [key, object[key]], done: false }; } }); var $$M = _export; var ObjectIterator$2 = objectIterator; // `Object.iterateEntries` method // https://github.com/tc39/proposal-object-iteration $$M({ target: 'Object', stat: true }, { iterateEntries: function iterateEntries(object) { return new ObjectIterator$2(object, 'entries'); } }); var $$L = _export; var ObjectIterator$1 = objectIterator; // `Object.iterateKeys` method // https://github.com/tc39/proposal-object-iteration $$L({ target: 'Object', stat: true }, { iterateKeys: function iterateKeys(object) { return new ObjectIterator$1(object, 'keys'); } }); var $$K = _export; var ObjectIterator = objectIterator; // `Object.iterateValues` method // https://github.com/tc39/proposal-object-iteration $$K({ target: 'Object', stat: true }, { iterateValues: function iterateValues(object) { return new ObjectIterator(object, 'values'); } }); // https://github.com/tc39/proposal-observable var $$J = _export; var DESCRIPTORS$1 = descriptors; var setSpecies = setSpecies$7; var aCallable$b = aCallable$Q; var isCallable$3 = isCallable$z; var isConstructor = isConstructor$7; var anObject$p = anObject$1C; var isObject$1 = isObject$C; var anInstance$2 = anInstance$b; var defineProperty = objectDefineProperty.f; var redefine$2 = redefine$l.exports; var redefineAll$1 = redefineAll$a; var getIterator$2 = getIterator$b; var getMethod = getMethod$h; var iterate$f = iterate$I; var hostReportErrors = hostReportErrors$2; var wellKnownSymbol$3 = wellKnownSymbol$G; var InternalStateModule$3 = internalState; var OBSERVABLE = wellKnownSymbol$3('observable'); var getInternalState$1 = InternalStateModule$3.get; var setInternalState$3 = InternalStateModule$3.set; var cleanupSubscription = function (subscriptionState) { var cleanup = subscriptionState.cleanup; if (cleanup) { subscriptionState.cleanup = undefined; try { cleanup(); } catch (error) { hostReportErrors(error); } } }; var subscriptionClosed = function (subscriptionState) { return subscriptionState.observer === undefined; }; var close = function (subscriptionState) { var subscription = subscriptionState.facade; if (!DESCRIPTORS$1) { subscription.closed = true; var subscriptionObserver = subscriptionState.subscriptionObserver; if (subscriptionObserver) subscriptionObserver.closed = true; } subscriptionState.observer = undefined; }; var Subscription = function (observer, subscriber) { var subscriptionState = setInternalState$3(this, { cleanup: undefined, observer: anObject$p(observer), subscriptionObserver: undefined }); var start; if (!DESCRIPTORS$1) this.closed = false; try { if (start = getMethod(observer, 'start')) start.call(observer, this); } catch (error) { hostReportErrors(error); } if (subscriptionClosed(subscriptionState)) return; var subscriptionObserver = subscriptionState.subscriptionObserver = new SubscriptionObserver(this); try { var cleanup = subscriber(subscriptionObserver); var subscription = cleanup; if (cleanup != null) subscriptionState.cleanup = isCallable$3(cleanup.unsubscribe) ? function () { subscription.unsubscribe(); } : aCallable$b(cleanup); } catch (error) { subscriptionObserver.error(error); return; } if (subscriptionClosed(subscriptionState)) cleanupSubscription(subscriptionState); }; Subscription.prototype = redefineAll$1({}, { unsubscribe: function unsubscribe() { var subscriptionState = getInternalState$1(this); if (!subscriptionClosed(subscriptionState)) { close(subscriptionState); cleanupSubscription(subscriptionState); } } }); if (DESCRIPTORS$1) defineProperty(Subscription.prototype, 'closed', { configurable: true, get: function () { return subscriptionClosed(getInternalState$1(this)); } }); var SubscriptionObserver = function (subscription) { setInternalState$3(this, { subscription: subscription }); if (!DESCRIPTORS$1) this.closed = false; }; SubscriptionObserver.prototype = redefineAll$1({}, { next: function next(value) { var subscriptionState = getInternalState$1(getInternalState$1(this).subscription); if (!subscriptionClosed(subscriptionState)) { var observer = subscriptionState.observer; try { var nextMethod = getMethod(observer, 'next'); if (nextMethod) nextMethod.call(observer, value); } catch (error) { hostReportErrors(error); } } }, error: function error(value) { var subscriptionState = getInternalState$1(getInternalState$1(this).subscription); if (!subscriptionClosed(subscriptionState)) { var observer = subscriptionState.observer; close(subscriptionState); try { var errorMethod = getMethod(observer, 'error'); if (errorMethod) errorMethod.call(observer, value); else hostReportErrors(value); } catch (err) { hostReportErrors(err); } cleanupSubscription(subscriptionState); } }, complete: function complete() { var subscriptionState = getInternalState$1(getInternalState$1(this).subscription); if (!subscriptionClosed(subscriptionState)) { var observer = subscriptionState.observer; close(subscriptionState); try { var completeMethod = getMethod(observer, 'complete'); if (completeMethod) completeMethod.call(observer); } catch (error) { hostReportErrors(error); } cleanupSubscription(subscriptionState); } } }); if (DESCRIPTORS$1) defineProperty(SubscriptionObserver.prototype, 'closed', { configurable: true, get: function () { return subscriptionClosed(getInternalState$1(getInternalState$1(this).subscription)); } }); var $Observable = function Observable(subscriber) { anInstance$2(this, $Observable, 'Observable'); setInternalState$3(this, { subscriber: aCallable$b(subscriber) }); }; redefineAll$1($Observable.prototype, { subscribe: function subscribe(observer) { var length = arguments.length; return new Subscription(isCallable$3(observer) ? { next: observer, error: length > 1 ? arguments[1] : undefined, complete: length > 2 ? arguments[2] : undefined } : isObject$1(observer) ? observer : {}, getInternalState$1(this).subscriber); } }); redefineAll$1($Observable, { from: function from(x) { var C = isConstructor(this) ? this : $Observable; var observableMethod = getMethod(anObject$p(x), OBSERVABLE); if (observableMethod) { var observable = anObject$p(observableMethod.call(x)); return observable.constructor === C ? observable : new C(function (observer) { return observable.subscribe(observer); }); } var iterator = getIterator$2(x); return new C(function (observer) { iterate$f(iterator, function (it, stop) { observer.next(it); if (observer.closed) return stop(); }, { IS_ITERATOR: true, INTERRUPTED: true }); observer.complete(); }); }, of: function of() { var C = isConstructor(this) ? this : $Observable; var length = arguments.length; var items = new Array(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(); }); } }); redefine$2($Observable.prototype, OBSERVABLE, function () { return this; }); $$J({ global: true }, { Observable: $Observable }); setSpecies('Observable'); var $$I = _export; var newPromiseCapabilityModule = newPromiseCapability$2; var perform = perform$4; // `Promise.try` method // https://github.com/tc39/proposal-promise-try $$I({ target: 'Promise', stat: true }, { 'try': function (callbackfn) { var promiseCapability = newPromiseCapabilityModule.f(this); var result = perform(callbackfn); (result.error ? promiseCapability.reject : promiseCapability.resolve)(result.value); return promiseCapability.promise; } }); // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` var Map$1 = es_map; var WeakMap = es_weakMap.exports; var shared = shared$7.exports; var metadata = shared('metadata'); var store$1 = metadata.store || (metadata.store = new WeakMap()); 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$1()); } var keyMetadata = targetMetadata.get(targetKey); if (!keyMetadata) { if (!create) return; targetMetadata.set(targetKey, keyMetadata = new Map$1()); } 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) { keys.push(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 }; var $$H = _export; var ReflectMetadataModule$8 = reflectMetadata; var anObject$o = anObject$1C; var toMetadataKey$8 = ReflectMetadataModule$8.toKey; var ordinaryDefineOwnMetadata$1 = ReflectMetadataModule$8.set; // `Reflect.defineMetadata` method // https://github.com/rbuckton/reflect-metadata $$H({ 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$o(target), targetKey); } }); var $$G = _export; var ReflectMetadataModule$7 = reflectMetadata; var anObject$n = anObject$1C; 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 $$G({ target: 'Reflect', stat: true }, { deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) { var targetKey = arguments.length < 3 ? undefined : toMetadataKey$7(arguments[2]); var metadataMap = getOrCreateMetadataMap(anObject$n(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); } }); var $$F = _export; var ReflectMetadataModule$6 = reflectMetadata; var anObject$m = anObject$1C; var getPrototypeOf$2 = objectGetPrototypeOf$1; 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 $$F({ target: 'Reflect', stat: true }, { getMetadata: function getMetadata(metadataKey, target /* , targetKey */) { var targetKey = arguments.length < 3 ? undefined : toMetadataKey$6(arguments[2]); return ordinaryGetMetadata(metadataKey, anObject$m(target), targetKey); } }); var $$E = _export; // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` var Set$1 = es_set; var ReflectMetadataModule$5 = reflectMetadata; var anObject$l = anObject$1C; var getPrototypeOf$1 = objectGetPrototypeOf$1; var iterate$e = iterate$I; var ordinaryOwnMetadataKeys$1 = ReflectMetadataModule$5.keys; var toMetadataKey$5 = ReflectMetadataModule$5.toKey; var from$3 = function (iter) { var result = []; iterate$e(iter, result.push, { that: result }); return result; }; 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 ? from$3(new Set$1(oKeys.concat(pKeys))) : pKeys : oKeys; }; // `Reflect.getMetadataKeys` method // https://github.com/rbuckton/reflect-metadata $$E({ target: 'Reflect', stat: true }, { getMetadataKeys: function getMetadataKeys(target /* , targetKey */) { var targetKey = arguments.length < 2 ? undefined : toMetadataKey$5(arguments[1]); return ordinaryMetadataKeys(anObject$l(target), targetKey); } }); var $$D = _export; var ReflectMetadataModule$4 = reflectMetadata; var anObject$k = anObject$1C; var ordinaryGetOwnMetadata = ReflectMetadataModule$4.get; var toMetadataKey$4 = ReflectMetadataModule$4.toKey; // `Reflect.getOwnMetadata` method // https://github.com/rbuckton/reflect-metadata $$D({ target: 'Reflect', stat: true }, { getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) { var targetKey = arguments.length < 3 ? undefined : toMetadataKey$4(arguments[2]); return ordinaryGetOwnMetadata(metadataKey, anObject$k(target), targetKey); } }); var $$C = _export; var ReflectMetadataModule$3 = reflectMetadata; var anObject$j = anObject$1C; var ordinaryOwnMetadataKeys = ReflectMetadataModule$3.keys; var toMetadataKey$3 = ReflectMetadataModule$3.toKey; // `Reflect.getOwnMetadataKeys` method // https://github.com/rbuckton/reflect-metadata $$C({ target: 'Reflect', stat: true }, { getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) { var targetKey = arguments.length < 2 ? undefined : toMetadataKey$3(arguments[1]); return ordinaryOwnMetadataKeys(anObject$j(target), targetKey); } }); var $$B = _export; var ReflectMetadataModule$2 = reflectMetadata; var anObject$i = anObject$1C; var getPrototypeOf = objectGetPrototypeOf$1; 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 $$B({ target: 'Reflect', stat: true }, { hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) { var targetKey = arguments.length < 3 ? undefined : toMetadataKey$2(arguments[2]); return ordinaryHasMetadata(metadataKey, anObject$i(target), targetKey); } }); var $$A = _export; var ReflectMetadataModule$1 = reflectMetadata; var anObject$h = anObject$1C; var ordinaryHasOwnMetadata = ReflectMetadataModule$1.has; var toMetadataKey$1 = ReflectMetadataModule$1.toKey; // `Reflect.hasOwnMetadata` method // https://github.com/rbuckton/reflect-metadata $$A({ target: 'Reflect', stat: true }, { hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) { var targetKey = arguments.length < 3 ? undefined : toMetadataKey$1(arguments[2]); return ordinaryHasOwnMetadata(metadataKey, anObject$h(target), targetKey); } }); var $$z = _export; var ReflectMetadataModule = reflectMetadata; var anObject$g = anObject$1C; var toMetadataKey = ReflectMetadataModule.toKey; var ordinaryDefineOwnMetadata = ReflectMetadataModule.set; // `Reflect.metadata` method // https://github.com/rbuckton/reflect-metadata $$z({ target: 'Reflect', stat: true }, { metadata: function metadata(metadataKey, metadataValue) { return function decorator(target, key) { ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject$g(target), toMetadataKey(key)); }; } }); var aCallable$a = aCallable$Q; var anObject$f = anObject$1C; // https://github.com/tc39/collection-methods var collectionAddAll$2 = function (/* ...elements */) { var set = anObject$f(this); var adder = aCallable$a(set.add); for (var k = 0, len = arguments.length; k < len; k++) { adder.call(set, arguments[k]); } return set; }; var $$y = _export; var IS_PURE$l = isPure; var collectionAddAll$1 = collectionAddAll$2; // `Set.prototype.addAll` method // https://github.com/tc39/proposal-collection-methods $$y({ target: 'Set', proto: true, real: true, forced: IS_PURE$l }, { addAll: function addAll(/* ...elements */) { return collectionAddAll$1.apply(this, arguments); } }); var $$x = _export; var IS_PURE$k = isPure; var collectionDeleteAll$2 = collectionDeleteAll$4; // `Set.prototype.deleteAll` method // https://github.com/tc39/proposal-collection-methods $$x({ target: 'Set', proto: true, real: true, forced: IS_PURE$k }, { deleteAll: function deleteAll(/* ...elements */) { return collectionDeleteAll$2.apply(this, arguments); } }); var $$w = _export; var IS_PURE$j = isPure; var getBuiltIn$8 = getBuiltIn$y; var aCallable$9 = aCallable$Q; var anObject$e = anObject$1C; var speciesConstructor$5 = speciesConstructor$f; var iterate$d = iterate$I; // `Set.prototype.difference` method // https://github.com/tc39/proposal-set-methods $$w({ target: 'Set', proto: true, real: true, forced: IS_PURE$j }, { difference: function difference(iterable) { var set = anObject$e(this); var newSet = new (speciesConstructor$5(set, getBuiltIn$8('Set')))(set); var remover = aCallable$9(newSet['delete']); iterate$d(iterable, function (value) { remover.call(newSet, value); }); return newSet; } }); var getSetIterator$7 = function (it) { // eslint-disable-next-line es/no-set -- safe return Set.prototype.values.call(it); }; var $$v = _export; var IS_PURE$i = isPure; var anObject$d = anObject$1C; var bind$5 = functionBindContext; var getSetIterator$6 = getSetIterator$7; var iterate$c = iterate$I; // `Set.prototype.every` method // https://github.com/tc39/proposal-collection-methods $$v({ target: 'Set', proto: true, real: true, forced: IS_PURE$i }, { every: function every(callbackfn /* , thisArg */) { var set = anObject$d(this); var iterator = getSetIterator$6(set); var boundFunction = bind$5(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); return !iterate$c(iterator, function (value, stop) { if (!boundFunction(value, value, set)) return stop(); }, { IS_ITERATOR: true, INTERRUPTED: true }).stopped; } }); var $$u = _export; var IS_PURE$h = isPure; var getBuiltIn$7 = getBuiltIn$y; var aCallable$8 = aCallable$Q; var anObject$c = anObject$1C; var bind$4 = functionBindContext; var speciesConstructor$4 = speciesConstructor$f; var getSetIterator$5 = getSetIterator$7; var iterate$b = iterate$I; // `Set.prototype.filter` method // https://github.com/tc39/proposal-collection-methods $$u({ target: 'Set', proto: true, real: true, forced: IS_PURE$h }, { filter: function filter(callbackfn /* , thisArg */) { var set = anObject$c(this); var iterator = getSetIterator$5(set); var boundFunction = bind$4(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); var newSet = new (speciesConstructor$4(set, getBuiltIn$7('Set')))(); var adder = aCallable$8(newSet.add); iterate$b(iterator, function (value) { if (boundFunction(value, value, set)) adder.call(newSet, value); }, { IS_ITERATOR: true }); return newSet; } }); var $$t = _export; var IS_PURE$g = isPure; var anObject$b = anObject$1C; var bind$3 = functionBindContext; var getSetIterator$4 = getSetIterator$7; var iterate$a = iterate$I; // `Set.prototype.find` method // https://github.com/tc39/proposal-collection-methods $$t({ target: 'Set', proto: true, real: true, forced: IS_PURE$g }, { find: function find(callbackfn /* , thisArg */) { var set = anObject$b(this); var iterator = getSetIterator$4(set); var boundFunction = bind$3(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); return iterate$a(iterator, function (value, stop) { if (boundFunction(value, value, set)) return stop(value); }, { IS_ITERATOR: true, INTERRUPTED: true }).result; } }); var $$s = _export; var from$2 = collectionFrom; // `Set.from` method // https://tc39.github.io/proposal-setmap-offrom/#sec-set.from $$s({ target: 'Set', stat: true }, { from: from$2 }); var $$r = _export; var IS_PURE$f = isPure; var getBuiltIn$6 = getBuiltIn$y; var aCallable$7 = aCallable$Q; var anObject$a = anObject$1C; var speciesConstructor$3 = speciesConstructor$f; var iterate$9 = iterate$I; // `Set.prototype.intersection` method // https://github.com/tc39/proposal-set-methods $$r({ target: 'Set', proto: true, real: true, forced: IS_PURE$f }, { intersection: function intersection(iterable) { var set = anObject$a(this); var newSet = new (speciesConstructor$3(set, getBuiltIn$6('Set')))(); var hasCheck = aCallable$7(set.has); var adder = aCallable$7(newSet.add); iterate$9(iterable, function (value) { if (hasCheck.call(set, value)) adder.call(newSet, value); }); return newSet; } }); var $$q = _export; var IS_PURE$e = isPure; var aCallable$6 = aCallable$Q; var anObject$9 = anObject$1C; var iterate$8 = iterate$I; // `Set.prototype.isDisjointFrom` method // https://tc39.github.io/proposal-set-methods/#Set.prototype.isDisjointFrom $$q({ target: 'Set', proto: true, real: true, forced: IS_PURE$e }, { isDisjointFrom: function isDisjointFrom(iterable) { var set = anObject$9(this); var hasCheck = aCallable$6(set.has); return !iterate$8(iterable, function (value, stop) { if (hasCheck.call(set, value) === true) return stop(); }, { INTERRUPTED: true }).stopped; } }); var $$p = _export; var IS_PURE$d = isPure; var getBuiltIn$5 = getBuiltIn$y; var aCallable$5 = aCallable$Q; var isCallable$2 = isCallable$z; var anObject$8 = anObject$1C; var getIterator$1 = getIterator$b; var iterate$7 = iterate$I; // `Set.prototype.isSubsetOf` method // https://tc39.github.io/proposal-set-methods/#Set.prototype.isSubsetOf $$p({ target: 'Set', proto: true, real: true, forced: IS_PURE$d }, { isSubsetOf: function isSubsetOf(iterable) { var iterator = getIterator$1(this); var otherSet = anObject$8(iterable); var hasCheck = otherSet.has; if (!isCallable$2(hasCheck)) { otherSet = new (getBuiltIn$5('Set'))(iterable); hasCheck = aCallable$5(otherSet.has); } return !iterate$7(iterator, function (value, stop) { if (hasCheck.call(otherSet, value) === false) return stop(); }, { IS_ITERATOR: true, INTERRUPTED: true }).stopped; } }); var $$o = _export; var IS_PURE$c = isPure; var aCallable$4 = aCallable$Q; var anObject$7 = anObject$1C; var iterate$6 = iterate$I; // `Set.prototype.isSupersetOf` method // https://tc39.github.io/proposal-set-methods/#Set.prototype.isSupersetOf $$o({ target: 'Set', proto: true, real: true, forced: IS_PURE$c }, { isSupersetOf: function isSupersetOf(iterable) { var set = anObject$7(this); var hasCheck = aCallable$4(set.has); return !iterate$6(iterable, function (value, stop) { if (hasCheck.call(set, value) === false) return stop(); }, { INTERRUPTED: true }).stopped; } }); var $$n = _export; var IS_PURE$b = isPure; var anObject$6 = anObject$1C; var getSetIterator$3 = getSetIterator$7; var iterate$5 = iterate$I; // `Set.prototype.join` method // https://github.com/tc39/proposal-collection-methods $$n({ target: 'Set', proto: true, real: true, forced: IS_PURE$b }, { join: function join(separator) { var set = anObject$6(this); var iterator = getSetIterator$3(set); var sep = separator === undefined ? ',' : String(separator); var result = []; iterate$5(iterator, result.push, { that: result, IS_ITERATOR: true }); return result.join(sep); } }); var $$m = _export; var IS_PURE$a = isPure; var getBuiltIn$4 = getBuiltIn$y; var aCallable$3 = aCallable$Q; var anObject$5 = anObject$1C; var bind$2 = functionBindContext; var speciesConstructor$2 = speciesConstructor$f; var getSetIterator$2 = getSetIterator$7; var iterate$4 = iterate$I; // `Set.prototype.map` method // https://github.com/tc39/proposal-collection-methods $$m({ target: 'Set', proto: true, real: true, forced: IS_PURE$a }, { map: function map(callbackfn /* , thisArg */) { var set = anObject$5(this); var iterator = getSetIterator$2(set); var boundFunction = bind$2(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); var newSet = new (speciesConstructor$2(set, getBuiltIn$4('Set')))(); var adder = aCallable$3(newSet.add); iterate$4(iterator, function (value) { adder.call(newSet, boundFunction(value, value, set)); }, { IS_ITERATOR: true }); return newSet; } }); var $$l = _export; var of$2 = collectionOf; // `Set.of` method // https://tc39.github.io/proposal-setmap-offrom/#sec-set.of $$l({ target: 'Set', stat: true }, { of: of$2 }); var $$k = _export; var IS_PURE$9 = isPure; var aCallable$2 = aCallable$Q; var anObject$4 = anObject$1C; var getSetIterator$1 = getSetIterator$7; var iterate$3 = iterate$I; // `Set.prototype.reduce` method // https://github.com/tc39/proposal-collection-methods $$k({ target: 'Set', proto: true, real: true, forced: IS_PURE$9 }, { reduce: function reduce(callbackfn /* , initialValue */) { var set = anObject$4(this); var iterator = getSetIterator$1(set); var noInitial = arguments.length < 2; var accumulator = noInitial ? undefined : arguments[1]; aCallable$2(callbackfn); iterate$3(iterator, function (value) { if (noInitial) { noInitial = false; accumulator = value; } else { accumulator = callbackfn(accumulator, value, value, set); } }, { IS_ITERATOR: true }); if (noInitial) throw TypeError('Reduce of empty set with no initial value'); return accumulator; } }); var $$j = _export; var IS_PURE$8 = isPure; var anObject$3 = anObject$1C; var bind$1 = functionBindContext; var getSetIterator = getSetIterator$7; var iterate$2 = iterate$I; // `Set.prototype.some` method // https://github.com/tc39/proposal-collection-methods $$j({ target: 'Set', proto: true, real: true, forced: IS_PURE$8 }, { some: function some(callbackfn /* , thisArg */) { var set = anObject$3(this); var iterator = getSetIterator(set); var boundFunction = bind$1(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); return iterate$2(iterator, function (value, stop) { if (boundFunction(value, value, set)) return stop(); }, { IS_ITERATOR: true, INTERRUPTED: true }).stopped; } }); var $$i = _export; var IS_PURE$7 = isPure; var getBuiltIn$3 = getBuiltIn$y; var aCallable$1 = aCallable$Q; var anObject$2 = anObject$1C; var speciesConstructor$1 = speciesConstructor$f; var iterate$1 = iterate$I; // `Set.prototype.symmetricDifference` method // https://github.com/tc39/proposal-set-methods $$i({ target: 'Set', proto: true, real: true, forced: IS_PURE$7 }, { symmetricDifference: function symmetricDifference(iterable) { var set = anObject$2(this); var newSet = new (speciesConstructor$1(set, getBuiltIn$3('Set')))(set); var remover = aCallable$1(newSet['delete']); var adder = aCallable$1(newSet.add); iterate$1(iterable, function (value) { remover.call(newSet, value) || adder.call(newSet, value); }); return newSet; } }); var $$h = _export; var IS_PURE$6 = isPure; var getBuiltIn$2 = getBuiltIn$y; var aCallable = aCallable$Q; var anObject$1 = anObject$1C; var speciesConstructor = speciesConstructor$f; var iterate = iterate$I; // `Set.prototype.union` method // https://github.com/tc39/proposal-set-methods $$h({ target: 'Set', proto: true, real: true, forced: IS_PURE$6 }, { union: function union(iterable) { var set = anObject$1(this); var newSet = new (speciesConstructor(set, getBuiltIn$2('Set')))(set); iterate(iterable, aCallable(newSet.add), { that: newSet }); return newSet; } }); var $$g = _export; var charAt$1 = stringMultibyte.charAt; var fails$1 = fails$15; var FORCED$1 = fails$1(function () { return '𠮷'.at(0) !== '𠮷'; }); // `String.prototype.at` method // https://github.com/mathiasbynens/String.prototype.at $$g({ target: 'String', proto: true, forced: FORCED$1 }, { at: function at(pos) { return charAt$1(this, pos); } }); var $$f = _export; var createIteratorConstructor$1 = createIteratorConstructor$7; var requireObjectCoercible = requireObjectCoercible$j; var toString = toString$t; var InternalStateModule$2 = internalState; var StringMultibyteModule = stringMultibyte; var codeAt$1 = StringMultibyteModule.codeAt; var charAt = StringMultibyteModule.charAt; var STRING_ITERATOR = 'String Iterator'; var setInternalState$2 = InternalStateModule$2.set; var getInternalState = InternalStateModule$2.getterFor(STRING_ITERATOR); // TODO: unify with String#@@iterator var $StringIterator = createIteratorConstructor$1(function StringIterator(string) { setInternalState$2(this, { type: STRING_ITERATOR, string: string, index: 0 }); }, 'String', function next() { var state = getInternalState(this); var string = state.string; var index = state.index; var point; if (index >= string.length) return { value: undefined, done: true }; point = charAt(string, index); state.index += point.length; return { value: { codePoint: codeAt$1(point, 0), position: index }, done: false }; }); // `String.prototype.codePoints` method // https://github.com/tc39/proposal-string-prototype-codepoints $$f({ target: 'String', proto: true }, { codePoints: function codePoints() { return new $StringIterator(toString(requireObjectCoercible(this))); } }); var defineWellKnownSymbol$6 = defineWellKnownSymbol$l; // `Symbol.asyncDispose` well-known symbol // https://github.com/tc39/proposal-using-statement defineWellKnownSymbol$6('asyncDispose'); var defineWellKnownSymbol$5 = defineWellKnownSymbol$l; // `Symbol.dispose` well-known symbol // https://github.com/tc39/proposal-using-statement defineWellKnownSymbol$5('dispose'); var defineWellKnownSymbol$4 = defineWellKnownSymbol$l; // `Symbol.matcher` well-known symbol // https://github.com/tc39/proposal-pattern-matching defineWellKnownSymbol$4('matcher'); var defineWellKnownSymbol$3 = defineWellKnownSymbol$l; // `Symbol.metadata` well-known symbol // https://github.com/tc39/proposal-decorators defineWellKnownSymbol$3('metadata'); var defineWellKnownSymbol$2 = defineWellKnownSymbol$l; // `Symbol.observable` well-known symbol // https://github.com/tc39/proposal-observable defineWellKnownSymbol$2('observable'); // TODO: remove from `core-js@4` var defineWellKnownSymbol$1 = defineWellKnownSymbol$l; // `Symbol.patternMatch` well-known symbol // https://github.com/tc39/proposal-pattern-matching defineWellKnownSymbol$1('patternMatch'); // TODO: remove from `core-js@4` var defineWellKnownSymbol = defineWellKnownSymbol$l; defineWellKnownSymbol('replaceAll'); var getBuiltIn$1 = getBuiltIn$y; var aConstructor = aConstructor$5; var arrayFromAsync = arrayFromAsync$1; var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = typedArrayConstructorsRequireWrappers; var ArrayBufferViewCore$6 = arrayBufferViewCore; var arrayFromConstructorAndList = arrayFromConstructorAndList$3; var aTypedArrayConstructor = ArrayBufferViewCore$6.aTypedArrayConstructor; var exportTypedArrayStaticMethod = ArrayBufferViewCore$6.exportTypedArrayStaticMethod; // `%TypedArray%.fromAsync` method // https://github.com/tc39/proposal-array-from-async // eslint-disable-next-line -- required for .length 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$1('Promise'))(function (resolve) { aConstructor(C); resolve(arrayFromAsync(asyncItems, mapfn, thisArg)); }).then(function (list) { return arrayFromConstructorAndList(aTypedArrayConstructor(C), list); }); }, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS); // TODO: Remove from `core-js@4` var ArrayBufferViewCore$5 = arrayBufferViewCore; var $filterReject$1 = arrayIteration.filterReject; var fromSpeciesAndList$2 = typedArrayFromSpeciesAndList; var aTypedArray$5 = ArrayBufferViewCore$5.aTypedArray; var exportTypedArrayMethod$5 = ArrayBufferViewCore$5.exportTypedArrayMethod; // `%TypedArray%.prototype.filterOut` method // https://github.com/tc39/proposal-array-filtering exportTypedArrayMethod$5('filterOut', function filterOut(callbackfn /* , thisArg */) { var list = $filterReject$1(aTypedArray$5(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); return fromSpeciesAndList$2(this, list); }); var ArrayBufferViewCore$4 = arrayBufferViewCore; var $filterReject = arrayIteration.filterReject; var fromSpeciesAndList$1 = typedArrayFromSpeciesAndList; var aTypedArray$4 = ArrayBufferViewCore$4.aTypedArray; var exportTypedArrayMethod$4 = ArrayBufferViewCore$4.exportTypedArrayMethod; // `%TypedArray%.prototype.filterReject` method // https://github.com/tc39/proposal-array-filtering exportTypedArrayMethod$4('filterReject', function filterReject(callbackfn /* , thisArg */) { var list = $filterReject(aTypedArray$4(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); return fromSpeciesAndList$1(this, list); }); var ArrayBufferViewCore$3 = arrayBufferViewCore; var $findLast = arrayIterationFromLast.findLast; var aTypedArray$3 = ArrayBufferViewCore$3.aTypedArray; var exportTypedArrayMethod$3 = ArrayBufferViewCore$3.exportTypedArrayMethod; // `%TypedArray%.prototype.findLast` method // https://github.com/tc39/proposal-array-find-from-last exportTypedArrayMethod$3('findLast', function findLast(predicate /* , thisArg */) { return $findLast(aTypedArray$3(this), predicate, arguments.length > 1 ? arguments[1] : undefined); }); var ArrayBufferViewCore$2 = arrayBufferViewCore; var $findLastIndex = arrayIterationFromLast.findLastIndex; var aTypedArray$2 = ArrayBufferViewCore$2.aTypedArray; var exportTypedArrayMethod$2 = ArrayBufferViewCore$2.exportTypedArrayMethod; // `%TypedArray%.prototype.findLastIndex` method // https://github.com/tc39/proposal-array-find-from-last exportTypedArrayMethod$2('findLastIndex', function findLastIndex(predicate /* , thisArg */) { return $findLastIndex(aTypedArray$2(this), predicate, arguments.length > 1 ? arguments[1] : undefined); }); var ArrayBufferViewCore$1 = arrayBufferViewCore; var $groupBy = arrayGroupBy; var typedArraySpeciesConstructor = typedArraySpeciesConstructor$5; var aTypedArray$1 = ArrayBufferViewCore$1.aTypedArray; var exportTypedArrayMethod$1 = ArrayBufferViewCore$1.exportTypedArrayMethod; // `%TypedArray%.prototype.groupBy` method // https://github.com/tc39/proposal-array-grouping exportTypedArrayMethod$1('groupBy', function groupBy(callbackfn /* , thisArg */) { var thisArg = arguments.length > 1 ? arguments[1] : undefined; return $groupBy(aTypedArray$1(this), callbackfn, thisArg, typedArraySpeciesConstructor); }); var ArrayBufferViewCore = arrayBufferViewCore; var arrayUniqueBy = arrayUniqueBy$1; var fromSpeciesAndList = typedArrayFromSpeciesAndList; var aTypedArray = ArrayBufferViewCore.aTypedArray; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; // `%TypedArray%.prototype.uniqueBy` method // https://github.com/tc39/proposal-array-unique exportTypedArrayMethod('uniqueBy', function uniqueBy(resolver) { return fromSpeciesAndList(this, arrayUniqueBy.call(aTypedArray(this), resolver)); }); var $$e = _export; var IS_PURE$5 = isPure; var collectionDeleteAll$1 = collectionDeleteAll$4; // `WeakMap.prototype.deleteAll` method // https://github.com/tc39/proposal-collection-methods $$e({ target: 'WeakMap', proto: true, real: true, forced: IS_PURE$5 }, { deleteAll: function deleteAll(/* ...elements */) { return collectionDeleteAll$1.apply(this, arguments); } }); var $$d = _export; var from$1 = collectionFrom; // `WeakMap.from` method // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from $$d({ target: 'WeakMap', stat: true }, { from: from$1 }); var $$c = _export; var of$1 = collectionOf; // `WeakMap.of` method // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of $$c({ target: 'WeakMap', stat: true }, { of: of$1 }); var $$b = _export; var IS_PURE$4 = isPure; var $emplace = mapEmplace; // `WeakMap.prototype.emplace` method // https://github.com/tc39/proposal-upsert $$b({ target: 'WeakMap', proto: true, real: true, forced: IS_PURE$4 }, { emplace: $emplace }); // TODO: remove from `core-js@4` var $$a = _export; var IS_PURE$3 = isPure; var $upsert = mapUpsert; // `WeakMap.prototype.upsert` method (replaced by `WeakMap.prototype.emplace`) // https://github.com/tc39/proposal-upsert $$a({ target: 'WeakMap', proto: true, real: true, forced: IS_PURE$3 }, { upsert: $upsert }); var $$9 = _export; var IS_PURE$2 = isPure; var collectionAddAll = collectionAddAll$2; // `WeakSet.prototype.addAll` method // https://github.com/tc39/proposal-collection-methods $$9({ target: 'WeakSet', proto: true, real: true, forced: IS_PURE$2 }, { addAll: function addAll(/* ...elements */) { return collectionAddAll.apply(this, arguments); } }); var $$8 = _export; var IS_PURE$1 = isPure; var collectionDeleteAll = collectionDeleteAll$4; // `WeakSet.prototype.deleteAll` method // https://github.com/tc39/proposal-collection-methods $$8({ target: 'WeakSet', proto: true, real: true, forced: IS_PURE$1 }, { deleteAll: function deleteAll(/* ...elements */) { return collectionDeleteAll.apply(this, arguments); } }); var $$7 = _export; var from = collectionFrom; // `WeakSet.from` method // https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from $$7({ target: 'WeakSet', stat: true }, { from: from }); var $$6 = _export; var of = collectionOf; // `WeakSet.of` method // https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of $$6({ target: 'WeakSet', stat: true }, { of: of }); // 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$6 = global$R; var DOMIterables$1 = domIterables; var DOMTokenListPrototype$1 = domTokenListPrototype; var forEach = arrayForEach; var createNonEnumerableProperty$1 = createNonEnumerableProperty$h; var handlePrototype$1 = function (CollectionPrototype) { // some Chrome versions have non-configurable methods on DOMTokenList if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try { createNonEnumerableProperty$1(CollectionPrototype, 'forEach', forEach); } catch (error) { CollectionPrototype.forEach = forEach; } }; for (var COLLECTION_NAME$1 in DOMIterables$1) { if (DOMIterables$1[COLLECTION_NAME$1]) { handlePrototype$1(global$6[COLLECTION_NAME$1] && global$6[COLLECTION_NAME$1].prototype); } } handlePrototype$1(DOMTokenListPrototype$1); var global$5 = global$R; var DOMIterables = domIterables; var DOMTokenListPrototype = domTokenListPrototype; var ArrayIteratorMethods = es_array_iterator; var createNonEnumerableProperty = createNonEnumerableProperty$h; var wellKnownSymbol$2 = wellKnownSymbol$G; 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(CollectionPrototype, ITERATOR$2, ArrayValues); } catch (error) { CollectionPrototype[ITERATOR$2] = ArrayValues; } if (!CollectionPrototype[TO_STRING_TAG]) { createNonEnumerableProperty(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(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]); } catch (error) { CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME]; } } } }; for (var COLLECTION_NAME in DOMIterables) { handlePrototype(global$5[COLLECTION_NAME] && global$5[COLLECTION_NAME].prototype, COLLECTION_NAME); } handlePrototype(DOMTokenListPrototype, 'DOMTokenList'); var $$5 = _export; var global$4 = global$R; var task = task$2; var FORCED = !global$4.setImmediate || !global$4.clearImmediate; // http://w3c.github.io/setImmediate/ $$5({ global: true, bind: true, enumerable: true, forced: FORCED }, { // `setImmediate` method // http://w3c.github.io/setImmediate/#si-setImmediate setImmediate: task.set, // `clearImmediate` method // http://w3c.github.io/setImmediate/#si-clearImmediate clearImmediate: task.clear }); var $$4 = _export; var global$3 = global$R; var microtask = microtask$2; var IS_NODE = engineIsNode; var process = global$3.process; // `queueMicrotask` method // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-queuemicrotask $$4({ global: true, enumerable: true, noTargetGet: true }, { queueMicrotask: function queueMicrotask(fn) { var domain = IS_NODE && process.domain; microtask(domain ? domain.bind(fn) : fn); } }); var $$3 = _export; var global$2 = global$R; var isCallable$1 = isCallable$z; var userAgent = engineUserAgent; var slice = [].slice; var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check var wrap = function (scheduler) { return function (handler, timeout /* , ...arguments */) { var boundArgs = arguments.length > 2; var args = boundArgs ? slice.call(arguments, 2) : undefined; return scheduler(boundArgs ? function () { // eslint-disable-next-line no-new-func -- spec requirement (isCallable$1(handler) ? handler : Function(handler)).apply(this, args); } : handler, timeout); }; }; // ie9- setTimeout & setInterval additional parameters fix // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers $$3({ global: true, bind: true, forced: MSIE }, { // `setTimeout` method // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout setTimeout: wrap(global$2.setTimeout), // `setInterval` method // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval setInterval: wrap(global$2.setInterval) }); var fails = fails$15; var wellKnownSymbol$1 = wellKnownSymbol$G; var IS_PURE = isPure; var ITERATOR$1 = wellKnownSymbol$1('iterator'); var nativeUrl = !fails(function () { var url = new URL('b?a=1&b=2&c=3', 'http://a'); var searchParams = url.searchParams; var result = ''; url.pathname = 'c%20d'; searchParams.forEach(function (value, key) { searchParams['delete']('b'); result += key + value; }); return (IS_PURE && !url.toJSON) || !searchParams.sort || url.href !== 'http://a/c%20d?a=1&c=3' || searchParams.get('c') !== '3' || String(new URLSearchParams('?a=1')) !== 'a=1' || !searchParams[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 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 floor$1 = Math.floor; var stringFromCharCode = String.fromCharCode; /** * 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 = string.charCodeAt(counter++); if (value >= 0xD800 && value <= 0xDBFF && counter < length) { // It's a high surrogate, and there is a next character. var extra = string.charCodeAt(counter++); if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. output.push(((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. output.push(value); counter--; } } else { output.push(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); for (; delta > baseMinusTMin * tMax >> 1; k += base) { delta = floor$1(delta / baseMinusTMin); } 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. */ // eslint-disable-next-line max-statements -- TODO 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) { output.push(stringFromCharCode(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) { output.push(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; for (var k = base; /* no condition */; k += base) { var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); if (q < t) break; var qMinusT = q - t; var baseMinusT = base - t; output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT))); q = floor$1(qMinusT / baseMinusT); } output.push(stringFromCharCode(digitToBasic(q))); bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); delta = 0; ++handledCPCount; } } ++delta; ++n; } return output.join(''); }; var stringPunycodeToAscii = function (input) { var encoded = []; var labels = input.toLowerCase().replace(regexSeparators, '\u002E').split('.'); var i, label; for (i = 0; i < labels.length; i++) { label = labels[i]; encoded.push(regexNonASCII.test(label) ? 'xn--' + encode(label) : label); } return encoded.join('.'); }; // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` var $$2 = _export; var getBuiltIn = getBuiltIn$y; var USE_NATIVE_URL$1 = nativeUrl; var redefine$1 = redefine$l.exports; var redefineAll = redefineAll$a; var setToStringTag$1 = setToStringTag$b; var createIteratorConstructor = createIteratorConstructor$7; var InternalStateModule$1 = internalState; var anInstance$1 = anInstance$b; var isCallable = isCallable$z; var hasOwn$1 = hasOwnProperty_1; var bind = functionBindContext; var classof = classof$b; var anObject = anObject$1C; var isObject = isObject$C; var $toString$1 = toString$t; var create = objectCreate$1; var createPropertyDescriptor = createPropertyDescriptor$9; var getIterator = getIterator$b; var getIteratorMethod = getIteratorMethod$9; var wellKnownSymbol = wellKnownSymbol$G; var nativeFetch = getBuiltIn('fetch'); var NativeRequest = getBuiltIn('Request'); var RequestPrototype = NativeRequest && NativeRequest.prototype; var Headers = getBuiltIn('Headers'); 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); var plus = /\+/g; var sequences = Array(4); var percentSequence = function (bytes) { return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\da-f]{2}){' + bytes + '})', 'gi')); }; var percentDecode = function (sequence) { try { return decodeURIComponent(sequence); } catch (error) { return sequence; } }; var deserialize = function (it) { var result = it.replace(plus, ' '); var bytes = 4; try { return decodeURIComponent(result); } catch (error) { while (bytes) { result = result.replace(percentSequence(bytes--), percentDecode); } return result; } }; var find = /[!'()~]|%20/g; var replace = { '!': '%21', "'": '%27', '(': '%28', ')': '%29', '~': '%7E', '%20': '+' }; var replacer = function (match) { return replace[match]; }; var serialize = function (it) { return encodeURIComponent(it).replace(find, replacer); }; var parseSearchParams = function (result, query) { if (query) { var attributes = query.split('&'); var index = 0; var attribute, entry; while (index < attributes.length) { attribute = attributes[index++]; if (attribute.length) { entry = attribute.split('='); result.push({ key: deserialize(entry.shift()), value: deserialize(entry.join('=')) }); } } } }; var updateSearchParams = function (query) { this.entries.length = 0; parseSearchParams(this.entries, query); }; var validateArgumentsLength = function (passed, required) { if (passed < required) throw TypeError('Not enough arguments'); }; 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; }); // `URLSearchParams` constructor // https://url.spec.whatwg.org/#interface-urlsearchparams var URLSearchParamsConstructor = function URLSearchParams(/* init */) { anInstance$1(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS); var init = arguments.length > 0 ? arguments[0] : undefined; var that = this; var entries = []; var iteratorMethod, iterator, next, step, entryIterator, entryNext, first, second, key; setInternalState$1(that, { type: URL_SEARCH_PARAMS, entries: entries, updateURL: function () { /* empty */ }, updateSearchParams: updateSearchParams }); if (init !== undefined) { if (isObject(init)) { iteratorMethod = getIteratorMethod(init); if (iteratorMethod) { iterator = getIterator(init, iteratorMethod); next = iterator.next; while (!(step = next.call(iterator)).done) { entryIterator = getIterator(anObject(step.value)); entryNext = entryIterator.next; if ( (first = entryNext.call(entryIterator)).done || (second = entryNext.call(entryIterator)).done || !entryNext.call(entryIterator).done ) throw TypeError('Expected sequence with length 2'); entries.push({ key: $toString$1(first.value), value: $toString$1(second.value) }); } } else for (key in init) if (hasOwn$1(init, key)) entries.push({ key: key, value: $toString$1(init[key]) }); } else { parseSearchParams( entries, typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : $toString$1(init) ); } } }; var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype; redefineAll(URLSearchParamsPrototype, { // `URLSearchParams.prototype.append` method // https://url.spec.whatwg.org/#dom-urlsearchparams-append append: function append(name, value) { validateArgumentsLength(arguments.length, 2); var state = getInternalParamsState(this); state.entries.push({ key: $toString$1(name), value: $toString$1(value) }); state.updateURL(); }, // `URLSearchParams.prototype.delete` method // https://url.spec.whatwg.org/#dom-urlsearchparams-delete 'delete': function (name) { validateArgumentsLength(arguments.length, 1); var state = getInternalParamsState(this); var entries = state.entries; var key = $toString$1(name); var index = 0; while (index < entries.length) { if (entries[index].key === key) entries.splice(index, 1); else index++; } state.updateURL(); }, // `URLSearchParams.prototype.get` method // https://url.spec.whatwg.org/#dom-urlsearchparams-get get: function get(name) { validateArgumentsLength(arguments.length, 1); var entries = getInternalParamsState(this).entries; 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) { validateArgumentsLength(arguments.length, 1); var entries = getInternalParamsState(this).entries; var key = $toString$1(name); var result = []; var index = 0; for (; index < entries.length; index++) { if (entries[index].key === key) result.push(entries[index].value); } return result; }, // `URLSearchParams.prototype.has` method // https://url.spec.whatwg.org/#dom-urlsearchparams-has has: function has(name) { validateArgumentsLength(arguments.length, 1); var entries = getInternalParamsState(this).entries; var key = $toString$1(name); var index = 0; while (index < entries.length) { if (entries[index++].key === key) return true; } return false; }, // `URLSearchParams.prototype.set` method // https://url.spec.whatwg.org/#dom-urlsearchparams-set set: function set(name, value) { validateArgumentsLength(arguments.length, 1); var state = getInternalParamsState(this); 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) entries.splice(index--, 1); else { found = true; entry.value = val; } } } if (!found) entries.push({ key: key, value: val }); state.updateURL(); }, // `URLSearchParams.prototype.sort` method // https://url.spec.whatwg.org/#dom-urlsearchparams-sort sort: function sort() { var state = getInternalParamsState(this); var entries = state.entries; // Array#sort is not stable in some engines var slice = entries.slice(); var entry, entriesIndex, sliceIndex; entries.length = 0; for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) { entry = slice[sliceIndex]; for (entriesIndex = 0; entriesIndex < sliceIndex; entriesIndex++) { if (entries[entriesIndex].key > entry.key) { entries.splice(entriesIndex, 0, entry); break; } } if (entriesIndex === sliceIndex) entries.push(entry); } state.updateURL(); }, // `URLSearchParams.prototype.forEach` method forEach: function forEach(callback /* , thisArg */) { var entries = getInternalParamsState(this).entries; var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined, 3); 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 redefine$1(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries, { name: 'entries' }); // `URLSearchParams.prototype.toString` method // https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior redefine$1(URLSearchParamsPrototype, 'toString', function toString() { var entries = getInternalParamsState(this).entries; var result = []; var index = 0; var entry; while (index < entries.length) { entry = entries[index++]; result.push(serialize(entry.key) + '=' + serialize(entry.value)); } return result.join('&'); }, { enumerable: true }); setToStringTag$1(URLSearchParamsConstructor, URL_SEARCH_PARAMS); $$2({ global: true, forced: !USE_NATIVE_URL$1 }, { URLSearchParams: URLSearchParamsConstructor }); // Wrap `fetch` and `Request` for correct work with polyfilled `URLSearchParams` if (!USE_NATIVE_URL$1 && isCallable(Headers)) { 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 (!headers.has('content-type')) { headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); } return create(init, { body: createPropertyDescriptor(0, String(body)), headers: createPropertyDescriptor(0, headers) }); } } return init; }; if (isCallable(nativeFetch)) { $$2({ global: true, enumerable: 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, RequestConstructor, 'Request'); return new NativeRequest(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {}); }; RequestPrototype.constructor = RequestConstructor; RequestConstructor.prototype = RequestPrototype; $$2({ global: true, forced: true }, { Request: RequestConstructor }); } } var web_urlSearchParams = { URLSearchParams: URLSearchParamsConstructor, getState: getInternalParamsState }; // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` var $$1 = _export; var DESCRIPTORS = descriptors; var USE_NATIVE_URL = nativeUrl; var global$1 = global$R; var defineProperties = objectDefineProperties; var redefine = redefine$l.exports; var anInstance = anInstance$b; var hasOwn = hasOwnProperty_1; var assign = objectAssign; var arrayFrom = arrayFrom$1; var codeAt = stringMultibyte.codeAt; var toASCII = stringPunycodeToAscii; var $toString = toString$t; var setToStringTag = setToStringTag$b; var URLSearchParamsModule = web_urlSearchParams; var InternalStateModule = internalState; var NativeURL = global$1.URL; var URLSearchParams$1 = URLSearchParamsModule.URLSearchParams; var getInternalSearchParamsState = URLSearchParamsModule.getState; var setInternalState = InternalStateModule.set; var getInternalURLState = InternalStateModule.getterFor('URL'); var floor = Math.floor; var pow = Math.pow; 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_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u0020]+|[\u0000-\u0020]+$/g; var TAB_AND_NEW_LINE = /[\t\n\r]/g; /* eslint-enable regexp/no-control-character -- safe */ var EOF; var parseHost = function (url, input) { var result, codePoints, index; if (input.charAt(0) == '[') { if (input.charAt(input.length - 1) != ']') return INVALID_HOST; result = parseIPv6(input.slice(1, -1)); if (!result) return INVALID_HOST; url.host = result; // opaque host } else if (!isSpecial(url)) { if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST; result = ''; codePoints = arrayFrom(input); for (index = 0; index < codePoints.length; index++) { result += percentEncode(codePoints[index], C0ControlPercentEncodeSet); } url.host = result; } else { input = toASCII(input); if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST; result = parseIPv4(input); if (result === null) return INVALID_HOST; url.host = result; } }; var parseIPv4 = function (input) { var parts = input.split('.'); var partsLength, numbers, index, part, radix, number, ipv4; if (parts.length && parts[parts.length - 1] == '') { parts.pop(); } 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 && part.charAt(0) == '0') { radix = HEX_START.test(part) ? 16 : 8; part = part.slice(radix == 8 ? 1 : 2); } if (part === '') { number = 0; } else { if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input; number = parseInt(part, radix); } numbers.push(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 = numbers.pop(); for (index = 0; index < numbers.length; index++) { ipv4 += numbers[index] * pow(256, 3 - index); } return ipv4; }; // 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 input.charAt(pointer); }; if (chr() == ':') { if (input.charAt(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 && HEX.test(chr())) { value = value * 16 + parseInt(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 (!DIGIT.test(chr())) return; while (DIGIT.test(chr())) { number = parseInt(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; }; var serializeHost = function (host) { var result, index, compress, ignore0; // ipv4 if (typeof host == 'number') { result = []; for (index = 0; index < 4; index++) { result.unshift(host % 256); host = floor(host / 256); } return result.join('.'); // 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 += host[index].toString(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); }; var specialSchemes = { ftp: 21, file: null, http: 80, https: 443, ws: 80, wss: 443 }; var isSpecial = function (url) { return hasOwn(specialSchemes, url.scheme); }; var includesCredentials = function (url) { return url.username != '' || url.password != ''; }; var cannotHaveUsernamePasswordPort = function (url) { return !url.host || url.cannotBeABaseURL || url.scheme == 'file'; }; var isWindowsDriveLetter = function (string, normalized) { var second; return string.length == 2 && ALPHA.test(string.charAt(0)) && ((second = string.charAt(1)) == ':' || (!normalized && second == '|')); }; var startsWithWindowsDriveLetter = function (string) { var third; return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && ( string.length == 2 || ((third = string.charAt(2)) === '/' || third === '\\' || third === '?' || third === '#') ); }; var shortenURLsPath = function (url) { var path = url.path; var pathSize = path.length; if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) { path.pop(); } }; var isSingleDot = function (segment) { return segment === '.' || segment.toLowerCase() === '%2e'; }; var isDoubleDot = function (segment) { segment = segment.toLowerCase(); 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 = {}; // eslint-disable-next-line max-statements -- TODO var parseURL = function (url, input, stateOverride, base) { var state = stateOverride || SCHEME_START; var pointer = 0; var buffer = ''; var seenAt = false; var seenBracket = false; var seenPasswordToken = false; var codePoints, chr, bufferCodePoints, failure; 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 = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, ''); } input = input.replace(TAB_AND_NEW_LINE, ''); codePoints = arrayFrom(input); while (pointer <= codePoints.length) { chr = codePoints[pointer]; switch (state) { case SCHEME_START: if (chr && ALPHA.test(chr)) { buffer += chr.toLowerCase(); state = SCHEME; } else if (!stateOverride) { state = NO_SCHEME; continue; } else return INVALID_SCHEME; break; case SCHEME: if (chr && (ALPHANUMERIC.test(chr) || chr == '+' || chr == '-' || chr == '.')) { buffer += chr.toLowerCase(); } else if (chr == ':') { if (stateOverride && ( (isSpecial(url) != hasOwn(specialSchemes, buffer)) || (buffer == 'file' && (includesCredentials(url) || url.port !== null)) || (url.scheme == 'file' && !url.host) )) return; url.scheme = buffer; if (stateOverride) { if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null; return; } buffer = ''; if (url.scheme == 'file') { state = FILE; } else if (isSpecial(url) && base && base.scheme == url.scheme) { state = SPECIAL_RELATIVE_OR_AUTHORITY; } else if (isSpecial(url)) { state = SPECIAL_AUTHORITY_SLASHES; } else if (codePoints[pointer + 1] == '/') { state = PATH_OR_AUTHORITY; pointer++; } else { url.cannotBeABaseURL = true; url.path.push(''); 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 = base.path.slice(); 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 = base.path.slice(); url.query = base.query; } else if (chr == '/' || (chr == '\\' && isSpecial(url))) { state = RELATIVE_SLASH; } else if (chr == '?') { url.username = base.username; url.password = base.password; url.host = base.host; url.port = base.port; url.path = base.path.slice(); 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 = base.path.slice(); 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 = base.path.slice(); url.path.pop(); state = PATH; continue; } break; case RELATIVE_SLASH: if (isSpecial(url) && (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 != '/' || buffer.charAt(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 == '\\' && isSpecial(url)) ) { 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 = parseHost(url, buffer); if (failure) return failure; buffer = ''; state = PORT; if (stateOverride == HOSTNAME) return; } else if ( chr == EOF || chr == '/' || chr == '?' || chr == '#' || (chr == '\\' && isSpecial(url)) ) { if (isSpecial(url) && buffer == '') return INVALID_HOST; if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return; failure = parseHost(url, 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 (DIGIT.test(chr)) { buffer += chr; } else if ( chr == EOF || chr == '/' || chr == '?' || chr == '#' || (chr == '\\' && isSpecial(url)) || stateOverride ) { if (buffer != '') { var port = parseInt(buffer, 10); if (port > 0xFFFF) return INVALID_PORT; url.port = (isSpecial(url) && 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') { if (chr == EOF) { url.host = base.host; url.path = base.path.slice(); url.query = base.query; } else if (chr == '?') { url.host = base.host; url.path = base.path.slice(); url.query = ''; state = QUERY; } else if (chr == '#') { url.host = base.host; url.path = base.path.slice(); url.query = base.query; url.fragment = ''; state = FRAGMENT; } else { if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) { url.host = base.host; url.path = base.path.slice(); shortenURLsPath(url); } state = PATH; continue; } } else { state = PATH; continue; } break; case FILE_SLASH: if (chr == '/' || chr == '\\') { state = FILE_HOST; break; } if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) { if (isWindowsDriveLetter(base.path[0], true)) url.path.push(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 = parseHost(url, 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 (isSpecial(url)) { 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 == '\\' && isSpecial(url)) || (!stateOverride && (chr == '?' || chr == '#')) ) { if (isDoubleDot(buffer)) { shortenURLsPath(url); if (chr != '/' && !(chr == '\\' && isSpecial(url))) { url.path.push(''); } } else if (isSingleDot(buffer)) { if (chr != '/' && !(chr == '\\' && isSpecial(url))) { url.path.push(''); } } else { if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) { if (url.host) url.host = ''; buffer = buffer.charAt(0) + ':'; // normalize windows drive letter } url.path.push(buffer); } buffer = ''; if (url.scheme == 'file' && (chr == EOF || chr == '?' || chr == '#')) { while (url.path.length > 1 && url.path[0] === '') { url.path.shift(); } } 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 == "'" && isSpecial(url)) 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++; } }; // `URL` constructor // https://url.spec.whatwg.org/#url-class var URLConstructor = function URL(url /* , base */) { var that = anInstance(this, URLConstructor, 'URL'); var base = arguments.length > 1 ? arguments[1] : undefined; var urlString = $toString(url); var state = setInternalState(that, { type: 'URL' }); var baseState, failure; if (base !== undefined) { if (base instanceof URLConstructor) baseState = getInternalURLState(base); else { failure = parseURL(baseState = {}, $toString(base)); if (failure) throw TypeError(failure); } } failure = parseURL(state, urlString, null, baseState); if (failure) throw TypeError(failure); var searchParams = state.searchParams = new URLSearchParams$1(); var searchParamsState = getInternalSearchParamsState(searchParams); searchParamsState.updateSearchParams(state.query); searchParamsState.updateURL = function () { state.query = String(searchParams) || null; }; if (!DESCRIPTORS) { that.href = serializeURL.call(that); that.origin = getOrigin.call(that); that.protocol = getProtocol.call(that); that.username = getUsername.call(that); that.password = getPassword.call(that); that.host = getHost.call(that); that.hostname = getHostname.call(that); that.port = getPort.call(that); that.pathname = getPathname.call(that); that.search = getSearch.call(that); that.searchParams = getSearchParams.call(that); that.hash = getHash.call(that); } }; var URLPrototype = URLConstructor.prototype; var serializeURL = function () { var url = getInternalURLState(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 (includesCredentials(url)) { output += username + (password ? ':' + password : '') + '@'; } output += serializeHost(host); if (port !== null) output += ':' + port; } else if (scheme == 'file') output += '//'; output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : ''; if (query !== null) output += '?' + query; if (fragment !== null) output += '#' + fragment; return output; }; var getOrigin = function () { var url = getInternalURLState(this); var scheme = url.scheme; var port = url.port; if (scheme == 'blob') try { return new URLConstructor(scheme.path[0]).origin; } catch (error) { return 'null'; } if (scheme == 'file' || !isSpecial(url)) return 'null'; return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : ''); }; var getProtocol = function () { return getInternalURLState(this).scheme + ':'; }; var getUsername = function () { return getInternalURLState(this).username; }; var getPassword = function () { return getInternalURLState(this).password; }; var getHost = function () { var url = getInternalURLState(this); var host = url.host; var port = url.port; return host === null ? '' : port === null ? serializeHost(host) : serializeHost(host) + ':' + port; }; var getHostname = function () { var host = getInternalURLState(this).host; return host === null ? '' : serializeHost(host); }; var getPort = function () { var port = getInternalURLState(this).port; return port === null ? '' : String(port); }; var getPathname = function () { var url = getInternalURLState(this); var path = url.path; return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : ''; }; var getSearch = function () { var query = getInternalURLState(this).query; return query ? '?' + query : ''; }; var getSearchParams = function () { return getInternalURLState(this).searchParams; }; var getHash = function () { var fragment = getInternalURLState(this).fragment; return fragment ? '#' + fragment : ''; }; var accessorDescriptor = function (getter, setter) { return { get: getter, set: setter, configurable: true, enumerable: true }; }; if (DESCRIPTORS) { defineProperties(URLPrototype, { // `URL.prototype.href` accessors pair // https://url.spec.whatwg.org/#dom-url-href href: accessorDescriptor(serializeURL, function (href) { var url = getInternalURLState(this); var urlString = $toString(href); var failure = parseURL(url, urlString); if (failure) throw TypeError(failure); getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query); }), // `URL.prototype.origin` getter // https://url.spec.whatwg.org/#dom-url-origin origin: accessorDescriptor(getOrigin), // `URL.prototype.protocol` accessors pair // https://url.spec.whatwg.org/#dom-url-protocol protocol: accessorDescriptor(getProtocol, function (protocol) { var url = getInternalURLState(this); parseURL(url, $toString(protocol) + ':', SCHEME_START); }), // `URL.prototype.username` accessors pair // https://url.spec.whatwg.org/#dom-url-username username: accessorDescriptor(getUsername, function (username) { var url = getInternalURLState(this); var codePoints = arrayFrom($toString(username)); if (cannotHaveUsernamePasswordPort(url)) return; url.username = ''; for (var i = 0; i < codePoints.length; i++) { url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet); } }), // `URL.prototype.password` accessors pair // https://url.spec.whatwg.org/#dom-url-password password: accessorDescriptor(getPassword, function (password) { var url = getInternalURLState(this); var codePoints = arrayFrom($toString(password)); if (cannotHaveUsernamePasswordPort(url)) return; url.password = ''; for (var i = 0; i < codePoints.length; i++) { url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet); } }), // `URL.prototype.host` accessors pair // https://url.spec.whatwg.org/#dom-url-host host: accessorDescriptor(getHost, function (host) { var url = getInternalURLState(this); if (url.cannotBeABaseURL) return; parseURL(url, $toString(host), HOST); }), // `URL.prototype.hostname` accessors pair // https://url.spec.whatwg.org/#dom-url-hostname hostname: accessorDescriptor(getHostname, function (hostname) { var url = getInternalURLState(this); if (url.cannotBeABaseURL) return; parseURL(url, $toString(hostname), HOSTNAME); }), // `URL.prototype.port` accessors pair // https://url.spec.whatwg.org/#dom-url-port port: accessorDescriptor(getPort, function (port) { var url = getInternalURLState(this); if (cannotHaveUsernamePasswordPort(url)) return; port = $toString(port); if (port == '') url.port = null; else parseURL(url, port, PORT); }), // `URL.prototype.pathname` accessors pair // https://url.spec.whatwg.org/#dom-url-pathname pathname: accessorDescriptor(getPathname, function (pathname) { var url = getInternalURLState(this); if (url.cannotBeABaseURL) return; url.path = []; parseURL(url, $toString(pathname), PATH_START); }), // `URL.prototype.search` accessors pair // https://url.spec.whatwg.org/#dom-url-search search: accessorDescriptor(getSearch, function (search) { var url = getInternalURLState(this); search = $toString(search); if (search == '') { url.query = null; } else { if ('?' == search.charAt(0)) search = search.slice(1); url.query = ''; parseURL(url, search, QUERY); } getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query); }), // `URL.prototype.searchParams` getter // https://url.spec.whatwg.org/#dom-url-searchparams searchParams: accessorDescriptor(getSearchParams), // `URL.prototype.hash` accessors pair // https://url.spec.whatwg.org/#dom-url-hash hash: accessorDescriptor(getHash, function (hash) { var url = getInternalURLState(this); hash = $toString(hash); if (hash == '') { url.fragment = null; return; } if ('#' == hash.charAt(0)) hash = hash.slice(1); url.fragment = ''; parseURL(url, hash, FRAGMENT); }) }); } // `URL.prototype.toJSON` method // https://url.spec.whatwg.org/#dom-url-tojson redefine(URLPrototype, 'toJSON', function toJSON() { return serializeURL.call(this); }, { enumerable: true }); // `URL.prototype.toString` method // https://url.spec.whatwg.org/#URL-stringification-behavior redefine(URLPrototype, 'toString', function toString() { return serializeURL.call(this); }, { 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 // eslint-disable-next-line no-unused-vars -- required for `.length` if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) { return nativeCreateObjectURL.apply(NativeURL, arguments); }); // `URL.revokeObjectURL` method // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL // eslint-disable-next-line no-unused-vars -- required for `.length` if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) { return nativeRevokeObjectURL.apply(NativeURL, arguments); }); } setToStringTag(URLConstructor, 'URL'); $$1({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, { URL: URLConstructor }); var $ = _export; // `URL.prototype.toJSON` method // https://url.spec.whatwg.org/#dom-url-tojson $({ target: 'URL', proto: true, enumerable: true }, { toJSON: function toJSON() { return URL.prototype.toString.call(this); } }); rollup-2.61.1/test/form/samples/supports-core-js/main.js000066400000000000000000000000221415504077600232300ustar00rootroot00000000000000import 'core-js'; rollup-2.61.1/test/form/samples/supports-es5-shim/000077500000000000000000000000001415504077600220445ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/supports-es5-shim/_config.js000066400000000000000000000007001415504077600240030ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/form/samples/supports-es5-shim/_expected.js000066400000000000000000002640551415504077600243560ustar00rootroot00000000000000var 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: http://es5.github.com/ (specific links below) * ES5 Spec: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf * Required reading: http://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 http://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)); // // 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 // http://es5.github.com/#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 // http://es5.github.com/#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 // http://es5.github.com/#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 // http://es5.github.com/#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 // http://es5.github.com/#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 // http://es5.github.com/#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 // http://es5.github.com/#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 // http://es5.github.com/#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 // http://es5.github.com/#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 // http://es5.github.com/#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 // http://es5.github.com/#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 // http://es5.github.com/#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 // http://es5.github.com/#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 // http://es5.github.com/#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 // http://es5.github.com/#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; }()); 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); 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 // http://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 // http://es5.github.com/#x15.2.3.14 // 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 // http://es5.github.com/#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 // http://es5.github.com/#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 // http://es5.github.com/#x15.9.4.2 // based on work shared by Daniel Friesen (dantman) // http://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; } date = length === 1 && $String(Y) === Y // isString(Y) // We explicitly pass it through parse: ? new NativeDate(DateShim.parse(Y)) // 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 // http://es5.github.com/#x15.9.4.4 if (!Date.now) { Date.now = function now() { return new Date().getTime(); }; } // // Number // ====== // // ES5.1 15.7.4.5 // http://es5.github.com/#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); defineProperties(NumberPrototype, { toExponential: function toExponential(fractionDigits) { // 1: Let x be this Number value. var x = $Number(this); if (typeof fractionDigits === 'undefined') { return originalToExponential(x); } var f = ES.ToInteger(fractionDigits); if (isActualNaN(x)) { return 'NaN'; } if (f < 0 || f > 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 // http://es5.github.com/#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 http://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 string_substr = StringPrototype.substr; var hasNegativeSubstrBug = ''.substr && '0b'.substr(-1) !== 'b'; defineProperties(StringPrototype, { substr: function substr(start, length) { var normalizedStart = start; if (start < 0) { normalizedStart = max(this.length + start, 0); } return string_substr.call(this, normalizedStart, length); } }, hasNegativeSubstrBug); // ES5 15.5.4.20 // whitespace from: http://es5.github.io/#x15.5.4.20 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'; var zeroWidth = '\u200b'; var wsRegexChars = '[' + ws + ']'; var trimBeginRegexp = new RegExp('^' + wsRegexChars + wsRegexChars + '*'); var trimEndRegexp = new RegExp(wsRegexChars + wsRegexChars + '*$'); var hasTrimWhitespaceBug = StringPrototype.trim && (ws.trim() || !zeroWidth.trim()); defineProperties(StringPrototype, { // http://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 // eslint-disable-next-line radix if (parseInt(ws + '08') !== 8 || parseInt(ws + '0x16') !== 22) { // eslint-disable-next-line no-global-assign, no-implicit-globals parseInt = (function (origParseInt) { return function parseInt(str, radix) { 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) { 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-2.61.1/test/form/samples/supports-es5-shim/main.js000066400000000000000000000000231415504077600233210ustar00rootroot00000000000000import 'es5-shim'; rollup-2.61.1/test/form/samples/supports-es6-shim/000077500000000000000000000000001415504077600220455ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/supports-es6-shim/_config.js000066400000000000000000000005701415504077600240110ustar00rootroot00000000000000module.exports = { 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')() ] } }; rollup-2.61.1/test/form/samples/supports-es6-shim/_expected.js000066400000000000000000004200401415504077600243430ustar00rootroot00000000000000var 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'; // eslint-disable-line no-extra-parens 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)); }, IsIterable: function (o) { return ES.TypeIsObject(o) && (typeof o[$iterator$] !== 'undefined' || isArguments(o)); }, 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); this._s = ES.ToString(s); 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) { this.i = 0; this.array = array; 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) { addIterator(Object.getPrototypeOf([].values())); } // 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); } else { 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 }); /* eslint-disable no-undef, no-global-assign */ Number = NumberShim; Value.redefine(globals, 'Number', NumberShim); /* eslint-enable no-undef, no-global-assign */ } 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, magic) { 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, magic).set; _call(set, {}, null); } catch (e) { if (Object.prototype !== {}[magic]) { // IE < 11 cannot be shimmed return; } // probably Chrome or some old Mobile stock browser set = function (proto) { this[magic] = 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, '__proto__')) }; 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); } 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 }); /* eslint-disable no-undef, no-global-assign */ RegExp = RegExpShim; Value.redefine(globals, 'RegExp', RegExpShim); /* eslint-enable no-undef, no-global-assign */ } 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) { /* globals Promise: true */ /* eslint-disable no-undef, no-global-assign */ Promise = PromiseShim; /* eslint-enable no-undef, 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]]'); this.head = map._head; this.i = this.head; 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; } else { return; } } if (this._map) { // fast object key path entry = origMapGet.call(this._map, key); if (entry) { return entry.value; } else { 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; } else { 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; } else { 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) { 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 }); } else { 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); } else { 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-2.61.1/test/form/samples/supports-es6-shim/main.js000066400000000000000000000000231415504077600233220ustar00rootroot00000000000000import 'es6-shim'; rollup-2.61.1/test/form/samples/switch-scopes/000077500000000000000000000000001415504077600213105ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/switch-scopes/_config.js000066400000000000000000000001621415504077600232510ustar00rootroot00000000000000module.exports = { description: 'correctly handles switch scopes', options: { output: { name: 'myBundle' } } }; rollup-2.61.1/test/form/samples/switch-scopes/_expected.js000066400000000000000000000001671415504077600236120ustar00rootroot00000000000000const x = globalThis.unknown; switch ( globalThis.unknown ) { case 2: x(); } switch ( globalThis.unknown() ) { } rollup-2.61.1/test/form/samples/switch-scopes/main.js000066400000000000000000000004601415504077600225720ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/synthetic-named-exports/000077500000000000000000000000001415504077600233135ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/synthetic-named-exports/_config.js000066400000000000000000000006511415504077600252570ustar00rootroot00000000000000module.exports = { description: 'synthetic named exports', options: { plugins: [ { 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-2.61.1/test/form/samples/synthetic-named-exports/_expected.js000066400000000000000000000001561415504077600256130ustar00rootroot00000000000000const d = { fn: 42, hello: 'hola' }; console.log(d.fn); console.log(d.foo); console.log(d["some-prop"]); rollup-2.61.1/test/form/samples/synthetic-named-exports/main.js000066400000000000000000000002101415504077600245660ustar00rootroot00000000000000import { fn, foo } from './dep1.js'; import * as ns from './dep1.js'; console.log(fn); console.log(foo); console.log(ns['some-prop']); rollup-2.61.1/test/form/samples/system-comments/000077500000000000000000000000001415504077600216645ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/system-comments/_config.js000066400000000000000000000002331415504077600236240ustar00rootroot00000000000000module.exports = { description: 'Correctly places leading comments when rendering system bindings', options: { output: { format: 'system' } } }; rollup-2.61.1/test/form/samples/system-comments/_expected.js000066400000000000000000000007061415504077600241650ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/system-comments/main.js000066400000000000000000000003621415504077600231470ustar00rootroot00000000000000const pureFunc = () => console.log('not really pure') || 0; export var singleLine = /*#__PURE__*/pureFunc(); singleLine = /*#__PURE__*/pureFunc(); export var multiLine = /*#__PURE__*/ pureFunc(); multiLine = /*#__PURE__*/ pureFunc(); rollup-2.61.1/test/form/samples/system-default-comments/000077500000000000000000000000001415504077600233065ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/system-default-comments/_config.js000066400000000000000000000002421415504077600252460ustar00rootroot00000000000000module.exports = { description: 'Correctly places leading comments when rendering system default exports', options: { output: { format: 'system' } } }; rollup-2.61.1/test/form/samples/system-default-comments/_expected.js000066400000000000000000000003501415504077600256020ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { const pureFunc = () => console.log('not really pure') || 0; var main = exports('default', /*#__PURE__*/pureFunc()); }) }; })); rollup-2.61.1/test/form/samples/system-default-comments/main.js000066400000000000000000000001451415504077600245700ustar00rootroot00000000000000const pureFunc = () => console.log('not really pure') || 0; export default /*#__PURE__*/pureFunc(); rollup-2.61.1/test/form/samples/system-export-declarations/000077500000000000000000000000001415504077600240265ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/system-export-declarations/_config.js000066400000000000000000000002211415504077600257630ustar00rootroot00000000000000module.exports = { description: 'Renders declarations where some variables are exported', options: { output: { format: 'system' } } }; rollup-2.61.1/test/form/samples/system-export-declarations/_expected.js000066400000000000000000000012061415504077600263230ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/system-export-declarations/main.js000066400000000000000000000010101415504077600253000ustar00rootroot00000000000000// 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-2.61.1/test/form/samples/system-export-destructuring-declaration/000077500000000000000000000000001415504077600265435ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/system-export-destructuring-declaration/_config.js000066400000000000000000000002131415504077600305010ustar00rootroot00000000000000module.exports = { description: 'supports destructuring declarations for systemJS', options: { output: { format: 'system' } } }; rollup-2.61.1/test/form/samples/system-export-destructuring-declaration/_expected.js000066400000000000000000000007721415504077600310470ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/system-export-destructuring-declaration/main.js000066400000000000000000000003401415504077600300220ustar00rootroot00000000000000export 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-2.61.1/test/form/samples/system-export-rendering-compact/000077500000000000000000000000001415504077600247575ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/system-export-rendering-compact/_config.js000066400000000000000000000002661415504077600267250ustar00rootroot00000000000000module.exports = { description: 'Renders updates of exported variables for SystemJS output in compact mode', options: { output: { format: 'system', compact: true } } }; rollup-2.61.1/test/form/samples/system-export-rendering-compact/_expected.js000066400000000000000000000026241415504077600272610ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/system-export-rendering-compact/main.js000066400000000000000000000012161415504077600262410ustar00rootroot00000000000000// --- // 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-2.61.1/test/form/samples/system-export-rendering/000077500000000000000000000000001415504077600233335ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/system-export-rendering/_config.js000066400000000000000000000002241415504077600252730ustar00rootroot00000000000000module.exports = { description: 'Renders updates of exported variables for SystemJS output', options: { output: { format: 'system' } } }; rollup-2.61.1/test/form/samples/system-export-rendering/_expected.js000066400000000000000000000032751415504077600256400ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/system-export-rendering/main.js000066400000000000000000000012161415504077600246150ustar00rootroot00000000000000// --- // 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-2.61.1/test/form/samples/system-module-reserved/000077500000000000000000000000001415504077600231415ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/system-module-reserved/_config.js000066400000000000000000000003071415504077600251030ustar00rootroot00000000000000module.exports = { description: 'does not output reserved system format identifiers', options: { external: ['test'], output: { name: 'systemReserved', globals: { test: 'test' } } } }; rollup-2.61.1/test/form/samples/system-module-reserved/_expected/000077500000000000000000000000001415504077600251015ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/system-module-reserved/_expected/amd.js000066400000000000000000000001401415504077600261730ustar00rootroot00000000000000define(['test'], (function (test) { 'use strict'; console.log(test.module, test.other); })); rollup-2.61.1/test/form/samples/system-module-reserved/_expected/cjs.js000066400000000000000000000001221415504077600262110ustar00rootroot00000000000000'use strict'; var test = require('test'); console.log(test.module, test.other); rollup-2.61.1/test/form/samples/system-module-reserved/_expected/es.js000066400000000000000000000001031415504077600260400ustar00rootroot00000000000000import { module, other } from 'test'; console.log(module, other); rollup-2.61.1/test/form/samples/system-module-reserved/_expected/iife.js000066400000000000000000000001251415504077600263510ustar00rootroot00000000000000(function (test) { 'use strict'; console.log(test.module, test.other); })(test); rollup-2.61.1/test/form/samples/system-module-reserved/_expected/system.js000066400000000000000000000004211415504077600267600ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/system-module-reserved/_expected/umd.js000066400000000000000000000005761415504077600262340ustar00rootroot00000000000000(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-2.61.1/test/form/samples/system-module-reserved/main.js000066400000000000000000000001031415504077600244150ustar00rootroot00000000000000import { module, other } from 'test'; console.log(module, other); rollup-2.61.1/test/form/samples/system-multiple-export-bindings/000077500000000000000000000000001415504077600250045ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/system-multiple-export-bindings/_config.js000066400000000000000000000002571415504077600267520ustar00rootroot00000000000000module.exports = { description: 'supports multiple live bindings for the same symbol in systemJS', options: { output: { format: 'system', exports: 'named' } } }; rollup-2.61.1/test/form/samples/system-multiple-export-bindings/_expected.js000066400000000000000000000026001415504077600273000ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/system-multiple-export-bindings/main.js000066400000000000000000000012651415504077600262720ustar00rootroot00000000000000// 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-2.61.1/test/form/samples/system-multiple-export-bindings/namespace.js000066400000000000000000000000531415504077600272740ustar00rootroot00000000000000export const x = 123; export const y = 456;rollup-2.61.1/test/form/samples/system-reexports/000077500000000000000000000000001415504077600220725ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/system-reexports/_config.js000066400000000000000000000002041415504077600240300ustar00rootroot00000000000000module.exports = { description: 'merges reexports in systemjs', options: { external: true, output: { format: 'system' } } }; rollup-2.61.1/test/form/samples/system-reexports/_expected.js000066400000000000000000000017641415504077600244000ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/system-reexports/main.js000066400000000000000000000005311415504077600233530ustar00rootroot00000000000000export { 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-2.61.1/test/form/samples/system-reexports/system.js000066400000000000000000000010161415504077600237520ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/system-semicolon/000077500000000000000000000000001415504077600220275ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/system-semicolon/_config.js000066400000000000000000000002001415504077600237610ustar00rootroot00000000000000module.exports = { description: 'supports asi in system binding output', options: { output: { format: 'system' } } }; rollup-2.61.1/test/form/samples/system-semicolon/_expected.js000066400000000000000000000004441415504077600243270ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/system-semicolon/main.js000066400000000000000000000002151415504077600233070ustar00rootroot00000000000000export default typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {} rollup-2.61.1/test/form/samples/system-uninitialized/000077500000000000000000000000001415504077600227075ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/system-uninitialized/_config.js000066400000000000000000000004051415504077600246500ustar00rootroot00000000000000// Changed due to https://github.com/acornjs/acorn/issues/806 // Consider reverting this change should this become an acorn option module.exports = { description: 'supports uninitialized binding exports', options: { output: { format: 'system' } } }; rollup-2.61.1/test/form/samples/system-uninitialized/_expected.js000066400000000000000000000003461415504077600252100ustar00rootroot00000000000000System.register([], (function (exports) { 'use strict'; return { execute: (function () { exports('q', q); var p; exports('p', p); function q () { exports('p', p = 10); } }) }; })); rollup-2.61.1/test/form/samples/system-uninitialized/main.js000066400000000000000000000000611415504077600241660ustar00rootroot00000000000000export var p; export function q () { p = 10; } rollup-2.61.1/test/form/samples/tdz-access-in-declaration/000077500000000000000000000000001415504077600234445ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/tdz-access-in-declaration/_config.js000066400000000000000000000001341415504077600254040ustar00rootroot00000000000000module.exports = { description: 'detect accessing TDZ variables within the declaration' }; rollup-2.61.1/test/form/samples/tdz-access-in-declaration/_expected.js000066400000000000000000000002471415504077600257450ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/tdz-access-in-declaration/main.js000066400000000000000000000002471415504077600247310ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/tdz-common/000077500000000000000000000000001415504077600206045ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/tdz-common/_config.js000066400000000000000000000001051415504077600225420ustar00rootroot00000000000000module.exports = { description: 'preserve common TDZ violations' }; rollup-2.61.1/test/form/samples/tdz-common/_expected.js000066400000000000000000000020311415504077600230760ustar00rootroot00000000000000console.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-2.61.1/test/form/samples/tdz-common/main.js000066400000000000000000000031071415504077600220670ustar00rootroot00000000000000console.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-2.61.1/test/form/samples/tdz-pattern-access/000077500000000000000000000000001415504077600222305ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/tdz-pattern-access/_config.js000066400000000000000000000001601415504077600241670ustar00rootroot00000000000000module.exports = { description: 'handles accessing variables declared in patterns before their declaration' }; rollup-2.61.1/test/form/samples/tdz-pattern-access/_expected.js000066400000000000000000000002051415504077600245230ustar00rootroot00000000000000x + y; const { x } = {}; const [y] = []; if (z) console.log('unimportant'); else console.log('retained'); var { z } = { z: true }; rollup-2.61.1/test/form/samples/tdz-pattern-access/main.js000066400000000000000000000002271415504077600235130ustar00rootroot00000000000000const tdzAccess = x + y; const { x } = {}; const [y] = []; if (z) console.log('unimportant'); else console.log('retained'); var { z } = { z: true }; rollup-2.61.1/test/form/samples/template-literal/000077500000000000000000000000001415504077600217625ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/template-literal/computed-properties/000077500000000000000000000000001415504077600257745ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/template-literal/computed-properties/_config.js000066400000000000000000000001321415504077600277320ustar00rootroot00000000000000module.exports = { description: 'Resolve template literals in computed property keys' }; rollup-2.61.1/test/form/samples/template-literal/computed-properties/_expected.js000066400000000000000000000001531415504077600302710ustar00rootroot00000000000000{ console.log('kept'); } { console.log('kept'); } { console.log('kept'); } { console.log('kept'); } rollup-2.61.1/test/form/samples/template-literal/computed-properties/main.js000066400000000000000000000005761415504077600272660ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/template-literal/simplify-conditionals/000077500000000000000000000000001415504077600263025ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/template-literal/simplify-conditionals/_config.js000066400000000000000000000001441415504077600302430ustar00rootroot00000000000000module.exports = { description: 'Template literals can be simplified when used in conditionals' }; rollup-2.61.1/test/form/samples/template-literal/simplify-conditionals/_expected.js000066400000000000000000000002411415504077600305750ustar00rootroot00000000000000{ console.log('kept'); } { console.log('kept'); } if (`${Math.random() > 0.5 ? 'truthy' : ''}`) { console.log('kept 1'); } else { console.log('kept 2'); } rollup-2.61.1/test/form/samples/template-literal/simplify-conditionals/main.js000066400000000000000000000003731415504077600275670ustar00rootroot00000000000000if (`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-2.61.1/test/form/samples/this-in-class-body/000077500000000000000000000000001415504077600221265ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/this-in-class-body/_config.js000066400000000000000000000001301415504077600240620ustar00rootroot00000000000000module.exports = { description: 'uses the correct "this" value in class properties' }; rollup-2.61.1/test/form/samples/this-in-class-body/_expected.js000066400000000000000000000012231415504077600244220ustar00rootroot00000000000000class 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-2.61.1/test/form/samples/this-in-class-body/main.js000066400000000000000000000015441415504077600234140ustar00rootroot00000000000000class 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-2.61.1/test/form/samples/this-in-imports/000077500000000000000000000000001415504077600215635ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/this-in-imports/_config.js000066400000000000000000000001611415504077600235230ustar00rootroot00000000000000module.exports = { description: 'properly keep or ignore "this"-expressions when calling imported functions' }; rollup-2.61.1/test/form/samples/this-in-imports/_expected.js000066400000000000000000000001651415504077600240630ustar00rootroot00000000000000function B$1 () { this.x = 1; } function B () { this.x = 1; } function B3 () { this.x = 1; } B$1(); B(); B3(); rollup-2.61.1/test/form/samples/this-in-imports/lib1.js000066400000000000000000000001151415504077600227450ustar00rootroot00000000000000export function A () { this.x = 1; } export function B () { this.x = 1; } rollup-2.61.1/test/form/samples/this-in-imports/lib2.js000066400000000000000000000001151415504077600227460ustar00rootroot00000000000000export function A () { this.x = 1; } export function B () { this.x = 1; } rollup-2.61.1/test/form/samples/this-in-imports/lib3a.js000066400000000000000000000000541415504077600231120ustar00rootroot00000000000000export default function () { this.x = 1; } rollup-2.61.1/test/form/samples/this-in-imports/lib3b.js000066400000000000000000000000541415504077600231130ustar00rootroot00000000000000export default function () { this.x = 1; } rollup-2.61.1/test/form/samples/this-in-imports/main.js000066400000000000000000000003741415504077600230510ustar00rootroot00000000000000import * 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-2.61.1/test/form/samples/this-is-undefined/000077500000000000000000000000001415504077600220345ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/this-is-undefined/_config.js000066400000000000000000000002011415504077600237670ustar00rootroot00000000000000module.exports = { description: 'top-level `this` expression is rewritten as `undefined`', options: { onwarn: () => {} } }; rollup-2.61.1/test/form/samples/this-is-undefined/_expected/000077500000000000000000000000001415504077600237745ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/this-is-undefined/_expected/amd.js000066400000000000000000000006551415504077600251010ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/this-is-undefined/_expected/cjs.js000066400000000000000000000006041415504077600251110ustar00rootroot00000000000000'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-2.61.1/test/form/samples/this-is-undefined/_expected/es.js000066400000000000000000000005651415504077600247470ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/this-is-undefined/_expected/iife.js000066400000000000000000000006501415504077600252470ustar00rootroot00000000000000(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-2.61.1/test/form/samples/this-is-undefined/_expected/system.js000066400000000000000000000010021415504077600256470ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/this-is-undefined/_expected/umd.js000066400000000000000000000010131415504077600251120ustar00rootroot00000000000000(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-2.61.1/test/form/samples/this-is-undefined/main.js000066400000000000000000000005521415504077600233200ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/top-level-await/000077500000000000000000000000001415504077600215275ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/top-level-await/_config.js000066400000000000000000000001321415504077600234650ustar00rootroot00000000000000module.exports = { description: 'top-level await support', formats: ['system', 'es'] }; rollup-2.61.1/test/form/samples/top-level-await/_expected/000077500000000000000000000000001415504077600234675ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/top-level-await/_expected/es.js000066400000000000000000000000571415504077600244360ustar00rootroot00000000000000await operation(); await retainedOperation(); rollup-2.61.1/test/form/samples/top-level-await/_expected/system.js000066400000000000000000000002411415504077600253460ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (async function () { await operation(); await retainedOperation(); }) }; })); rollup-2.61.1/test/form/samples/top-level-await/main.js000066400000000000000000000001341415504077600230070ustar00rootroot00000000000000await operation(); if (false) await treeshakenOperation(); else await retainedOperation(); rollup-2.61.1/test/form/samples/tree-shake-arguments-conditional/000077500000000000000000000000001415504077600250515ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/tree-shake-arguments-conditional/_config.js000066400000000000000000000001471415504077600270150ustar00rootroot00000000000000module.exports = { description: 'tracks tree-shaking of arguments through simplified conditionals' }; rollup-2.61.1/test/form/samples/tree-shake-arguments-conditional/_expected.js000066400000000000000000000001471415504077600273510ustar00rootroot00000000000000function ignoringArgs() { return 'no args'; } const handler = ignoringArgs; console.log(handler()); rollup-2.61.1/test/form/samples/tree-shake-arguments-conditional/main.js000066400000000000000000000002721415504077600263340ustar00rootroot00000000000000function ignoringArgs() { return 'no args'; } function takingArgs(arg) { return arg; } const handler = false ? takingArgs : ignoringArgs; console.log(handler('should be removed')); rollup-2.61.1/test/form/samples/tree-shake-curried-functions/000077500000000000000000000000001415504077600242065ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/tree-shake-curried-functions/_config.js000066400000000000000000000001751415504077600261530ustar00rootroot00000000000000module.exports = { description: 'Remove side-effect-free curried functions (#1263)', expectedWarnings: ['EMPTY_BUNDLE'] }; rollup-2.61.1/test/form/samples/tree-shake-curried-functions/_expected.js000066400000000000000000000000011415504077600264730ustar00rootroot00000000000000 rollup-2.61.1/test/form/samples/tree-shake-curried-functions/main.js000066400000000000000000000001661415504077600254730ustar00rootroot00000000000000function foo(a) { return function(b) { return a+b; } } function bar(a, b) { return a+b; } foo(1)(2); bar(1,2); rollup-2.61.1/test/form/samples/tree-shake-default-exports/000077500000000000000000000000001415504077600236715ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/tree-shake-default-exports/_config.js000066400000000000000000000001151415504077600256300ustar00rootroot00000000000000module.exports = { description: 'properly remove unused default exports' }; rollup-2.61.1/test/form/samples/tree-shake-default-exports/_expected/000077500000000000000000000000001415504077600256315ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/tree-shake-default-exports/_expected/amd.js000066400000000000000000000016201415504077600267270ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/tree-shake-default-exports/_expected/cjs.js000066400000000000000000000015211415504077600267450ustar00rootroot00000000000000'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-2.61.1/test/form/samples/tree-shake-default-exports/_expected/es.js000066400000000000000000000015021415504077600265740ustar00rootroot00000000000000/* 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-2.61.1/test/form/samples/tree-shake-default-exports/_expected/iife.js000066400000000000000000000016131415504077600271040ustar00rootroot00000000000000(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-2.61.1/test/form/samples/tree-shake-default-exports/_expected/system.js000066400000000000000000000020211415504077600275060ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/tree-shake-default-exports/_expected/umd.js000066400000000000000000000017561415504077600267650ustar00rootroot00000000000000(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-2.61.1/test/form/samples/tree-shake-default-exports/main.js000066400000000000000000000006211415504077600251520ustar00rootroot00000000000000import './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-2.61.1/test/form/samples/tree-shake-default-exports/unused.js000066400000000000000000000001351415504077600255310ustar00rootroot00000000000000/* header 1 */ /* leading removed */ export default 43; // trailing removed /* footer 1 */ rollup-2.61.1/test/form/samples/tree-shake-default-exports/unusedFunction.js000066400000000000000000000002041415504077600272340ustar00rootroot00000000000000/* header 2 */ /* leading removed */ export default function () { console.log( 'unused' ); }; // trailing removed /* footer 2 */ rollup-2.61.1/test/form/samples/tree-shake-default-exports/unusedSideEffect.js000066400000000000000000000002151415504077600274520ustar00rootroot00000000000000/* header 3 */ /* leading retained */ export default /*#__KEEP__*/ console.log( 'side-effect' ) || 43; // trailing retained /* footer 3 */ rollup-2.61.1/test/form/samples/tree-shake-default-exports/unusedSideEffectObject1.js000066400000000000000000000002131415504077600306600ustar00rootroot00000000000000/* header 7 */ /* leading retained */ export default { effect: console.log( 'side-effect' ) || 43 } // trailing retained /* footer 7 */ rollup-2.61.1/test/form/samples/tree-shake-default-exports/unusedSideEffectObject2.js000066400000000000000000000002141415504077600306620ustar00rootroot00000000000000/* header 8 */ /* leading retained */ export default { effect: console.log( 'side-effect' ) || 43 }; // trailing retained /* footer 8 */ rollup-2.61.1/test/form/samples/tree-shake-default-exports/used.js000066400000000000000000000001371415504077600251700ustar00rootroot00000000000000/* header 4 */ /* leading retained */ export default 42; // trailing retained /* footer 4 */ rollup-2.61.1/test/form/samples/tree-shake-default-exports/usedFunction.js000066400000000000000000000002371415504077600266770ustar00rootroot00000000000000/* header 5 */ /* leading retained */ export /* default */ // default default function () { console.log( 'unnamed' ); } // trailing retained /* footer 5 */ rollup-2.61.1/test/form/samples/tree-shake-default-exports/usedNamedFunction.js000066400000000000000000000002261415504077600276420ustar00rootroot00000000000000/* header 6 */ /* leading retained */ export default function usedNamedFunction () { console.log( 'named' ); } // trailing retained /* footer 6 */ rollup-2.61.1/test/form/samples/tree-shake-if-statements/000077500000000000000000000000001415504077600233265ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/tree-shake-if-statements/_config.js000066400000000000000000000001461415504077600252710ustar00rootroot00000000000000module.exports = { description: 'tree-shake if-statements with a condition that can be evaluated' }; rollup-2.61.1/test/form/samples/tree-shake-if-statements/_expected.js000066400000000000000000000010021415504077600256150ustar00rootroot00000000000000if (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-2.61.1/test/form/samples/tree-shake-if-statements/main.js000066400000000000000000000017661415504077600246220ustar00rootroot00000000000000if (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-2.61.1/test/form/samples/tree-shake-logical-expressions/000077500000000000000000000000001415504077600245355ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/tree-shake-logical-expressions/_config.js000066400000000000000000000001251415504077600264750ustar00rootroot00000000000000module.exports = { description: 'tree-shake unused parts of logical expressions' }; rollup-2.61.1/test/form/samples/tree-shake-logical-expressions/_expected/000077500000000000000000000000001415504077600264755ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/tree-shake-logical-expressions/_expected/amd.js000066400000000000000000000003471415504077600276000ustar00rootroot00000000000000define((function () { 'use strict'; function getStringA() { return 'A'; } console.log(getStringA()); console.log(false ); console.log(true ); function getStringD() { return 'D'; } console.log(getStringD()); })); rollup-2.61.1/test/form/samples/tree-shake-logical-expressions/_expected/cjs.js000066400000000000000000000003011415504077600276040ustar00rootroot00000000000000'use strict'; function getStringA() { return 'A'; } console.log(getStringA()); console.log(false ); console.log(true ); function getStringD() { return 'D'; } console.log(getStringD()); rollup-2.61.1/test/form/samples/tree-shake-logical-expressions/_expected/es.js000066400000000000000000000002621415504077600274420ustar00rootroot00000000000000function getStringA() { return 'A'; } console.log(getStringA()); console.log(false ); console.log(true ); function getStringD() { return 'D'; } console.log(getStringD()); rollup-2.61.1/test/form/samples/tree-shake-logical-expressions/_expected/iife.js000066400000000000000000000003421415504077600277460ustar00rootroot00000000000000(function () { 'use strict'; function getStringA() { return 'A'; } console.log(getStringA()); console.log(false ); console.log(true ); function getStringD() { return 'D'; } console.log(getStringD()); })(); rollup-2.61.1/test/form/samples/tree-shake-logical-expressions/_expected/system.js000066400000000000000000000004661415504077600303650ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/tree-shake-logical-expressions/_expected/umd.js000066400000000000000000000005051415504077600276200ustar00rootroot00000000000000(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-2.61.1/test/form/samples/tree-shake-logical-expressions/main.js000066400000000000000000000004611415504077600260200ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/tree-shake-pure-optional-chaining/000077500000000000000000000000001415504077600251175ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/tree-shake-pure-optional-chaining/_config.js000066400000000000000000000001431415504077600270570ustar00rootroot00000000000000module.exports = { description: 'tree-shake pure call expressions involving optional chaining' }; rollup-2.61.1/test/form/samples/tree-shake-pure-optional-chaining/_expected.js000066400000000000000000000000441415504077600274130ustar00rootroot00000000000000foo.bar(); foo?.bar(); foo.bar?.(); rollup-2.61.1/test/form/samples/tree-shake-pure-optional-chaining/main.js000066400000000000000000000001571415504077600264040ustar00rootroot00000000000000foo.bar(); foo?.bar(); foo.bar?.(); /*#__PURE__*/foo.bar(); /*#__PURE__*/foo?.bar(); /*#__PURE__*/foo.bar?.(); rollup-2.61.1/test/form/samples/treeshake-classes-with-fields/000077500000000000000000000000001415504077600243405ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/treeshake-classes-with-fields/_config.js000066400000000000000000000001231415504077600262760ustar00rootroot00000000000000module.exports = { description: 'treeshakes classes with class fields (#3564)' }; rollup-2.61.1/test/form/samples/treeshake-classes-with-fields/_expected.js000066400000000000000000000004321415504077600266350ustar00rootroot00000000000000class StaticFieldWithValueEffect { static field = console.log('retained') || 'field'; } class ComputedFieldWithKeyEffect { [console.log('retained') || 'field'] = 'retained'; } class StaticComputedFieldWithKeyEffect { static [console.log('retained') || 'field'] = 'retained'; } rollup-2.61.1/test/form/samples/treeshake-classes-with-fields/main.js000066400000000000000000000010241415504077600256170ustar00rootroot00000000000000class 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-2.61.1/test/form/samples/treeshake-excess-arguments/000077500000000000000000000000001415504077600237635ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/treeshake-excess-arguments/argument-side-effects/000077500000000000000000000000001415504077600301445ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/treeshake-excess-arguments/argument-side-effects/_config.js000066400000000000000000000001171415504077600321050ustar00rootroot00000000000000module.exports = { description: 'retains arguments that have side-effects' }; rollup-2.61.1/test/form/samples/treeshake-excess-arguments/argument-side-effects/_expected.js000066400000000000000000000002131415504077600324360ustar00rootroot00000000000000function sideEffects() { console.log('print message'); return true; } function hola(a, b) { console.log(a); } hola(1, sideEffects()); rollup-2.61.1/test/form/samples/treeshake-excess-arguments/argument-side-effects/main.js000066400000000000000000000002131415504077600314220ustar00rootroot00000000000000function sideEffects() { console.log('print message'); return true; } function hola(a, b) { console.log(a); } hola(1, sideEffects()); rollup-2.61.1/test/form/samples/treeshake-excess-arguments/arguments-variable/000077500000000000000000000000001415504077600275535ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/treeshake-excess-arguments/arguments-variable/_config.js000066400000000000000000000001571415504077600315200ustar00rootroot00000000000000module.exports = { description: 'does not remove arguments from call when arguments variables is accessed' }; rollup-2.61.1/test/form/samples/treeshake-excess-arguments/arguments-variable/_expected.js000066400000000000000000000004411415504077600320500ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/treeshake-excess-arguments/arguments-variable/main.js000066400000000000000000000004411415504077600310340ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/treeshake-excess-arguments/arrow-function-arguments/000077500000000000000000000000001415504077600307435ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/treeshake-excess-arguments/arrow-function-arguments/_config.js000066400000000000000000000001371415504077600327060ustar00rootroot00000000000000module.exports = { description: 'removes unneeded arguments from calls to arrow functions' }; rollup-2.61.1/test/form/samples/treeshake-excess-arguments/arrow-function-arguments/_expected.js000066400000000000000000000004751415504077600332470ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/treeshake-excess-arguments/arrow-function-arguments/main.js000066400000000000000000000006221415504077600322250ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/treeshake-excess-arguments/function-arguments/000077500000000000000000000000001415504077600276135ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/treeshake-excess-arguments/function-arguments/_config.js000066400000000000000000000001311415504077600315500ustar00rootroot00000000000000module.exports = { description: 'removes unneeded arguments from calls to functions' }; rollup-2.61.1/test/form/samples/treeshake-excess-arguments/function-arguments/_expected.js000066400000000000000000000012211415504077600321050ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/treeshake-excess-arguments/function-arguments/main.js000066400000000000000000000015171415504077600311010ustar00rootroot00000000000000function noParams() { console.log(); } function 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); 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-2.61.1/test/form/samples/treeshake-excess-arguments/namespace-members/000077500000000000000000000000001415504077600273475ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/treeshake-excess-arguments/namespace-members/_config.js000066400000000000000000000001371415504077600313120ustar00rootroot00000000000000module.exports = { description: 'removes unneeded arguments across namespace member calls' }; rollup-2.61.1/test/form/samples/treeshake-excess-arguments/namespace-members/_expected.js000066400000000000000000000003331415504077600316440ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/treeshake-excess-arguments/namespace-members/main.js000066400000000000000000000003421415504077600306300ustar00rootroot00000000000000import * 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-2.61.1/test/form/samples/treeshake-excess-arguments/namespace-members/namespace.js000066400000000000000000000001601415504077600316360ustar00rootroot00000000000000export const noParams = () => console.log(); export const someUsedParams = (p1, p2, p3) => console.log(p1, p3); rollup-2.61.1/test/form/samples/treeshake-excess-arguments/patterns/000077500000000000000000000000001415504077600256235ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/treeshake-excess-arguments/patterns/_config.js000066400000000000000000000001431415504077600275630ustar00rootroot00000000000000module.exports = { description: 'removes unneeded arguments from calls when patterns are used' }; rollup-2.61.1/test/form/samples/treeshake-excess-arguments/patterns/_expected.js000066400000000000000000000002121415504077600301140ustar00rootroot00000000000000function usePatterns([a, b, ...c], d) { console.log(a, b, c, d); } const needed1 = 1; const needed2 = 2; usePatterns(needed1, needed2); rollup-2.61.1/test/form/samples/treeshake-excess-arguments/patterns/main.js000066400000000000000000000002501415504077600271020ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/treeshake-excess-arguments/rest-element/000077500000000000000000000000001415504077600263675ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/treeshake-excess-arguments/rest-element/_config.js000066400000000000000000000001511415504077600303260ustar00rootroot00000000000000module.exports = { description: 'does not remove arguments from calls when rest parameters are used' }; rollup-2.61.1/test/form/samples/treeshake-excess-arguments/rest-element/_expected.js000066400000000000000000000004611415504077600306660ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/treeshake-excess-arguments/rest-element/main.js000066400000000000000000000004611415504077600276520ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/treeshake-excess-arguments/unused-parameters/000077500000000000000000000000001415504077600274275ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/treeshake-excess-arguments/unused-parameters/_config.js000066400000000000000000000001351415504077600313700ustar00rootroot00000000000000module.exports = { description: 'removes arguments that correspond to unused parameters' }; rollup-2.61.1/test/form/samples/treeshake-excess-arguments/unused-parameters/_expected.js000066400000000000000000000004321415504077600317240ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/treeshake-excess-arguments/unused-parameters/main.js000066400000000000000000000005611415504077600307130ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/treeshake-import-meta-props/000077500000000000000000000000001415504077600240655ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/treeshake-import-meta-props/_config.js000066400000000000000000000001511415504077600260240ustar00rootroot00000000000000module.exports = { description: 'also does not include format globals when tree-shaking import meta' }; rollup-2.61.1/test/form/samples/treeshake-import-meta-props/_expected/000077500000000000000000000000001415504077600260255ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/treeshake-import-meta-props/_expected/amd.js000066400000000000000000000001011415504077600271140ustar00rootroot00000000000000define((function () { 'use strict'; console.log('main'); })); rollup-2.61.1/test/form/samples/treeshake-import-meta-props/_expected/cjs.js000066400000000000000000000000441415504077600271400ustar00rootroot00000000000000'use strict'; console.log('main'); rollup-2.61.1/test/form/samples/treeshake-import-meta-props/_expected/es.js000066400000000000000000000000251415504077600267670ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/form/samples/treeshake-import-meta-props/_expected/iife.js000066400000000000000000000000741415504077600273000ustar00rootroot00000000000000(function () { 'use strict'; console.log('main'); })(); rollup-2.61.1/test/form/samples/treeshake-import-meta-props/_expected/system.js000066400000000000000000000001761415504077600277130ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { console.log('main'); }) }; })); rollup-2.61.1/test/form/samples/treeshake-import-meta-props/_expected/umd.js000066400000000000000000000002371415504077600271520ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; console.log('main'); })); rollup-2.61.1/test/form/samples/treeshake-import-meta-props/main.js000066400000000000000000000001731415504077600253500ustar00rootroot00000000000000const removed1 = import.meta; const removed2 = import.meta.url; const removed3 = import.meta.unknown; console.log('main'); rollup-2.61.1/test/form/samples/treeshake-import-meta/000077500000000000000000000000001415504077600227245ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/treeshake-import-meta/_config.js000066400000000000000000000001201415504077600246570ustar00rootroot00000000000000module.exports = { description: 'supports tree-shaking for meta properties' }; rollup-2.61.1/test/form/samples/treeshake-import-meta/_expected.js000066400000000000000000000000211415504077600252130ustar00rootroot00000000000000import.meta.a.b; rollup-2.61.1/test/form/samples/treeshake-import-meta/main.js000066400000000000000000000002101415504077600241770ustar00rootroot00000000000000const removed1 = import.meta; const removed2 = import.meta.url; const removed3 = import.meta.unknown; const retained = import.meta.a.b; rollup-2.61.1/test/form/samples/treeshake-json/000077500000000000000000000000001415504077600214375ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/treeshake-json/_config.js000066400000000000000000000002171415504077600234010ustar00rootroot00000000000000const json = require('@rollup/plugin-json'); module.exports = { description: 'removes unusued json keys', options: { plugins: [json()] } }; rollup-2.61.1/test/form/samples/treeshake-json/_expected.js000066400000000000000000000000401415504077600237270ustar00rootroot00000000000000{ console.log('production'); } rollup-2.61.1/test/form/samples/treeshake-json/config.json000066400000000000000000000001321415504077600235730ustar00rootroot00000000000000{ "unused": "unused string", "production": true, "nested": { "specialConfig": 1 } } rollup-2.61.1/test/form/samples/treeshake-json/main.js000066400000000000000000000003111415504077600227140ustar00rootroot00000000000000import { production, nested } from './config.json'; if (production) { console.log('production'); } else { console.log('development'); } if (nested.specialConfig !== 1) { console.log('removed'); } rollup-2.61.1/test/form/samples/treeshake-namespace-access/000077500000000000000000000000001415504077600236615ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/treeshake-namespace-access/_config.js000066400000000000000000000002021415504077600256150ustar00rootroot00000000000000module.exports = { description: 'does not count namespace property access as side-effect', options: { external: 'external' } }; rollup-2.61.1/test/form/samples/treeshake-namespace-access/_expected/000077500000000000000000000000001415504077600256215ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/treeshake-namespace-access/_expected/amd.js000066400000000000000000000001271415504077600267200ustar00rootroot00000000000000define(['external'], (function (external) { 'use strict'; console.log('main'); })); rollup-2.61.1/test/form/samples/treeshake-namespace-access/_expected/cjs.js000066400000000000000000000000721415504077600267350ustar00rootroot00000000000000'use strict'; require('external'); console.log('main'); rollup-2.61.1/test/form/samples/treeshake-namespace-access/_expected/es.js000066400000000000000000000000511415504077600265620ustar00rootroot00000000000000import 'external'; console.log('main'); rollup-2.61.1/test/form/samples/treeshake-namespace-access/_expected/iife.js000066400000000000000000000000741415504077600270740ustar00rootroot00000000000000(function () { 'use strict'; console.log('main'); })(); rollup-2.61.1/test/form/samples/treeshake-namespace-access/_expected/system.js000066400000000000000000000002451415504077600275040ustar00rootroot00000000000000System.register(['external'], (function () { 'use strict'; return { setters: [function () {}], execute: (function () { console.log('main'); }) }; })); rollup-2.61.1/test/form/samples/treeshake-namespace-access/_expected/umd.js000066400000000000000000000002551415504077600267460ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(['external'], factory) : factory(); })((function () { 'use strict'; console.log('main'); })); rollup-2.61.1/test/form/samples/treeshake-namespace-access/main.js000066400000000000000000000001311415504077600251360ustar00rootroot00000000000000import * as external from 'external'; const unused = external.foo; console.log('main'); rollup-2.61.1/test/form/samples/treeshake-presets/000077500000000000000000000000001415504077600221535ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/treeshake-presets/preset-with-override/000077500000000000000000000000001415504077600262435ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/treeshake-presets/preset-with-override/_config.js000066400000000000000000000013331415504077600302050ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { description: 'allows using the "preset" option with overrides', options: { treeshake: { preset: 'smallest', unknownGlobalSideEffects: true }, plugins: [ { buildStart(options) { 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 ); } } ] } }; rollup-2.61.1/test/form/samples/treeshake-presets/preset-with-override/_expected.js000066400000000000000000000002631415504077600305420ustar00rootroot00000000000000console.log('main'); unknownGlobal; let flag = true; function test() { if (flag) var x = true; if (x) { return; } console.log('effect'); } test(); flag = false; test(); rollup-2.61.1/test/form/samples/treeshake-presets/preset-with-override/dep.js000066400000000000000000000000241415504077600273450ustar00rootroot00000000000000console.log('dep'); rollup-2.61.1/test/form/samples/treeshake-presets/preset-with-override/main.js000066400000000000000000000004431415504077600275260ustar00rootroot00000000000000import './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-2.61.1/test/form/samples/treeshake-presets/recommended/000077500000000000000000000000001415504077600244355ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/treeshake-presets/recommended/_config.js000066400000000000000000000012371415504077600264020ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { description: 'handles treeshake preset "recommended"', options: { treeshake: 'recommended', plugins: [ { buildStart(options) { 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')), true ); } } ] } }; rollup-2.61.1/test/form/samples/treeshake-presets/recommended/_expected.js000066400000000000000000000004241415504077600267330ustar00rootroot00000000000000console.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-2.61.1/test/form/samples/treeshake-presets/recommended/dep.js000066400000000000000000000000241415504077600255370ustar00rootroot00000000000000console.log('dep'); rollup-2.61.1/test/form/samples/treeshake-presets/recommended/main.js000066400000000000000000000004431415504077600257200ustar00rootroot00000000000000import './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-2.61.1/test/form/samples/treeshake-presets/safest/000077500000000000000000000000001415504077600234405ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/treeshake-presets/safest/_config.js000066400000000000000000000012231415504077600254000ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { description: 'handles treeshake preset "safest"', options: { treeshake: 'safest', plugins: [ { buildStart(options) { 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')), true ); } } ] } }; rollup-2.61.1/test/form/samples/treeshake-presets/safest/_expected.js000066400000000000000000000004441415504077600257400ustar00rootroot00000000000000console.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-2.61.1/test/form/samples/treeshake-presets/safest/dep.js000066400000000000000000000000241415504077600245420ustar00rootroot00000000000000console.log('dep'); rollup-2.61.1/test/form/samples/treeshake-presets/safest/main.js000066400000000000000000000004431415504077600247230ustar00rootroot00000000000000import './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-2.61.1/test/form/samples/treeshake-presets/smallest/000077500000000000000000000000001415504077600237775ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/treeshake-presets/smallest/_config.js000066400000000000000000000012341415504077600257410ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { description: 'handles treeshake preset "smallest"', options: { treeshake: 'smallest', plugins: [ { buildStart(options) { 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 ); } } ] } }; rollup-2.61.1/test/form/samples/treeshake-presets/smallest/_expected.js000066400000000000000000000002431415504077600262740ustar00rootroot00000000000000console.log('main'); let flag = true; function test() { if (flag) var x = true; if (x) { return; } console.log('effect'); } test(); flag = false; test(); rollup-2.61.1/test/form/samples/treeshake-presets/smallest/dep.js000066400000000000000000000000241415504077600251010ustar00rootroot00000000000000console.log('dep'); rollup-2.61.1/test/form/samples/treeshake-presets/smallest/main.js000066400000000000000000000004431415504077600252620ustar00rootroot00000000000000import './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-2.61.1/test/form/samples/treeshake-presets/true/000077500000000000000000000000001415504077600231325ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/treeshake-presets/true/_config.js000066400000000000000000000012141415504077600250720ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { description: 'handles treeshake preset true', options: { treeshake: true, plugins: [ { buildStart(options) { 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')), true ); } } ] } }; rollup-2.61.1/test/form/samples/treeshake-presets/true/_expected.js000066400000000000000000000004441415504077600254320ustar00rootroot00000000000000console.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-2.61.1/test/form/samples/treeshake-presets/true/dep.js000066400000000000000000000000241415504077600242340ustar00rootroot00000000000000console.log('dep'); rollup-2.61.1/test/form/samples/treeshake-presets/true/main.js000066400000000000000000000004431415504077600244150ustar00rootroot00000000000000import './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-2.61.1/test/form/samples/treeshake-sequence-expressions/000077500000000000000000000000001415504077600246565ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/treeshake-sequence-expressions/_config.js000066400000000000000000000001501415504077600266140ustar00rootroot00000000000000module.exports = { description: 'removes the last element of a sequence expression if it is unused' }; rollup-2.61.1/test/form/samples/treeshake-sequence-expressions/_expected.js000066400000000000000000000001371415504077600271550ustar00rootroot00000000000000console.log(1); console.log(2); console.log(3); const x = (console.log(2), 3); console.log(x); rollup-2.61.1/test/form/samples/treeshake-sequence-expressions/main.js000066400000000000000000000001751415504077600261430ustar00rootroot000000000000001, 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-2.61.1/test/form/samples/try-statement-deoptimization/000077500000000000000000000000001415504077600243725ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/try-statement-deoptimization/deactivate-via-option/000077500000000000000000000000001415504077600305665ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/try-statement-deoptimization/deactivate-via-option/_config.js000066400000000000000000000002321415504077600325250ustar00rootroot00000000000000module.exports = { description: 'deactivates try-catch-deoptimization via option', options: { treeshake: { tryCatchDeoptimization: false } } }; rollup-2.61.1/test/form/samples/try-statement-deoptimization/deactivate-via-option/_expected.js000066400000000000000000000003421415504077600330630ustar00rootroot00000000000000function mutate(foo) { foo.bar = 1; } const mutated = {}; function test(callback) { try { callback(); mutate(mutated); } catch {} } test(() => { }); try {} finally { console.log('retained'); } export { mutated }; rollup-2.61.1/test/form/samples/try-statement-deoptimization/deactivate-via-option/main.js000066400000000000000000000005741415504077600320560ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/try-statement-deoptimization/direct-inclusion/000077500000000000000000000000001415504077600276455ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/try-statement-deoptimization/direct-inclusion/_config.js000066400000000000000000000001341415504077600316050ustar00rootroot00000000000000module.exports = { description: 'retains side-effect-free code in try-statement-blocks' }; rollup-2.61.1/test/form/samples/try-statement-deoptimization/direct-inclusion/_expected.js000066400000000000000000000002201415504077600321350ustar00rootroot00000000000000try {} catch {} finally { console.log('retained'); } // this will be retained try { Object.create(null); // this will be retained } catch {} rollup-2.61.1/test/form/samples/try-statement-deoptimization/direct-inclusion/main.js000066400000000000000000000005431415504077600311310ustar00rootroot00000000000000Object.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-2.61.1/test/form/samples/try-statement-deoptimization/follow-parameters/000077500000000000000000000000001415504077600300355ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/try-statement-deoptimization/follow-parameters/_config.js000066400000000000000000000001631415504077600317770ustar00rootroot00000000000000module.exports = { description: 'retains side-effect-free code in parameters called from try-statement-blocks' }; rollup-2.61.1/test/form/samples/try-statement-deoptimization/follow-parameters/_expected.js000066400000000000000000000003231415504077600323310ustar00rootroot00000000000000function properlyTreeshaken() { } function tryIt(other, callback) { try { callback(); } catch {} } tryIt(properlyTreeshaken, properlyTreeshaken); tryIt( () => { }, () => { Object.create(null); } ); rollup-2.61.1/test/form/samples/try-statement-deoptimization/follow-parameters/main.js000066400000000000000000000004001415504077600313110ustar00rootroot00000000000000function properlyTreeshaken() { Object.create(null); } function tryIt(other, callback) { try { callback(); } catch {} } tryIt(properlyTreeshaken, properlyTreeshaken); tryIt( () => { Object.create(null); }, () => { Object.create(null); } ); rollup-2.61.1/test/form/samples/try-statement-deoptimization/follow-pattern-parameters/000077500000000000000000000000001415504077600315105ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/try-statement-deoptimization/follow-pattern-parameters/_config.js000066400000000000000000000001751415504077600334550ustar00rootroot00000000000000module.exports = { description: 'retains side-effect-free code in pattern parameters called from try-statement-blocks' }; rollup-2.61.1/test/form/samples/try-statement-deoptimization/follow-pattern-parameters/_expected.js000066400000000000000000000003111415504077600340010ustar00rootroot00000000000000function properlyTreeshaken() { } function tryIt({ callback }) { try { callback(); } catch {} } tryIt({ callback: properlyTreeshaken }); tryIt({ callback: () => { Object.create(null); } }); rollup-2.61.1/test/form/samples/try-statement-deoptimization/follow-pattern-parameters/main.js000066400000000000000000000003371415504077600327750ustar00rootroot00000000000000function properlyTreeshaken() { Object.create(null); } function tryIt({ callback }) { try { callback(); } catch {} } tryIt({ callback: properlyTreeshaken }); tryIt({ callback: () => { Object.create(null); } }); rollup-2.61.1/test/form/samples/try-statement-deoptimization/follow-variables/000077500000000000000000000000001415504077600276425ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/try-statement-deoptimization/follow-variables/_config.js000066400000000000000000000001721415504077600316040ustar00rootroot00000000000000module.exports = { description: 'does not retain side-effect-free code in functions called from try-statement-blocks' }; rollup-2.61.1/test/form/samples/try-statement-deoptimization/follow-variables/_expected.js000066400000000000000000000001131415504077600321330ustar00rootroot00000000000000function properlyTreeshaken() { } try { properlyTreeshaken(); } catch {} rollup-2.61.1/test/form/samples/try-statement-deoptimization/follow-variables/main.js000066400000000000000000000001411415504077600311200ustar00rootroot00000000000000function properlyTreeshaken() { Object.create(null); } try { properlyTreeshaken(); } catch {} rollup-2.61.1/test/form/samples/try-statement-deoptimization/include-via-outside-variable/000077500000000000000000000000001415504077600320275ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/try-statement-deoptimization/include-via-outside-variable/_config.js000066400000000000000000000001471415504077600337730ustar00rootroot00000000000000module.exports = { description: 'works when the try-statement is included via an outside variable' }; _expected.js000066400000000000000000000001131415504077600342410ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/try-statement-deoptimization/include-via-outside-variableconsole.log(myVar); try { var myVar = 3; console.log(myVar); } catch {} rollup-2.61.1/test/form/samples/try-statement-deoptimization/include-via-outside-variable/main.js000066400000000000000000000001131415504077600333040ustar00rootroot00000000000000console.log(myVar); try { var myVar = 3; console.log(myVar); } catch {} rollup-2.61.1/test/form/samples/try-statement-deoptimization/supports-core-js/000077500000000000000000000000001415504077600276315ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/try-statement-deoptimization/supports-core-js/_config.js000066400000000000000000000001211415504077600315650ustar00rootroot00000000000000module.exports = { description: 'supports core-js feature detection (#2869)' }; rollup-2.61.1/test/form/samples/try-statement-deoptimization/supports-core-js/_expected.js000066400000000000000000000003741415504077600321330ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/try-statement-deoptimization/supports-core-js/main.js000066400000000000000000000003741415504077600311170ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/typeof-side-effect/000077500000000000000000000000001415504077600221775ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/typeof-side-effect/_config.js000066400000000000000000000001331415504077600241360ustar00rootroot00000000000000module.exports = { description: 'using typeof is does not trigger global side-effects' }; rollup-2.61.1/test/form/samples/typeof-side-effect/_expected.js000066400000000000000000000000641415504077600244750ustar00rootroot00000000000000if (typeof unknownValue.property !== 'undefined') ; rollup-2.61.1/test/form/samples/typeof-side-effect/main.js000066400000000000000000000002031415504077600234540ustar00rootroot00000000000000if (typeof unknownValue !== 'undefined') { /* removed */ } if (typeof unknownValue.property !== 'undefined') { /* retained */ } rollup-2.61.1/test/form/samples/umd-noconflict-extend/000077500000000000000000000000001415504077600227235ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/umd-noconflict-extend/_config.js000066400000000000000000000002671415504077600246720ustar00rootroot00000000000000module.exports = { description: 'exports noConflict method for default umd when requested', options: { output: { extend: true, noConflict: true, name: 'FooBar' } } }; rollup-2.61.1/test/form/samples/umd-noconflict-extend/_expected/000077500000000000000000000000001415504077600246635ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/umd-noconflict-extend/_expected/amd.js000066400000000000000000000004761415504077600257710ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/umd-noconflict-extend/_expected/cjs.js000066400000000000000000000004051415504077600257770ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function doThings() { console.log( 'doing things...' ); } const number = 42; var setting = 'no'; exports.doThings = doThings; exports.number = number; exports.setting = setting; rollup-2.61.1/test/form/samples/umd-noconflict-extend/_expected/es.js000066400000000000000000000002131415504077600256240ustar00rootroot00000000000000function doThings() { console.log( 'doing things...' ); } const number = 42; var setting = 'no'; export { doThings, number, setting }; rollup-2.61.1/test/form/samples/umd-noconflict-extend/_expected/iife.js000066400000000000000000000005131415504077600261340ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })(this.FooBar = this.FooBar || {}); rollup-2.61.1/test/form/samples/umd-noconflict-extend/_expected/system.js000066400000000000000000000004641415504077600265510ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/umd-noconflict-extend/_expected/umd.js000066400000000000000000000014151415504077600260070ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/umd-noconflict-extend/main.js000066400000000000000000000001711415504077600242040ustar00rootroot00000000000000export function doThings() { console.log( 'doing things...' ); } export const number = 42; export var setting = 'no'; rollup-2.61.1/test/form/samples/umd-noconflict-namespaced/000077500000000000000000000000001415504077600235345ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/umd-noconflict-namespaced/_config.js000066400000000000000000000002651415504077600255010ustar00rootroot00000000000000module.exports = { description: 'exports noConflict method for default umd when requested', options: { output: { noConflict: true, name: 'my.name.spaced.module' } } }; rollup-2.61.1/test/form/samples/umd-noconflict-namespaced/_expected/000077500000000000000000000000001415504077600254745ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/umd-noconflict-namespaced/_expected/amd.js000066400000000000000000000004761415504077600266020ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/umd-noconflict-namespaced/_expected/cjs.js000066400000000000000000000004051415504077600266100ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function doThings() { console.log( 'doing things...' ); } const number = 42; var setting = 'no'; exports.doThings = doThings; exports.number = number; exports.setting = setting; rollup-2.61.1/test/form/samples/umd-noconflict-namespaced/_expected/es.js000066400000000000000000000002131415504077600264350ustar00rootroot00000000000000function doThings() { console.log( 'doing things...' ); } const number = 42; var setting = 'no'; export { doThings, number, setting }; rollup-2.61.1/test/form/samples/umd-noconflict-namespaced/_expected/iife.js000066400000000000000000000007121415504077600267460ustar00rootroot00000000000000this.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; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/umd-noconflict-namespaced/_expected/system.js000066400000000000000000000005031415504077600273540ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/umd-noconflict-namespaced/_expected/umd.js000066400000000000000000000017341415504077600266240ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/umd-noconflict-namespaced/main.js000066400000000000000000000001711415504077600250150ustar00rootroot00000000000000export function doThings() { console.log( 'doing things...' ); } export const number = 42; export var setting = 'no'; rollup-2.61.1/test/form/samples/umd-noconflict-no-exports/000077500000000000000000000000001415504077600235525ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/umd-noconflict-no-exports/_config.js000066400000000000000000000002371415504077600255160ustar00rootroot00000000000000module.exports = { description: 'exports noConflict even when there are no exports', options: { output: { noConflict: true, name: 'FooBar' } } }; rollup-2.61.1/test/form/samples/umd-noconflict-no-exports/_expected/000077500000000000000000000000001415504077600255125ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/umd-noconflict-no-exports/_expected/amd.js000066400000000000000000000001071415504077600266070ustar00rootroot00000000000000define((function () { 'use strict'; console.log('no exports'); })); rollup-2.61.1/test/form/samples/umd-noconflict-no-exports/_expected/cjs.js000066400000000000000000000000521415504077600266240ustar00rootroot00000000000000'use strict'; console.log('no exports'); rollup-2.61.1/test/form/samples/umd-noconflict-no-exports/_expected/es.js000066400000000000000000000000331415504077600264530ustar00rootroot00000000000000console.log('no exports'); rollup-2.61.1/test/form/samples/umd-noconflict-no-exports/_expected/iife.js000066400000000000000000000001021415504077600267550ustar00rootroot00000000000000(function () { 'use strict'; console.log('no exports'); })(); rollup-2.61.1/test/form/samples/umd-noconflict-no-exports/_expected/system.js000066400000000000000000000002161415504077600273730ustar00rootroot00000000000000System.register('FooBar', [], (function () { 'use strict'; return { execute: (function () { console.log('no exports'); }) }; })); rollup-2.61.1/test/form/samples/umd-noconflict-no-exports/_expected/umd.js000066400000000000000000000010311415504077600266300ustar00rootroot00000000000000(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-2.61.1/test/form/samples/umd-noconflict-no-exports/main.js000066400000000000000000000000331415504077600250300ustar00rootroot00000000000000console.log('no exports'); rollup-2.61.1/test/form/samples/umd-noconflict/000077500000000000000000000000001415504077600214365ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/umd-noconflict/_config.js000066400000000000000000000002461415504077600234020ustar00rootroot00000000000000module.exports = { description: 'exports noConflict method for default umd when requested', options: { output: { noConflict: true, name: 'FooBar' } } }; rollup-2.61.1/test/form/samples/umd-noconflict/_expected/000077500000000000000000000000001415504077600233765ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/umd-noconflict/_expected/amd.js000066400000000000000000000004761415504077600245040ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/umd-noconflict/_expected/cjs.js000066400000000000000000000004051415504077600245120ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function doThings() { console.log( 'doing things...' ); } const number = 42; var setting = 'no'; exports.doThings = doThings; exports.number = number; exports.setting = setting; rollup-2.61.1/test/form/samples/umd-noconflict/_expected/es.js000066400000000000000000000002131415504077600243370ustar00rootroot00000000000000function doThings() { console.log( 'doing things...' ); } const number = 42; var setting = 'no'; export { doThings, number, setting }; rollup-2.61.1/test/form/samples/umd-noconflict/_expected/iife.js000066400000000000000000000005151415504077600246510ustar00rootroot00000000000000var 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; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/umd-noconflict/_expected/system.js000066400000000000000000000004641415504077600252640ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/umd-noconflict/_expected/umd.js000066400000000000000000000013741415504077600245260ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/umd-noconflict/main.js000066400000000000000000000001711415504077600227170ustar00rootroot00000000000000export function doThings() { console.log( 'doing things...' ); } export const number = 42; export var setting = 'no'; rollup-2.61.1/test/form/samples/unary-expressions/000077500000000000000000000000001415504077600222335ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/unary-expressions/_config.js000066400000000000000000000001141415504077600241710ustar00rootroot00000000000000module.exports = { description: 'handles unary expression side-effects' }; rollup-2.61.1/test/form/samples/unary-expressions/_expected.js000066400000000000000000000004421415504077600245310ustar00rootroot00000000000000if ((!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-2.61.1/test/form/samples/unary-expressions/main.js000066400000000000000000000006241415504077600235170ustar00rootroot00000000000000if ((!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-2.61.1/test/form/samples/undefined-default-export/000077500000000000000000000000001415504077600234175ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/undefined-default-export/_config.js000066400000000000000000000001121415504077600253530ustar00rootroot00000000000000module.exports = { description: 'handles default exporting undefined' }; rollup-2.61.1/test/form/samples/undefined-default-export/_expected.js000066400000000000000000000000711415504077600257130ustar00rootroot00000000000000var dep = undefined; console.log(dep); export { dep }; rollup-2.61.1/test/form/samples/undefined-default-export/dep.js000066400000000000000000000000321415504077600245200ustar00rootroot00000000000000export default undefined; rollup-2.61.1/test/form/samples/undefined-default-export/main.js000066400000000000000000000000761415504077600247040ustar00rootroot00000000000000import dep from './dep.js'; console.log(dep); export { dep }; rollup-2.61.1/test/form/samples/undefined-properties/000077500000000000000000000000001415504077600226505ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/undefined-properties/_config.js000066400000000000000000000001031415504077600246040ustar00rootroot00000000000000module.exports = { description: 'detects undefined properties' }; rollup-2.61.1/test/form/samples/undefined-properties/_expected.js000066400000000000000000000002221415504077600251420ustar00rootroot00000000000000var a = { b: { c: 'd' } }; console.log('retained'); if (a.c.d) console.log('retained for effect'); else console.log('retained for effect'); rollup-2.61.1/test/form/samples/undefined-properties/main.js000066400000000000000000000002711415504077600241320ustar00rootroot00000000000000var a = { b: { c: 'd' } }; if (a.b.d) console.log('removed'); else console.log('retained'); if (a.c.d) console.log('retained for effect'); else console.log('retained for effect');rollup-2.61.1/test/form/samples/undefined-var/000077500000000000000000000000001415504077600212445ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/undefined-var/_config.js000066400000000000000000000001151415504077600232030ustar00rootroot00000000000000module.exports = { description: 'treeshakes undefined variable literals' }; rollup-2.61.1/test/form/samples/undefined-var/_expected.js000066400000000000000000000002021415504077600235340ustar00rootroot00000000000000var z; console.log('retained'); console.log('retained'); if (z) console.log('retained'); else console.log('retained'); z = 1; rollup-2.61.1/test/form/samples/undefined-var/main.js000066400000000000000000000003441415504077600225270ustar00rootroot00000000000000var 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-2.61.1/test/form/samples/unknown-token-effects/000077500000000000000000000000001415504077600227475ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/unknown-token-effects/_config.js000066400000000000000000000007121415504077600247110ustar00rootroot00000000000000module.exports = { description: 'does not tree-shake unknown tokens', options: { acornInjectPlugins: Parser => class extends Parser { parseExprAtom(refDestructuringErrors) { 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(refDestructuringErrors); } } } }; rollup-2.61.1/test/form/samples/unknown-token-effects/_expected.js000066400000000000000000000010351415504077600252440ustar00rootroot00000000000000(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-2.61.1/test/form/samples/unknown-token-effects/main.js000066400000000000000000000010141415504077600242250ustar00rootroot00000000000000(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-2.61.1/test/form/samples/unmodified-default-exports-function-argument/000077500000000000000000000000001415504077600274275ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/unmodified-default-exports-function-argument/_config.js000066400000000000000000000001421415504077600313660ustar00rootroot00000000000000module.exports = { description: 'passing unbound default export to function cannot rebind it' }; rollup-2.61.1/test/form/samples/unmodified-default-exports-function-argument/_expected.js000066400000000000000000000002211415504077600317200ustar00rootroot00000000000000var foo = function () { return 42; }; function bar () { return contrivedExample( foo ); } var answer = foo(); bar(); console.log( answer ); rollup-2.61.1/test/form/samples/unmodified-default-exports-function-argument/foo.js000066400000000000000000000001711415504077600305470ustar00rootroot00000000000000var foo = function () { return 42; }; export default foo; export function bar () { return contrivedExample( foo ); } rollup-2.61.1/test/form/samples/unmodified-default-exports-function-argument/main.js000066400000000000000000000001521415504077600307070ustar00rootroot00000000000000import foo, { bar } from './foo'; var answer = foo(); var somethingElse = bar(); console.log( answer ); rollup-2.61.1/test/form/samples/unmodified-default-exports/000077500000000000000000000000001415504077600237645ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/unmodified-default-exports/_config.js000066400000000000000000000001721415504077600257260ustar00rootroot00000000000000module.exports = { description: 'does not treat property assignment as rebinding for sake of unbound default exports' }; rollup-2.61.1/test/form/samples/unmodified-default-exports/_expected.js000066400000000000000000000002271415504077600262630ustar00rootroot00000000000000var Foo = function () { console.log( 'side effect' ); this.isFoo = true; }; Foo.prototype = { answer: function () { return 42; } }; new Foo(); rollup-2.61.1/test/form/samples/unmodified-default-exports/foo.js000066400000000000000000000002401415504077600251010ustar00rootroot00000000000000var Foo = function () { console.log( 'side effect' ); this.isFoo = true; }; export default Foo; Foo.prototype = { answer: function () { return 42; } }; rollup-2.61.1/test/form/samples/unmodified-default-exports/main.js000066400000000000000000000000571415504077600252500ustar00rootroot00000000000000import Foo from './foo'; var foo = new Foo(); rollup-2.61.1/test/form/samples/unused-called-import/000077500000000000000000000000001415504077600225525ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/unused-called-import/_config.js000066400000000000000000000001241415504077600245110ustar00rootroot00000000000000module.exports = { description: 'does not include called-in-unused-code import' }; rollup-2.61.1/test/form/samples/unused-called-import/_expected/000077500000000000000000000000001415504077600245125ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/unused-called-import/_expected/amd.js000066400000000000000000000001551415504077600256120ustar00rootroot00000000000000define((function () { 'use strict'; function foo() { return 'foo'; } assert.equal( foo(), 'foo' ); })); rollup-2.61.1/test/form/samples/unused-called-import/_expected/cjs.js000066400000000000000000000001171415504077600256260ustar00rootroot00000000000000'use strict'; function foo() { return 'foo'; } assert.equal( foo(), 'foo' ); rollup-2.61.1/test/form/samples/unused-called-import/_expected/es.js000066400000000000000000000001001415504077600254460ustar00rootroot00000000000000function foo() { return 'foo'; } assert.equal( foo(), 'foo' ); rollup-2.61.1/test/form/samples/unused-called-import/_expected/iife.js000066400000000000000000000001501415504077600257600ustar00rootroot00000000000000(function () { 'use strict'; function foo() { return 'foo'; } assert.equal( foo(), 'foo' ); })(); rollup-2.61.1/test/form/samples/unused-called-import/_expected/system.js000066400000000000000000000002541415504077600263750ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function foo() { return 'foo'; } assert.equal( foo(), 'foo' ); }) }; })); rollup-2.61.1/test/form/samples/unused-called-import/_expected/umd.js000066400000000000000000000003131415504077600256320ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function foo() { return 'foo'; } assert.equal( foo(), 'foo' ); })); rollup-2.61.1/test/form/samples/unused-called-import/dead.js000066400000000000000000000000551415504077600240050ustar00rootroot00000000000000export default function() { return 'dead'; } rollup-2.61.1/test/form/samples/unused-called-import/foo.js000066400000000000000000000001761415504077600236770ustar00rootroot00000000000000import dead from './dead'; export default function() { return 'foo'; } export function foodead() { return 'foo' + dead(); } rollup-2.61.1/test/form/samples/unused-called-import/main.js000066400000000000000000000000671415504077600240370ustar00rootroot00000000000000import foo from './foo'; assert.equal( foo(), 'foo' ); rollup-2.61.1/test/form/samples/unused-called-with-side-effects/000077500000000000000000000000001415504077600245525ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/unused-called-with-side-effects/_config.js000066400000000000000000000001241415504077600265110ustar00rootroot00000000000000module.exports = { description: 'does not include called-in-unused-code import' }; rollup-2.61.1/test/form/samples/unused-called-with-side-effects/_expected/000077500000000000000000000000001415504077600265125ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/unused-called-with-side-effects/_expected/amd.js000066400000000000000000000001641415504077600276120ustar00rootroot00000000000000define((function () { 'use strict'; function foo() { return 'foo' } assert.equal( foo(), 'foo' ); })); rollup-2.61.1/test/form/samples/unused-called-with-side-effects/_expected/cjs.js000066400000000000000000000001201415504077600276200ustar00rootroot00000000000000'use strict'; function foo() { return 'foo' } assert.equal( foo(), 'foo' ); rollup-2.61.1/test/form/samples/unused-called-with-side-effects/_expected/es.js000066400000000000000000000001011415504077600274470ustar00rootroot00000000000000function foo() { return 'foo' } assert.equal( foo(), 'foo' ); rollup-2.61.1/test/form/samples/unused-called-with-side-effects/_expected/iife.js000066400000000000000000000001601415504077600277610ustar00rootroot00000000000000(function () { 'use strict'; function foo() { return 'foo' } assert.equal( foo(), 'foo' ); })(); rollup-2.61.1/test/form/samples/unused-called-with-side-effects/_expected/system.js000066400000000000000000000003061415504077600303730ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function foo() { return 'foo' } assert.equal( foo(), 'foo' ); }) }; })); rollup-2.61.1/test/form/samples/unused-called-with-side-effects/_expected/umd.js000066400000000000000000000003241415504077600276340ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function foo() { return 'foo' } assert.equal( foo(), 'foo' ); })); rollup-2.61.1/test/form/samples/unused-called-with-side-effects/main.js000066400000000000000000000002131415504077600260300ustar00rootroot00000000000000function foo() { return 'foo' } function bar() { dead(); } function dead() { console.log('dead'); } assert.equal( foo(), 'foo' ); rollup-2.61.1/test/form/samples/unused-default-exports/000077500000000000000000000000001415504077600231445ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/unused-default-exports/_config.js000066400000000000000000000001271415504077600251060ustar00rootroot00000000000000module.exports = { description: 'does not name unused-but-included default export' }; rollup-2.61.1/test/form/samples/unused-default-exports/_expected/000077500000000000000000000000001415504077600251045ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/unused-default-exports/_expected/amd.js000066400000000000000000000002641415504077600262050ustar00rootroot00000000000000define((function () { 'use strict'; var foo = { value: 1 }; function mutate ( obj ) { obj.value += 1; return obj; } mutate( foo ); assert.equal( foo.value, 2 ); })); rollup-2.61.1/test/form/samples/unused-default-exports/_expected/cjs.js000066400000000000000000000002211415504077600262140ustar00rootroot00000000000000'use strict'; var foo = { value: 1 }; function mutate ( obj ) { obj.value += 1; return obj; } mutate( foo ); assert.equal( foo.value, 2 ); rollup-2.61.1/test/form/samples/unused-default-exports/_expected/es.js000066400000000000000000000002021415504077600260430ustar00rootroot00000000000000var foo = { value: 1 }; function mutate ( obj ) { obj.value += 1; return obj; } mutate( foo ); assert.equal( foo.value, 2 ); rollup-2.61.1/test/form/samples/unused-default-exports/_expected/iife.js000066400000000000000000000002571415504077600263620ustar00rootroot00000000000000(function () { 'use strict'; var foo = { value: 1 }; function mutate ( obj ) { obj.value += 1; return obj; } mutate( foo ); assert.equal( foo.value, 2 ); })(); rollup-2.61.1/test/form/samples/unused-default-exports/_expected/system.js000066400000000000000000000003751415504077600267730ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/unused-default-exports/_expected/umd.js000066400000000000000000000004221415504077600262250ustar00rootroot00000000000000(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-2.61.1/test/form/samples/unused-default-exports/foo.js000066400000000000000000000001711415504077600242640ustar00rootroot00000000000000export var foo = { value: 1 }; function mutate ( obj ) { obj.value += 1; return obj; } export default mutate( foo ); rollup-2.61.1/test/form/samples/unused-default-exports/main.js000066400000000000000000000000731415504077600244260ustar00rootroot00000000000000import { foo } from './foo'; assert.equal( foo.value, 2 ); rollup-2.61.1/test/form/samples/unused-function-and-class-expressions/000077500000000000000000000000001415504077600260665ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/unused-function-and-class-expressions/_config.js000066400000000000000000000001341415504077600300260ustar00rootroot00000000000000module.exports = { description: 'properly remove unused function and class expressions' }; rollup-2.61.1/test/form/samples/unused-function-and-class-expressions/_expected/000077500000000000000000000000001415504077600300265ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/unused-function-and-class-expressions/_expected/amd.js000066400000000000000000000001371415504077600311260ustar00rootroot00000000000000define((function () { 'use strict'; function foo() { console.log("foo"); } foo(); })); rollup-2.61.1/test/form/samples/unused-function-and-class-expressions/_expected/cjs.js000066400000000000000000000000771415504077600311470ustar00rootroot00000000000000'use strict'; function foo() { console.log("foo"); } foo(); rollup-2.61.1/test/form/samples/unused-function-and-class-expressions/_expected/es.js000066400000000000000000000000601415504077600307670ustar00rootroot00000000000000function foo() { console.log("foo"); } foo(); rollup-2.61.1/test/form/samples/unused-function-and-class-expressions/_expected/iife.js000066400000000000000000000001321415504077600312740ustar00rootroot00000000000000(function () { 'use strict'; function foo() { console.log("foo"); } foo(); })(); rollup-2.61.1/test/form/samples/unused-function-and-class-expressions/_expected/system.js000066400000000000000000000002421415504077600317060ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function foo() { console.log("foo"); } foo(); }) }; })); rollup-2.61.1/test/form/samples/unused-function-and-class-expressions/_expected/umd.js000066400000000000000000000002751415504077600311550ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function foo() { console.log("foo"); } foo(); })); rollup-2.61.1/test/form/samples/unused-function-and-class-expressions/main.js000066400000000000000000000006611415504077600273530ustar00rootroot00000000000000(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-2.61.1/test/form/samples/unused-import/000077500000000000000000000000001415504077600213305ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/unused-import/_config.js000066400000000000000000000003021415504077600232650ustar00rootroot00000000000000module.exports = { description: 'excludes unused imports ([#595])', options: { external: ['external'], output: { globals: { external: 'external' }, systemNullSetters: true } } }; rollup-2.61.1/test/form/samples/unused-import/_expected/000077500000000000000000000000001415504077600232705ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/unused-import/_expected/amd.js000066400000000000000000000001021415504077600243600ustar00rootroot00000000000000define(['external'], (function (external) { 'use strict'; })); rollup-2.61.1/test/form/samples/unused-import/_expected/cjs.js000066400000000000000000000000451415504077600244040ustar00rootroot00000000000000'use strict'; require('external'); rollup-2.61.1/test/form/samples/unused-import/_expected/es.js000066400000000000000000000000231415504077600242300ustar00rootroot00000000000000import 'external'; rollup-2.61.1/test/form/samples/unused-import/_expected/iife.js000066400000000000000000000000471415504077600245430ustar00rootroot00000000000000(function () { 'use strict'; })(); rollup-2.61.1/test/form/samples/unused-import/_expected/system.js000066400000000000000000000002041415504077600251460ustar00rootroot00000000000000System.register(['external'], (function () { 'use strict'; return { setters: [null], execute: (function () { }) }; })); rollup-2.61.1/test/form/samples/unused-import/_expected/umd.js000066400000000000000000000002301415504077600244060ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(['external'], factory) : factory(); })((function () { 'use strict'; })); rollup-2.61.1/test/form/samples/unused-import/main.js000066400000000000000000000001121415504077600226040ustar00rootroot00000000000000import { unused } from 'external'; function alsoUnused () { unused(); } rollup-2.61.1/test/form/samples/unused-inner-functions-and-classes/000077500000000000000000000000001415504077600253325ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/unused-inner-functions-and-classes/_config.js000066400000000000000000000001321415504077600272700ustar00rootroot00000000000000module.exports = { description: 'does not include unused inner functions and classes' }; rollup-2.61.1/test/form/samples/unused-inner-functions-and-classes/_expected/000077500000000000000000000000001415504077600272725ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/unused-inner-functions-and-classes/_expected/amd.js000066400000000000000000000006411415504077600303720ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/unused-inner-functions-and-classes/_expected/cjs.js000066400000000000000000000005151415504077600304100ustar00rootroot00000000000000'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-2.61.1/test/form/samples/unused-inner-functions-and-classes/_expected/es.js000066400000000000000000000004761415504077600302460ustar00rootroot00000000000000function 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-2.61.1/test/form/samples/unused-inner-functions-and-classes/_expected/iife.js000066400000000000000000000006371415504077600305520ustar00rootroot00000000000000(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-2.61.1/test/form/samples/unused-inner-functions-and-classes/_expected/system.js000066400000000000000000000011411415504077600311510ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/unused-inner-functions-and-classes/_expected/umd.js000066400000000000000000000010051415504077600304110ustar00rootroot00000000000000(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-2.61.1/test/form/samples/unused-inner-functions-and-classes/main.js000066400000000000000000000004101415504077600266070ustar00rootroot00000000000000import { 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-2.61.1/test/form/samples/unused-inner-functions-and-classes/stuff.js000066400000000000000000000007401415504077600270200ustar00rootroot00000000000000export 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-2.61.1/test/form/samples/unused-var/000077500000000000000000000000001415504077600206065ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/unused-var/_config.js000066400000000000000000000001031415504077600225420ustar00rootroot00000000000000module.exports = { description: 'omits unused var declaration' }; rollup-2.61.1/test/form/samples/unused-var/_expected/000077500000000000000000000000001415504077600225465ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/unused-var/_expected/amd.js000066400000000000000000000001231415504077600236410ustar00rootroot00000000000000define((function () { 'use strict'; var foo = 'lol'; console.log( foo ); })); rollup-2.61.1/test/form/samples/unused-var/_expected/cjs.js000066400000000000000000000000651415504077600236640ustar00rootroot00000000000000'use strict'; var foo = 'lol'; console.log( foo ); rollup-2.61.1/test/form/samples/unused-var/_expected/es.js000066400000000000000000000000461415504077600235130ustar00rootroot00000000000000var foo = 'lol'; console.log( foo ); rollup-2.61.1/test/form/samples/unused-var/_expected/iife.js000066400000000000000000000001161415504077600240160ustar00rootroot00000000000000(function () { 'use strict'; var foo = 'lol'; console.log( foo ); })(); rollup-2.61.1/test/form/samples/unused-var/_expected/system.js000066400000000000000000000002221415504077600244240ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { var foo = 'lol'; console.log( foo ); }) }; })); rollup-2.61.1/test/form/samples/unused-var/_expected/umd.js000066400000000000000000000002611415504077600236700ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; var foo = 'lol'; console.log( foo ); })); rollup-2.61.1/test/form/samples/unused-var/foo.js000066400000000000000000000001121415504077600217210ustar00rootroot00000000000000var foo = 'lol'; var bar = 'wut'; var baz = bar || foo; export { foo }; rollup-2.61.1/test/form/samples/unused-var/main.js000066400000000000000000000000641415504077600220700ustar00rootroot00000000000000import { foo } from './foo.js'; console.log( foo ); rollup-2.61.1/test/form/samples/update-expression-side-effects/000077500000000000000000000000001415504077600245335ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/update-expression-side-effects/_config.js000066400000000000000000000001371415504077600264760ustar00rootroot00000000000000module.exports = { description: 'detect side-effects when dealing with update expressions' }; rollup-2.61.1/test/form/samples/update-expression-side-effects/_expected/000077500000000000000000000000001415504077600264735ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/update-expression-side-effects/_expected/amd.js000066400000000000000000000003051415504077600275700ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/update-expression-side-effects/_expected/cjs.js000066400000000000000000000002401415504077600276040ustar00rootroot00000000000000'use strict'; const effectY = () => { console.log('effect'); return 'y'; }; const x = {y: 1}; x[effectY()]++; let foo = {bar: {}}; foo++; foo.bar.baz = 1; rollup-2.61.1/test/form/samples/update-expression-side-effects/_expected/es.js000066400000000000000000000002211415504077600274330ustar00rootroot00000000000000const effectY = () => { console.log('effect'); return 'y'; }; const x = {y: 1}; x[effectY()]++; let foo = {bar: {}}; foo++; foo.bar.baz = 1; rollup-2.61.1/test/form/samples/update-expression-side-effects/_expected/iife.js000066400000000000000000000003001415504077600277360ustar00rootroot00000000000000(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-2.61.1/test/form/samples/update-expression-side-effects/_expected/system.js000066400000000000000000000004221415504077600303530ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/update-expression-side-effects/_expected/umd.js000066400000000000000000000004431415504077600276170ustar00rootroot00000000000000(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-2.61.1/test/form/samples/update-expression-side-effects/main.js000066400000000000000000000002211415504077600260100ustar00rootroot00000000000000const effectY = () => { console.log('effect'); return 'y'; }; const x = {y: 1}; x[effectY()]++; let foo = {bar: {}}; foo++; foo.bar.baz = 1; rollup-2.61.1/test/form/samples/updating-assignments/000077500000000000000000000000001415504077600226615ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/updating-assignments/_config.js000066400000000000000000000002021415504077600246150ustar00rootroot00000000000000module.exports = { description: 'Correctly handles assignment operators on exports', options: { output: { name: 'bundle' } } }; rollup-2.61.1/test/form/samples/updating-assignments/_expected/000077500000000000000000000000001415504077600246215ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/updating-assignments/_expected/amd.js000066400000000000000000000005611415504077600257220ustar00rootroot00000000000000define(['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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/updating-assignments/_expected/cjs.js000066400000000000000000000004621415504077600257400ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); 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-2.61.1/test/form/samples/updating-assignments/_expected/es.js000066400000000000000000000002061415504077600255640ustar00rootroot00000000000000let 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-2.61.1/test/form/samples/updating-assignments/_expected/iife.js000066400000000000000000000006001415504077600260670ustar00rootroot00000000000000var 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; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); rollup-2.61.1/test/form/samples/updating-assignments/_expected/system.js000066400000000000000000000007341415504077600265070ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/updating-assignments/_expected/umd.js000066400000000000000000000012161415504077600257440ustar00rootroot00000000000000(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; Object.defineProperty(exports, '__esModule', { value: true }); })); rollup-2.61.1/test/form/samples/updating-assignments/main.js000066400000000000000000000001761415504077600241470ustar00rootroot00000000000000export 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-2.61.1/test/form/samples/url-external/000077500000000000000000000000001415504077600211375ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/url-external/_config.js000066400000000000000000000003161415504077600231010ustar00rootroot00000000000000module.exports = { description: 'supports URL externals', options: { external: ['https://external.com/external.js'], output: { globals: { 'https://external.com/external.js': 'external' } } } }; rollup-2.61.1/test/form/samples/url-external/_expected/000077500000000000000000000000001415504077600230775ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/url-external/_expected/amd.js000066400000000000000000000005021415504077600241730ustar00rootroot00000000000000define(['https://external.com/external.js'], (function (external) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external__default = /*#__PURE__*/_interopDefaultLegacy(external); console.log(external__default["default"]); })); rollup-2.61.1/test/form/samples/url-external/_expected/cjs.js000066400000000000000000000004621415504077600242160ustar00rootroot00000000000000'use strict'; var external = require('https://external.com/external.js'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external__default = /*#__PURE__*/_interopDefaultLegacy(external); console.log(external__default["default"]); rollup-2.61.1/test/form/samples/url-external/_expected/es.js000066400000000000000000000001211415504077600240360ustar00rootroot00000000000000import external from 'https://external.com/external.js'; console.log(external); rollup-2.61.1/test/form/samples/url-external/_expected/iife.js000066400000000000000000000004371415504077600243550ustar00rootroot00000000000000(function (external) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external__default = /*#__PURE__*/_interopDefaultLegacy(external); console.log(external__default["default"]); })(external); rollup-2.61.1/test/form/samples/url-external/_expected/system.js000066400000000000000000000003701415504077600247610ustar00rootroot00000000000000System.register(['https://external.com/external.js'], (function () { 'use strict'; var external; return { setters: [function (module) { external = module["default"]; }], execute: (function () { console.log(external); }) }; })); rollup-2.61.1/test/form/samples/url-external/_expected/umd.js000066400000000000000000000012001415504077600242130ustar00rootroot00000000000000(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'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var external__default = /*#__PURE__*/_interopDefaultLegacy(external); console.log(external__default["default"]); })); rollup-2.61.1/test/form/samples/url-external/main.js000066400000000000000000000001201415504077600224120ustar00rootroot00000000000000import external from 'https://external.com/external.js'; console.log(external);rollup-2.61.1/test/form/samples/use-global-map-for-export-name/000077500000000000000000000000001415504077600243435ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/use-global-map-for-export-name/_config.js000066400000000000000000000002721415504077600263060ustar00rootroot00000000000000module.exports = { description: 'applies globals to output name', options: { output: { name: 'leaflet.terminator', globals: { leaflet: 'L' } }, external: ['leaflet'] } }; rollup-2.61.1/test/form/samples/use-global-map-for-export-name/_expected/000077500000000000000000000000001415504077600263035ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/use-global-map-for-export-name/_expected/amd.js000066400000000000000000000004441415504077600274040ustar00rootroot00000000000000define(['leaflet'], (function (L) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var L__default = /*#__PURE__*/_interopDefaultLegacy(L); L__default["default"].terminator = function(options) { }; })); rollup-2.61.1/test/form/samples/use-global-map-for-export-name/_expected/cjs.js000066400000000000000000000004231415504077600274170ustar00rootroot00000000000000'use strict'; var L = require('leaflet'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var L__default = /*#__PURE__*/_interopDefaultLegacy(L); L__default["default"].terminator = function(options) { }; rollup-2.61.1/test/form/samples/use-global-map-for-export-name/_expected/es.js000066400000000000000000000001001415504077600272370ustar00rootroot00000000000000import L from 'leaflet'; L.terminator = function(options) { }; rollup-2.61.1/test/form/samples/use-global-map-for-export-name/_expected/iife.js000066400000000000000000000004231415504077600275540ustar00rootroot00000000000000(function (L) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var L__default = /*#__PURE__*/_interopDefaultLegacy(L); L__default["default"].terminator = function(options) { }; })(L); rollup-2.61.1/test/form/samples/use-global-map-for-export-name/_expected/system.js000066400000000000000000000003711415504077600301660ustar00rootroot00000000000000System.register('leaflet.terminator', ['leaflet'], (function () { 'use strict'; var L; return { setters: [function (module) { L = module["default"]; }], execute: (function () { L.terminator = function(options) { }; }) }; })); rollup-2.61.1/test/form/samples/use-global-map-for-export-name/_expected/umd.js000066400000000000000000000011021415504077600274200ustar00rootroot00000000000000(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'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var L__default = /*#__PURE__*/_interopDefaultLegacy(L); L__default["default"].terminator = function(options) { }; })); rollup-2.61.1/test/form/samples/use-global-map-for-export-name/main.js000066400000000000000000000001001415504077600256140ustar00rootroot00000000000000import L from 'leaflet'; L.terminator = function(options) { }; rollup-2.61.1/test/form/samples/whitespace-around-namespace-member-expression/000077500000000000000000000000001415504077600275335ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/whitespace-around-namespace-member-expression/_config.js000066400000000000000000000001601415504077600314720ustar00rootroot00000000000000module.exports = { description: 'whitespace around the "." in member expressions does not mess up renaming' }; rollup-2.61.1/test/form/samples/whitespace-around-namespace-member-expression/_expected/000077500000000000000000000000001415504077600314735ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/whitespace-around-namespace-member-expression/_expected/amd.js000066400000000000000000000001401415504077600325650ustar00rootroot00000000000000define((function () { 'use strict'; function yar() { console.log('yar?'); } yar(); })); rollup-2.61.1/test/form/samples/whitespace-around-namespace-member-expression/_expected/cjs.js000066400000000000000000000001001415504077600325770ustar00rootroot00000000000000'use strict'; function yar() { console.log('yar?'); } yar(); rollup-2.61.1/test/form/samples/whitespace-around-namespace-member-expression/_expected/es.js000066400000000000000000000000611415504077600324350ustar00rootroot00000000000000function yar() { console.log('yar?'); } yar(); rollup-2.61.1/test/form/samples/whitespace-around-namespace-member-expression/_expected/iife.js000066400000000000000000000001331415504077600327420ustar00rootroot00000000000000(function () { 'use strict'; function yar() { console.log('yar?'); } yar(); })(); rollup-2.61.1/test/form/samples/whitespace-around-namespace-member-expression/_expected/system.js000066400000000000000000000002431415504077600333540ustar00rootroot00000000000000System.register([], (function () { 'use strict'; return { execute: (function () { function yar() { console.log('yar?'); } yar(); }) }; })); rollup-2.61.1/test/form/samples/whitespace-around-namespace-member-expression/_expected/umd.js000066400000000000000000000002761415504077600326230ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); })((function () { 'use strict'; function yar() { console.log('yar?'); } yar(); })); rollup-2.61.1/test/form/samples/whitespace-around-namespace-member-expression/foo.js000066400000000000000000000000601415504077600306500ustar00rootroot00000000000000export function yar() { console.log('yar?'); } rollup-2.61.1/test/form/samples/whitespace-around-namespace-member-expression/main.js000066400000000000000000000000551415504077600310150ustar00rootroot00000000000000import * as foo from './foo.js'; foo .yar(); rollup-2.61.1/test/form/samples/wrap-simplified-expressions/000077500000000000000000000000001415504077600241715ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/wrap-simplified-expressions/_config.js000066400000000000000000000001511415504077600261300ustar00rootroot00000000000000module.exports = { description: 'wraps simplified expressions that have become callees if necessary' }; rollup-2.61.1/test/form/samples/wrap-simplified-expressions/_expected/000077500000000000000000000000001415504077600261315ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/wrap-simplified-expressions/_expected/amd.js000066400000000000000000000011521415504077600272270ustar00rootroot00000000000000define((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-2.61.1/test/form/samples/wrap-simplified-expressions/_expected/cjs.js000066400000000000000000000010711415504077600272450ustar00rootroot00000000000000'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-2.61.1/test/form/samples/wrap-simplified-expressions/_expected/es.js000066400000000000000000000010521415504077600270740ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/wrap-simplified-expressions/_expected/iife.js000066400000000000000000000011451415504077600274040ustar00rootroot00000000000000(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-2.61.1/test/form/samples/wrap-simplified-expressions/_expected/system.js000066400000000000000000000013171415504077600300150ustar00rootroot00000000000000System.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-2.61.1/test/form/samples/wrap-simplified-expressions/_expected/umd.js000066400000000000000000000013101415504077600272470ustar00rootroot00000000000000(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-2.61.1/test/form/samples/wrap-simplified-expressions/main.js000066400000000000000000000012001415504077600254440ustar00rootroot00000000000000const 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-2.61.1/test/form/samples/yield-expression/000077500000000000000000000000001415504077600220205ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/yield-expression/missing-space/000077500000000000000000000000001415504077600245625ustar00rootroot00000000000000rollup-2.61.1/test/form/samples/yield-expression/missing-space/_config.js000066400000000000000000000001441415504077600265230ustar00rootroot00000000000000module.exports = { description: 'Inserts space when simplifying yield expression without space' }; rollup-2.61.1/test/form/samples/yield-expression/missing-space/_expected.js000066400000000000000000000001201415504077600270510ustar00rootroot00000000000000function* test() { yield null; } for (const x of test()) { console.log(x); } rollup-2.61.1/test/form/samples/yield-expression/missing-space/main.js000066400000000000000000000001231415504077600260400ustar00rootroot00000000000000function* test() { yield!1||null; } for (const x of test()) { console.log(x); } rollup-2.61.1/test/function/000077500000000000000000000000001415504077600157335ustar00rootroot00000000000000rollup-2.61.1/test/function/index.js000066400000000000000000000121101415504077600173730ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const rollup = require('../../dist/rollup'); const { compareError, compareWarnings, 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 fn = new Function(contextKeys, code); fn.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]; if (typeof code !== 'undefined') { return (exportsMap[outputId] = requireWithContext( code, { require: requireFromOutputVia(outputId), ...context }, (exportsMap[outputId] = {}) )); } else { return require(importee); } }; 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'), (dir, config) => { (config.skip ? it.skip : config.solo ? it.only : it)( path.basename(dir) + ': ' + config.description, () => { if (config.show) console.group(path.basename(dir)); if (config.before) config.before(); process.chdir(dir); const warnings = []; return rollup .rollup({ input: path.join(dir, 'main.js'), onwarn: warning => warnings.push(warning), 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(err => { if (config.generateError) { compareError(err, config.generateError); } else { throw err; } }) .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(err => { if (config.runtimeError) { config.runtimeError(err); } else { unintendedError = err; } }) .then(() => { if (config.show || unintendedError) { for (const chunk of result) { console.group(chunk.fileName); console.log(chunk.code); console.groupEnd(); console.log(); } } if (config.warnings) { if (Array.isArray(config.warnings)) { compareWarnings(warnings, config.warnings); } else { config.warnings(warnings); } } else if (warnings.length) { 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) config.after(); }); }); }) .catch(err => { if (config.after) config.after(); if (config.error) { compareError(err, config.error); } else { throw err; } }); } ); }); rollup-2.61.1/test/function/samples/000077500000000000000000000000001415504077600173775ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/access-instance-prop/000077500000000000000000000000001415504077600234205ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/access-instance-prop/_config.js000066400000000000000000000001401415504077600253550ustar00rootroot00000000000000module.exports = { description: 'respects getters when accessing properties of an instance' }; rollup-2.61.1/test/function/samples/access-instance-prop/main.js000066400000000000000000000002021415504077600246740ustar00rootroot00000000000000let effect = false; var b = { get a() { effect = true; } }; function X() {} X.prototype = b; new X().a; assert.ok(effect); rollup-2.61.1/test/function/samples/add-watch-file-generate/000077500000000000000000000000001415504077600237405ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/add-watch-file-generate/_config.js000066400000000000000000000007101415504077600257000ustar00rootroot00000000000000const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/add-watch-file-generate/main.js000066400000000000000000000000411415504077600252150ustar00rootroot00000000000000throw new Error('Not executed'); rollup-2.61.1/test/function/samples/add-watch-file-generate/watched.js000066400000000000000000000000001415504077600257030ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/adds-semicolons-if-necessary-b/000077500000000000000000000000001415504077600252705ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/adds-semicolons-if-necessary-b/_config.js000066400000000000000000000001041415504077600272250ustar00rootroot00000000000000module.exports = { description: 'adds semi-colons if necessary' }; rollup-2.61.1/test/function/samples/adds-semicolons-if-necessary-b/foo.js000066400000000000000000000000221415504077600264030ustar00rootroot00000000000000assert.ok( true ) rollup-2.61.1/test/function/samples/adds-semicolons-if-necessary-b/main.js000066400000000000000000000000531415504077600265500ustar00rootroot00000000000000import './foo.js'; (function bar() {})(); rollup-2.61.1/test/function/samples/adds-semicolons-if-necessary-c/000077500000000000000000000000001415504077600252715ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/adds-semicolons-if-necessary-c/_config.js000066400000000000000000000001041415504077600272260ustar00rootroot00000000000000module.exports = { description: 'adds semi-colons if necessary' }; rollup-2.61.1/test/function/samples/adds-semicolons-if-necessary-c/foo.js000066400000000000000000000000531415504077600264100ustar00rootroot00000000000000export default function () { return 42; } rollup-2.61.1/test/function/samples/adds-semicolons-if-necessary-c/main.js000066400000000000000000000001451415504077600265530ustar00rootroot00000000000000import foo from './foo.js'; (function bar() { assert.ok( true ); })(); assert.equal( foo(), 42 ); rollup-2.61.1/test/function/samples/adds-semicolons-if-necessary-d/000077500000000000000000000000001415504077600252725ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/adds-semicolons-if-necessary-d/_config.js000066400000000000000000000001041415504077600272270ustar00rootroot00000000000000module.exports = { description: 'adds semi-colons if necessary' }; rollup-2.61.1/test/function/samples/adds-semicolons-if-necessary-d/foo.js000066400000000000000000000000221415504077600264050ustar00rootroot00000000000000export default 42 rollup-2.61.1/test/function/samples/adds-semicolons-if-necessary-d/main.js000066400000000000000000000001431415504077600265520ustar00rootroot00000000000000import foo from './foo.js'; (function bar() { assert.ok( true ); })(); assert.equal( foo, 42 ); rollup-2.61.1/test/function/samples/adds-semicolons-if-necessary/000077500000000000000000000000001415504077600250515ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/adds-semicolons-if-necessary/_config.js000066400000000000000000000001041415504077600270060ustar00rootroot00000000000000module.exports = { description: 'adds semi-colons if necessary' }; rollup-2.61.1/test/function/samples/adds-semicolons-if-necessary/foo.js000066400000000000000000000000551415504077600261720ustar00rootroot00000000000000export var foo = function () { return 42; } rollup-2.61.1/test/function/samples/adds-semicolons-if-necessary/main.js000066400000000000000000000001511415504077600263300ustar00rootroot00000000000000import { foo } from './foo.js'; (function bar() { assert.ok( true ); })(); assert.equal( foo(), 42 ); rollup-2.61.1/test/function/samples/adds-timings-to-bundle-when-codesplitting/000077500000000000000000000000001415504077600274565ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/adds-timings-to-bundle-when-codesplitting/_config.js000066400000000000000000000012351415504077600314210ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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.indexOf('# BUILD') >= 0, '# BUILD time is not measured.'); assert.ok(timers.indexOf('# GENERATE') >= 0, '# GENERATE time is not measured.'); timers.forEach(timer => { 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-2.61.1/test/function/samples/adds-timings-to-bundle-when-codesplitting/main.js000066400000000000000000000000231415504077600307330ustar00rootroot00000000000000export default 41; rollup-2.61.1/test/function/samples/adds-timings-to-bundle-when-codesplitting/main2.js000066400000000000000000000000231415504077600310150ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/adds-timings-to-bundle/000077500000000000000000000000001415504077600236515ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/adds-timings-to-bundle/_config.js000066400000000000000000000011731415504077600256150ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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.indexOf('# BUILD') >= 0, '# BUILD time is not measured.'); assert.ok(timers.indexOf('# GENERATE') >= 0, '# GENERATE time is not measured.'); timers.forEach(timer => { 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-2.61.1/test/function/samples/adds-timings-to-bundle/main.js000066400000000000000000000000231415504077600251260ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/aliased-not-exported-twice/000077500000000000000000000000001415504077600245405ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/aliased-not-exported-twice/_config.js000066400000000000000000000004521415504077600265030ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/aliased-not-exported-twice/foo.js000066400000000000000000000001041415504077600256540ustar00rootroot00000000000000export var count = 0; export function incr () { return ++count; } rollup-2.61.1/test/function/samples/aliased-not-exported-twice/main.js000066400000000000000000000000621415504077600260200ustar00rootroot00000000000000export { count as number, incr } from './foo.js'; rollup-2.61.1/test/function/samples/allow-reserved/000077500000000000000000000000001415504077600223325ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/allow-reserved/_config.js000066400000000000000000000002201415504077600242660ustar00rootroot00000000000000module.exports = { description: 'allow reserved identifiers via custom acorn options', options: { acorn: { allowReserved: true } } }; rollup-2.61.1/test/function/samples/allow-reserved/main.js000066400000000000000000000001011415504077600236040ustar00rootroot00000000000000var x = function await() { return 42; }; assert.equal(x(), 42); rollup-2.61.1/test/function/samples/allow-undefined-as-parameter/000077500000000000000000000000001415504077600250335ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/allow-undefined-as-parameter/_config.js000066400000000000000000000001671415504077600270010ustar00rootroot00000000000000module.exports = { description: 'do not make assumptions about its value when using undefined as a parameter name' }; rollup-2.61.1/test/function/samples/allow-undefined-as-parameter/main.js000066400000000000000000000002151415504077600263130ustar00rootroot00000000000000function foo(undefined) { if (!undefined) { throw new Error('Parameter was not tracked properly') } assert.ok(undefined); } foo(true); rollup-2.61.1/test/function/samples/allows-external-modules-from-nested-module/000077500000000000000000000000001415504077600276725ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/allows-external-modules-from-nested-module/_config.js000066400000000000000000000002011415504077600316250ustar00rootroot00000000000000module.exports = { description: 'imports external modules from nested internal modules', options: { external: ['path'] } }; rollup-2.61.1/test/function/samples/allows-external-modules-from-nested-module/foo.js000066400000000000000000000001631415504077600310130ustar00rootroot00000000000000import { relative } from 'path'; var path = 'a/b/c'; var path2 = 'a/c/b'; export default relative( path, path2 );rollup-2.61.1/test/function/samples/allows-external-modules-from-nested-module/main.js000066400000000000000000000003551415504077600311570ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/allows-unknown-binary-operators/000077500000000000000000000000001415504077600256735ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/allows-unknown-binary-operators/_config.js000066400000000000000000000001061415504077600276320ustar00rootroot00000000000000module.exports = { description: 'allows unknown binary operators' }; rollup-2.61.1/test/function/samples/allows-unknown-binary-operators/main.js000066400000000000000000000000551415504077600271550ustar00rootroot00000000000000export default { minInt24x: - (2 ** 23) }; rollup-2.61.1/test/function/samples/already-deshadowed-import/000077500000000000000000000000001415504077600244355ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/already-deshadowed-import/_config.js000066400000000000000000000004721415504077600264020ustar00rootroot00000000000000module.exports = { description: 'handle already module import names correctly if they are have already been deshadowed', warnings: [ { code: 'CIRCULAR_DEPENDENCY', cycle: ['bob.js', 'alice.js', 'bob.js'], importer: 'bob.js', message: 'Circular dependency: bob.js -> alice.js -> bob.js' } ] }; rollup-2.61.1/test/function/samples/already-deshadowed-import/alice.js000066400000000000000000000001131415504077600260430ustar00rootroot00000000000000import * as Bob from "./bob"; export function foo() { return "alice"; } rollup-2.61.1/test/function/samples/already-deshadowed-import/bob.js000066400000000000000000000001141415504077600255310ustar00rootroot00000000000000import * as Alice from "./alice"; export function foo() { return "bob"; } rollup-2.61.1/test/function/samples/already-deshadowed-import/main.js000066400000000000000000000003521415504077600257170ustar00rootroot00000000000000import * 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-2.61.1/test/function/samples/amd-auto-id-id/000077500000000000000000000000001415504077600220725ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/amd-auto-id-id/_config.js000066400000000000000000000006351415504077600240400ustar00rootroot00000000000000module.exports = { description: 'throws when using both the amd.autoId and the amd.id option', options: { output: { dir: 'dist', amd: { 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/guide/en/#outputamd' } }; rollup-2.61.1/test/function/samples/amd-auto-id-id/main.js000066400000000000000000000000231415504077600233470ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/amd-base-path-id/000077500000000000000000000000001415504077600223745ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/amd-base-path-id/_config.js000066400000000000000000000006411415504077600243370ustar00rootroot00000000000000module.exports = { description: 'throws when using both the amd.basePath and the amd.id option', options: { output: { dir: 'dist', amd: { 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/guide/en/#outputamd' } }; rollup-2.61.1/test/function/samples/amd-base-path-id/main.js000066400000000000000000000000231415504077600236510ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/amd-base-path/000077500000000000000000000000001415504077600220025ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/amd-base-path/_config.js000066400000000000000000000005501415504077600237440ustar00rootroot00000000000000module.exports = { description: 'throws when using only amd.basePath option', options: { output: { dir: 'dist', amd: { 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/guide/en/#outputamd' } }; rollup-2.61.1/test/function/samples/amd-base-path/main.js000066400000000000000000000000231415504077600232570ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/argument-treeshaking-parameter-conflict/000077500000000000000000000000001415504077600273005ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/argument-treeshaking-parameter-conflict/_config.js000066400000000000000000000001521415504077600312400ustar00rootroot00000000000000module.exports = { description: 'does not cause conflicts when deconflicting non-included parameters' }; rollup-2.61.1/test/function/samples/argument-treeshaking-parameter-conflict/dep.js000066400000000000000000000000731415504077600304060ustar00rootroot00000000000000export let value = 0; export const mutate = () => value++; rollup-2.61.1/test/function/samples/argument-treeshaking-parameter-conflict/main.js000066400000000000000000000001731415504077600305630ustar00rootroot00000000000000import * as dep from './dep'; function test(mutate) { dep.mutate('hello'); } test(); assert.strictEqual(dep.value, 1); rollup-2.61.1/test/function/samples/array-double-spread/000077500000000000000000000000001415504077600232415ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/array-double-spread/_config.js000066400000000000000000000001231415504077600251770ustar00rootroot00000000000000module.exports = { description: 'correctly deoptimizes when there is no proto' }; rollup-2.61.1/test/function/samples/array-double-spread/main.js000066400000000000000000000007241415504077600245260ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/array-from-side-effect/000077500000000000000000000000001415504077600236325ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/array-from-side-effect/_config.js000066400000000000000000000002511415504077600255720ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Observes side-effects in Array.from', exports(exports) { assert.strictEqual(exports.x, 7); } }; rollup-2.61.1/test/function/samples/array-from-side-effect/main.js000066400000000000000000000001131415504077600251070ustar00rootroot00000000000000export let x = 1; const list = [1, 2, 3]; Array.from(list, v => (x += v)); rollup-2.61.1/test/function/samples/array-getter/000077500000000000000000000000001415504077600220055ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/array-getter/_config.js000066400000000000000000000001101415504077600237370ustar00rootroot00000000000000module.exports = { description: 'handles getters defined on arrays' }; rollup-2.61.1/test/function/samples/array-getter/main.js000066400000000000000000000002631415504077600232700ustar00rootroot00000000000000let flag = false; const array = []; Object.defineProperty(array, 'prop', { get() { flag = true; } }); array.prop; if (!flag) { throw new Error('Mutation not detected'); } rollup-2.61.1/test/function/samples/array-mutation/000077500000000000000000000000001415504077600223535ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/array-mutation/_config.js000066400000000000000000000000751415504077600243170ustar00rootroot00000000000000module.exports = { description: 'tracks array mutations' }; rollup-2.61.1/test/function/samples/array-mutation/main.js000066400000000000000000000001221415504077600236300ustar00rootroot00000000000000const array = []; array.push(true); assert.strictEqual(array[0] || false, true); rollup-2.61.1/test/function/samples/asi-prevention-with-comment-like-strings/000077500000000000000000000000001415504077600273645ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/asi-prevention-with-comment-like-strings/_config.js000066400000000000000000000002071415504077600313250ustar00rootroot00000000000000module.exports = { description: 'do not hang when scanning for line-breaks in ASI prevention and there are comment-like strings' }; rollup-2.61.1/test/function/samples/asi-prevention-with-comment-like-strings/main.js000066400000000000000000000001221415504077600306410ustar00rootroot00000000000000function test() { return true ? '/*' : '//' } assert.strictEqual(test(), '/*'); rollup-2.61.1/test/function/samples/assign-namespace-to-var/000077500000000000000000000000001415504077600240235ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/assign-namespace-to-var/_config.js000066400000000000000000000003151415504077600257640ustar00rootroot00000000000000module.exports = { description: 'allows a namespace to be assigned to a variable', warnings: [ { chunkName: 'main', code: 'EMPTY_BUNDLE', message: 'Generated an empty chunk: "main"' } ] }; rollup-2.61.1/test/function/samples/assign-namespace-to-var/b.js000066400000000000000000000000751415504077600246040ustar00rootroot00000000000000export function foo () { return 10; } export var bar = 20; rollup-2.61.1/test/function/samples/assign-namespace-to-var/main.js000066400000000000000000000001001415504077600252740ustar00rootroot00000000000000import * as b from './b'; var val = b.foo(); var val2 = b.bar; rollup-2.61.1/test/function/samples/assignment-deoptimization/000077500000000000000000000000001415504077600246045ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/assignment-deoptimization/assignee-is-deoptimized/000077500000000000000000000000001415504077600313265ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/assignment-deoptimization/assignee-is-deoptimized/_config.js000066400000000000000000000001151415504077600332650ustar00rootroot00000000000000module.exports = { description: 'makes sure the assignee is deoptimized' }; rollup-2.61.1/test/function/samples/assignment-deoptimization/assignee-is-deoptimized/main.js000066400000000000000000000002501415504077600326050ustar00rootroot00000000000000const flags = { updated: false }; let toBeUpdated = {}; toBeUpdated = flags; toBeUpdated.updated = true; if (!flags.updated) throw new Error('Update was not tracked'); rollup-2.61.1/test/function/samples/assignment-deoptimization/assignment-target-is-deoptimized/000077500000000000000000000000001415504077600331645ustar00rootroot00000000000000_config.js000066400000000000000000000001261415504077600350460ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/assignment-deoptimization/assignment-target-is-deoptimizedmodule.exports = { description: 'makes sure the assignment target is deoptimized' }; main.js000066400000000000000000000001361415504077600343670ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/assignment-deoptimization/assignment-target-is-deoptimizedlet updated = false; updated = true; if (!updated) throw new Error('Update was not tracked'); rollup-2.61.1/test/function/samples/assignment-deoptimization/nested-assignment/000077500000000000000000000000001415504077600302345ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/assignment-deoptimization/nested-assignment/_config.js000066400000000000000000000001621415504077600321750ustar00rootroot00000000000000module.exports = { description: 'tracks assigments nested in expressions that are included for other reasons' }; rollup-2.61.1/test/function/samples/assignment-deoptimization/nested-assignment/main.js000066400000000000000000000001671415504077600315220ustar00rootroot00000000000000let updated = false; assert.ok(!updated) || (updated = true); if (!updated) throw new Error('Update was not tracked'); rollup-2.61.1/test/function/samples/assignment-deoptimization/try-catch-inclusion/000077500000000000000000000000001415504077600305035ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/assignment-deoptimization/try-catch-inclusion/_config.js000066400000000000000000000001361415504077600324450ustar00rootroot00000000000000module.exports = { description: 'tracks assigments included via try-catch-deoptimization' }; rollup-2.61.1/test/function/samples/assignment-deoptimization/try-catch-inclusion/main.js000066400000000000000000000001671415504077600317710ustar00rootroot00000000000000let updated = false; try { updated = true; } catch (err) {} if (!updated) throw new Error('Update was not tracked'); rollup-2.61.1/test/function/samples/assignment-patterns/000077500000000000000000000000001415504077600234055ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/assignment-patterns/_config.js000066400000000000000000000001441415504077600253460ustar00rootroot00000000000000module.exports = { description: 'allows reassigments to default parameters that shadow imports' }; rollup-2.61.1/test/function/samples/assignment-patterns/main.js000066400000000000000000000007061415504077600246720ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/assignment-patterns/other.js000066400000000000000000000003001415504077600250550ustar00rootroot00000000000000export 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-2.61.1/test/function/samples/assignment-to-exports-b/000077500000000000000000000000001415504077600241105ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/assignment-to-exports-b/_config.js000066400000000000000000000002601415504077600260500ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'exports are rewritten inside a variable init', exports: exports => { assert.equal(exports.b, 42); } }; rollup-2.61.1/test/function/samples/assignment-to-exports-b/main.js000066400000000000000000000001701415504077600253700ustar00rootroot00000000000000var a = { prop: 42 }; var b = a.prop; function set ( new_a, new_b ) { a = new_a; b = new_b; } export { a, b, set }; rollup-2.61.1/test/function/samples/assignment-to-exports/000077500000000000000000000000001415504077600236715ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/assignment-to-exports/_config.js000066400000000000000000000003231415504077600256310ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'exports are kept up-to-date', exports(exports) { assert.equal(exports.count, 0); exports.incr(); assert.equal(exports.count, 1); } }; rollup-2.61.1/test/function/samples/assignment-to-exports/main.js000066400000000000000000000001001415504077600251420ustar00rootroot00000000000000export var count = 0; export function incr () { count += 1; } rollup-2.61.1/test/function/samples/assignment-to-re-exports-conflict/000077500000000000000000000000001415504077600260745ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/assignment-to-re-exports-conflict/_config.js000066400000000000000000000003261415504077600300370ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 're-exports are kept up-to-date', exports(exports) { assert.equal(exports.count, 0); exports.incr(); assert.equal(exports.count, 1); } }; rollup-2.61.1/test/function/samples/assignment-to-re-exports-conflict/count.js000066400000000000000000000001761415504077600275660ustar00rootroot00000000000000export var count = 0; export function conflict () { var foo = 0, count = 42; } export function incr () { count += 1; } rollup-2.61.1/test/function/samples/assignment-to-re-exports-conflict/main.js000066400000000000000000000000571415504077600273600ustar00rootroot00000000000000export {count, incr, conflict} from './count'; rollup-2.61.1/test/function/samples/assignment-to-re-exports/000077500000000000000000000000001415504077600242755ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/assignment-to-re-exports/_config.js000066400000000000000000000003261415504077600262400ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 're-exports are kept up-to-date', exports(exports) { assert.equal(exports.count, 0); exports.incr(); assert.equal(exports.count, 1); } }; rollup-2.61.1/test/function/samples/assignment-to-re-exports/count.js000066400000000000000000000001001415504077600257520ustar00rootroot00000000000000export var count = 0; export function incr () { count += 1; } rollup-2.61.1/test/function/samples/assignment-to-re-exports/main.js000066400000000000000000000000451415504077600255560ustar00rootroot00000000000000export {count, incr} from './count'; rollup-2.61.1/test/function/samples/associate-arrow-function-parameter-mutations/000077500000000000000000000000001415504077600303245ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/associate-arrow-function-parameter-mutations/_config.js000066400000000000000000000003431415504077600322660ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Associates arrow function parameters with their call arguments with regard to mutations', exports(exports) { assert.equal(exports.baz, 'present'); } }; rollup-2.61.1/test/function/samples/associate-arrow-function-parameter-mutations/main.js000066400000000000000000000002761415504077600316130ustar00rootroot00000000000000const foo = { noEffect: () => {} }; const bar = {}; const addEffect = obj => { obj.noEffect = () => { bar.baz = 'present'; }; }; addEffect( foo ); foo.noEffect(); export default bar; rollup-2.61.1/test/function/samples/associate-arrow-function-return-values/000077500000000000000000000000001415504077600271375ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/associate-arrow-function-return-values/_config.js000066400000000000000000000003041415504077600310760ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Associates function return values with regard to mutations', exports(exports) { assert.equal(exports.bar, 'present'); } }; rollup-2.61.1/test/function/samples/associate-arrow-function-return-values/main.js000066400000000000000000000002721415504077600304220ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; const getFoo = () => foo; getFoo().mightBeExported = exported; foo.mightBeExported.bar = 'present'; export default exported; rollup-2.61.1/test/function/samples/associate-es5-constructor-parameter-mutations/000077500000000000000000000000001415504077600304265ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/associate-es5-constructor-parameter-mutations/_config.js000066400000000000000000000003111415504077600323630ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Associates ES5 constructor parameters with their call arguments', exports(exports) { assert.equal(exports.bar, 'present'); } }; rollup-2.61.1/test/function/samples/associate-es5-constructor-parameter-mutations/main.js000066400000000000000000000003471415504077600317140ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; function AssignExported ( obj ) { obj.mightBeExported = exported; } const bar = new AssignExported( foo ); foo.mightBeExported.bar = 'present'; export default exported; rollup-2.61.1/test/function/samples/associate-es6-constructor-parameter-mutations/000077500000000000000000000000001415504077600304275ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/associate-es6-constructor-parameter-mutations/_config.js000066400000000000000000000003111415504077600323640ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Associates ES5 constructor parameters with their call arguments', exports(exports) { assert.equal(exports.bar, 'present'); } }; rollup-2.61.1/test/function/samples/associate-es6-constructor-parameter-mutations/main.js000066400000000000000000000003671415504077600317170ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; class AssignExported { constructor ( obj ) { obj.mightBeExported = exported; } } const bar = new AssignExported( foo ); foo.mightBeExported.bar = 'present'; export default exported; rollup-2.61.1/test/function/samples/associate-function-parameter-mutations-2/000077500000000000000000000000001415504077600273335ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/associate-function-parameter-mutations-2/_config.js000066400000000000000000000003331415504077600312740ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Associates function parameters with their call arguments with regard to mutations', exports(exports) { assert.equal(exports.bar, 'present'); } }; rollup-2.61.1/test/function/samples/associate-function-parameter-mutations-2/main.js000066400000000000000000000003271415504077600306170ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; function assignExported ( obj ) { obj.mightBeExported = exported; } assignExported( foo ); foo.mightBeExported.bar = 'present'; export default exported; rollup-2.61.1/test/function/samples/associate-function-parameter-mutations/000077500000000000000000000000001415504077600271745ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/associate-function-parameter-mutations/_config.js000066400000000000000000000003331415504077600311350ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Associates function parameters with their call arguments with regard to mutations', exports(exports) { assert.equal(exports.baz, 'present'); } }; rollup-2.61.1/test/function/samples/associate-function-parameter-mutations/main.js000066400000000000000000000002771415504077600304640ustar00rootroot00000000000000const foo = { noEffect: () => {} }; const bar = {}; function addEffect ( obj ) { obj.noEffect = () => { bar.baz = 'present'; }; } addEffect( foo ); foo.noEffect(); export default bar; rollup-2.61.1/test/function/samples/associate-function-return-values-2/000077500000000000000000000000001415504077600261465ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/associate-function-return-values-2/_config.js000066400000000000000000000003001415504077600301010ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Associates function return values with regard to calls', exports(exports) { assert.equal(exports.bar, 'present'); } }; rollup-2.61.1/test/function/samples/associate-function-return-values-2/main.js000066400000000000000000000004111415504077600274240ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; function getAssignExported () { return function assignExported ( obj ) { obj.mightBeExported = exported; }; } getAssignExported()( foo ); foo.mightBeExported.bar = 'present'; export default exported; rollup-2.61.1/test/function/samples/associate-function-return-values-3/000077500000000000000000000000001415504077600261475ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/associate-function-return-values-3/_config.js000066400000000000000000000003011415504077600301030ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Associates function return values of returned functions', exports(exports) { assert.equal(exports.bar, 'present'); } }; rollup-2.61.1/test/function/samples/associate-function-return-values-3/main.js000066400000000000000000000003221415504077600274260ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; function getGetFoo () { return () => foo; } getGetFoo()().mightBeExported = exported; foo.mightBeExported.bar = 'present'; export default exported; rollup-2.61.1/test/function/samples/associate-function-return-values-4/000077500000000000000000000000001415504077600261505ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/associate-function-return-values-4/_config.js000066400000000000000000000002611415504077600301110ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Handles empty return statements (#1702)', exports(exports) { assert.equal(exports.bar, 'present'); } }; rollup-2.61.1/test/function/samples/associate-function-return-values-4/main.js000066400000000000000000000004551415504077600274360ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/associate-function-return-values-5/000077500000000000000000000000001415504077600261515ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/associate-function-return-values-5/_config.js000066400000000000000000000002711415504077600301130ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Associates value mutations across return values', exports(exports) { assert.equal(exports.bar, 'present'); } }; rollup-2.61.1/test/function/samples/associate-function-return-values-5/main.js000066400000000000000000000002661415504077600274370ustar00rootroot00000000000000const foo = {value: false}; const exported = {}; function getFoo() { return foo; } getFoo().value = true; if (foo.value) { exported.bar = 'present' } export default exported; rollup-2.61.1/test/function/samples/associate-function-return-values-across-other-expressions/000077500000000000000000000000001415504077600327765ustar00rootroot00000000000000_config.js000066400000000000000000000003041415504077600346560ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/associate-function-return-values-across-other-expressionsconst assert = require('assert'); module.exports = { description: 'Associates function return values with regard to mutations', exports(exports) { assert.equal(exports.bar, 'present'); } }; main.js000066400000000000000000000003661415504077600342060ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/function/samples/associate-function-return-values/000077500000000000000000000000001415504077600260075ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/associate-function-return-values/_config.js000066400000000000000000000003041415504077600277460ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Associates function return values with regard to mutations', exports(exports) { assert.equal(exports.bar, 'present'); } }; rollup-2.61.1/test/function/samples/associate-function-return-values/main.js000066400000000000000000000003041415504077600272660ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; function getFoo () { return foo; } getFoo().mightBeExported = exported; foo.mightBeExported.bar = 'present'; export default exported; rollup-2.61.1/test/function/samples/associate-getter-return-values-2/000077500000000000000000000000001415504077600256135ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/associate-getter-return-values-2/_config.js000066400000000000000000000002761415504077600275620ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Associates getter return values with regard to calls', exports(exports) { assert.equal(exports.bar, 'present'); } }; rollup-2.61.1/test/function/samples/associate-getter-return-values-2/main.js000066400000000000000000000003501415504077600270730ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; const fooContainer = { get getFoo () {return () => foo;} }; fooContainer.getFoo().mightBeExported = exported; foo.mightBeExported.bar = 'present'; export default exported; rollup-2.61.1/test/function/samples/associate-getter-return-values/000077500000000000000000000000001415504077600254545ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/associate-getter-return-values/_config.js000066400000000000000000000003021415504077600274110ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Associates getter return values with regard to mutations', exports(exports) { assert.equal(exports.bar, 'present'); } }; rollup-2.61.1/test/function/samples/associate-getter-return-values/main.js000066400000000000000000000003321415504077600267340ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; const fooContainer = { get foo () {return foo;} }; fooContainer.foo.mightBeExported = exported; foo.mightBeExported.bar = 'present'; export default exported; rollup-2.61.1/test/function/samples/associate-method-parameter-mutations-2/000077500000000000000000000000001415504077600267665ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/associate-method-parameter-mutations-2/_config.js000066400000000000000000000003311415504077600307250ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Associates method parameters with their call arguments with regard to mutations', exports(exports) { assert.equal(exports.bar, 'present'); } }; rollup-2.61.1/test/function/samples/associate-method-parameter-mutations-2/main.js000066400000000000000000000004271415504077600302530ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/associate-method-parameter-mutations/000077500000000000000000000000001415504077600266275ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/associate-method-parameter-mutations/_config.js000066400000000000000000000003311415504077600305660ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Associates method parameters with their call arguments with regard to mutations', exports(exports) { assert.equal(exports.baz, 'present'); } }; rollup-2.61.1/test/function/samples/associate-method-parameter-mutations/main.js000066400000000000000000000003771415504077600301200ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/associate-object-expression-parameter-mutations/000077500000000000000000000000001415504077600310125ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/associate-object-expression-parameter-mutations/_config.js000066400000000000000000000003221415504077600327510ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Associates object expression member parameters with their call arguments', exports(exports) { assert.equal(exports.bar, 'present'); } }; rollup-2.61.1/test/function/samples/associate-object-expression-parameter-mutations/main.js000066400000000000000000000003571415504077600323010ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; const assigner = { assignExported ( obj ) { obj.mightBeExported = exported; } }; assigner.assignExported( foo ); foo.mightBeExported.bar = 'present'; export default exported; rollup-2.61.1/test/function/samples/associate-object-expression-return-values/000077500000000000000000000000001415504077600276255ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/associate-object-expression-return-values/_config.js000066400000000000000000000003221415504077600315640ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Associates object expression member parameters with their call arguments', exports(exports) { assert.equal(exports.bar, 'present'); } }; rollup-2.61.1/test/function/samples/associate-object-expression-return-values/main.js000066400000000000000000000003341415504077600311070ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; const assigner = { getFoo () { return foo; } }; assigner.getFoo().mightBeExported = exported; foo.mightBeExported.bar = 'present'; export default exported; rollup-2.61.1/test/function/samples/associate-parameter-mutations-across-other-expressions/000077500000000000000000000000001415504077600323405ustar00rootroot00000000000000_config.js000066400000000000000000000003221415504077600342200ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/associate-parameter-mutations-across-other-expressionsconst assert = require('assert'); module.exports = { description: 'Associates parameters with their call arguments across other expressions', exports(exports) { assert.equal(exports.bar, 'present'); } }; rollup-2.61.1/test/function/samples/associate-parameter-mutations-across-other-expressions/main.js000066400000000000000000000004211415504077600336170ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/associate-setter-parameters/000077500000000000000000000000001415504077600250175ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/associate-setter-parameters/_config.js000066400000000000000000000003021415504077600267540ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Associates getter return values with regard to mutations', exports(exports) { assert.equal(exports.bar, 'present'); } }; rollup-2.61.1/test/function/samples/associate-setter-parameters/main.js000066400000000000000000000004021415504077600262750ustar00rootroot00000000000000const foo = { mightBeExported: {} }; const exported = {}; const fooContainer = { set addMightBeExported ( obj ) { obj.mightBeExported = exported; } }; fooContainer.addMightBeExported = foo; foo.mightBeExported.bar = 'present'; export default exported; rollup-2.61.1/test/function/samples/async-function-return/000077500000000000000000000000001415504077600236545ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/async-function-return/_config.js000066400000000000000000000001301415504077600256100ustar00rootroot00000000000000module.exports = { description: 'uses the correct return value for async functions' }; rollup-2.61.1/test/function/samples/async-function-return/main.js000066400000000000000000000004141415504077600251350ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/avoid-exports-dot-asterisk/000077500000000000000000000000001415504077600246125ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/avoid-exports-dot-asterisk/_config.js000066400000000000000000000002501415504077600265510ustar00rootroot00000000000000module.exports = { description: 'avoid return or set module.exports to dot-asterisk style', options: { external: () => true, output: { format: 'cjs' } } }; rollup-2.61.1/test/function/samples/avoid-exports-dot-asterisk/main.js000066400000000000000000000000721415504077600260730ustar00rootroot00000000000000import * as path from 'path'; export { path as default }; rollup-2.61.1/test/function/samples/avoid-variable-be-empty/000077500000000000000000000000001415504077600240045ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/avoid-variable-be-empty/_config.js000066400000000000000000000004141415504077600257450ustar00rootroot00000000000000module.exports = { description: 'avoid variable from empty module name be empty', options: { input: '', plugins: [ { resolveId() { return ''; }, load() { return 'export default 0;'; } } ], output: { format: 'cjs' } } }; rollup-2.61.1/test/function/samples/aync-options/000077500000000000000000000000001415504077600220225ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/aync-options/_config.js000066400000000000000000000010561415504077600237660ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'handles async plugin options', options: { preserveEntrySignatures: false, plugins: [ { options(options) { assert.strictEqual(options.preserveEntrySignatures, false); return Promise.resolve({ ...options, preserveEntrySignatures: 'strict' }); } }, { options(options) { assert.strictEqual(options.preserveEntrySignatures, 'strict'); return Promise.resolve(null); } } ] }, exports(exports) { assert.strictEqual(exports.foo, 1); } }; rollup-2.61.1/test/function/samples/aync-options/main.js000066400000000000000000000000261415504077600233020ustar00rootroot00000000000000export const foo = 1; rollup-2.61.1/test/function/samples/banner-and-footer/000077500000000000000000000000001415504077600227005ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/banner-and-footer/_config.js000066400000000000000000000013151415504077600246420ustar00rootroot00000000000000module.exports = { description: 'adds a banner/footer', options: { output: { banner: '/* this is a banner */', footer: () => Promise.resolve('/* this is a footer */') }, plugins: [ { banner: '/* first banner */', footer() { return '/* first footer */'; } }, { banner() { return '/* second banner */'; }, footer: '/* second footer */' }, { 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 at position 3.\n\tError Message: Could not generate banner.' } }; rollup-2.61.1/test/function/samples/banner-and-footer/main.js000066400000000000000000000000361415504077600241610ustar00rootroot00000000000000console.log( 'hello world' ); rollup-2.61.1/test/function/samples/bindings/000077500000000000000000000000001415504077600211745ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/bindings/_config.js000066400000000000000000000002461415504077600231400ustar00rootroot00000000000000module.exports = { description: 'maintains live bindings' }; // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/bindings rollup-2.61.1/test/function/samples/bindings/foo.js000066400000000000000000000000741415504077600223160ustar00rootroot00000000000000export var count = 0; export function incr() { count++; } rollup-2.61.1/test/function/samples/bindings/main.js000066400000000000000000000001361415504077600224560ustar00rootroot00000000000000import { count, incr } from './foo'; assert.equal(count, 0); incr(); assert.equal(count, 1); rollup-2.61.1/test/function/samples/braceless-arrow-function-returning-function/000077500000000000000000000000001415504077600301535ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/braceless-arrow-function-returning-function/_config.js000066400000000000000000000001411415504077600321110ustar00rootroot00000000000000module.exports = { description: 'arrow function without braces returning a function (#1032)' }; rollup-2.61.1/test/function/samples/braceless-arrow-function-returning-function/main.js000066400000000000000000000003311415504077600314320ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/break-label/000077500000000000000000000000001415504077600215405ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/break-label/_config.js000066400000000000000000000003071415504077600235020ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'do not deconflict break label (#2773)', exports(exports) { assert.deepStrictEqual(exports, { value: 'original', n: 1 }); } }; rollup-2.61.1/test/function/samples/break-label/main.js000066400000000000000000000001521415504077600230200ustar00rootroot00000000000000export { n } from './module_1'; export { value } from './module_2'; import { n } from './module_2'; n(); rollup-2.61.1/test/function/samples/break-label/module_1.js000066400000000000000000000000221415504077600235750ustar00rootroot00000000000000export var n = 1; rollup-2.61.1/test/function/samples/break-label/module_2.js000066400000000000000000000001621415504077600236030ustar00rootroot00000000000000export let value = 'original'; export function n() { n: if (value === 1) { break n; value = 'changed'; } } rollup-2.61.1/test/function/samples/build-promise-chain/000077500000000000000000000000001415504077600232325ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/build-promise-chain/_config.js000066400000000000000000000001271415504077600251740ustar00rootroot00000000000000module.exports = { description: 'Does not fail when iteratively chaining promises' }; rollup-2.61.1/test/function/samples/build-promise-chain/main.js000066400000000000000000000001401415504077600245070ustar00rootroot00000000000000let promise = Promise.resolve(); promise = promise.then( () => {} ); promise.then( () => {} ); rollup-2.61.1/test/function/samples/builtin-prototypes/000077500000000000000000000000001415504077600232735ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/builtin-prototypes/argument-side-effects/000077500000000000000000000000001415504077600274545ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/builtin-prototypes/argument-side-effects/_config.js000066400000000000000000000001361415504077600314160ustar00rootroot00000000000000module.exports = { description: 'detects side-effects in chained string method arguments' }; rollup-2.61.1/test/function/samples/builtin-prototypes/argument-side-effects/main.js000066400000000000000000000002511415504077600307340ustar00rootroot00000000000000function getData() { var data = []; 'abc'.trim().replace('b', function() { data.push('replaced'); }); return data; } assert.deepEqual(getData(), ['replaced']); rollup-2.61.1/test/function/samples/builtin-prototypes/truthiness/000077500000000000000000000000001415504077600255035ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/builtin-prototypes/truthiness/_config.js000066400000000000000000000001231415504077600274410ustar00rootroot00000000000000module.exports = { description: 'regards builtin methods as truthy in objects' }; rollup-2.61.1/test/function/samples/builtin-prototypes/truthiness/main.js000066400000000000000000000002221415504077600267610ustar00rootroot00000000000000if (!{}.hasOwnProperty) { throw new Error('Prototype method evaluated as falsy'); } assert.strictEqual({}.hasOwnProperty ? true : false, true); rollup-2.61.1/test/function/samples/bundle-facade-order/000077500000000000000000000000001415504077600231625ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/bundle-facade-order/_config.js000066400000000000000000000013201415504077600251200ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'respects the order of entry points when there are additional facades for chunks', options: { input: { main: 'main', 'main-alias': 'main', other: 'other' }, plugins: { 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-2.61.1/test/function/samples/bundle-facade-order/main.js000066400000000000000000000000301415504077600244350ustar00rootroot00000000000000export default 'main1'; rollup-2.61.1/test/function/samples/bundle-facade-order/other.js000066400000000000000000000000301415504077600246320ustar00rootroot00000000000000export default 'main2'; rollup-2.61.1/test/function/samples/call-external-function/000077500000000000000000000000001415504077600237555ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/call-external-function/_config.js000066400000000000000000000002741415504077600257220ustar00rootroot00000000000000module.exports = { description: 'handles call of aliased external function (#957)', warnings() {}, context: { require(id) { if (id === 'foo') { return () => 42; } } } }; rollup-2.61.1/test/function/samples/call-external-function/foo.js000066400000000000000000000000531415504077600250740ustar00rootroot00000000000000import foo from 'foo'; export default foo; rollup-2.61.1/test/function/samples/call-external-function/main.js000066400000000000000000000001111415504077600252300ustar00rootroot00000000000000import foo_ from './foo.js'; var foo = foo_; assert.equal( foo(), 42 ); rollup-2.61.1/test/function/samples/call-marked-pure-with-plugin-parse-ast/000077500000000000000000000000001415504077600266665ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/call-marked-pure-with-plugin-parse-ast/_config.js000066400000000000000000000014201415504077600306250ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/call-marked-pure-with-plugin-parse-ast/main.js000066400000000000000000000002221415504077600301440ustar00rootroot00000000000000import socks from 'socks'; /*#__PURE__*/ socks(); /* #__PURE__*/ socks(); /*#__PURE__ */ socks(); /* #__PURE__ */ socks(); // #__PURE__ socks(); rollup-2.61.1/test/function/samples/call-marked-pure/000077500000000000000000000000001415504077600225245ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/call-marked-pure/_config.js000066400000000000000000000006051415504077600244670ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/call-marked-pure/main.js000066400000000000000000000002221415504077600240020ustar00rootroot00000000000000import socks from 'socks'; /*#__PURE__*/ socks(); /* #__PURE__*/ socks(); /*#__PURE__ */ socks(); /* #__PURE__ */ socks(); // #__PURE__ socks(); rollup-2.61.1/test/function/samples/call-non-function-default-exports/000077500000000000000000000000001415504077600260515ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/call-non-function-default-exports/_config.js000066400000000000000000000001111415504077600300040ustar00rootroot00000000000000module.exports = { description: 'calls non-function default exports' }; rollup-2.61.1/test/function/samples/call-non-function-default-exports/foo.js000066400000000000000000000002001415504077600271620ustar00rootroot00000000000000function x () { global.answer = 'x'; } function y () { global.answer = 'y'; } export default Math.random() < 0.5 ? x : y; rollup-2.61.1/test/function/samples/call-non-function-default-exports/main.js000066400000000000000000000001171415504077600273320ustar00rootroot00000000000000import foo from './foo.js'; foo(); assert.ok( /[xy]/.test( global.answer ) ); rollup-2.61.1/test/function/samples/can-import-self-treeshake/000077500000000000000000000000001415504077600243505ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/can-import-self-treeshake/_config.js000066400000000000000000000005041415504077600263110ustar00rootroot00000000000000module.exports = { description: 'direct self import', warnings: [ { code: 'CIRCULAR_DEPENDENCY', cycle: ['lib.js', 'lib.js'], importer: 'lib.js', message: 'Circular dependency: lib.js -> lib.js' }, { chunkName: 'main', code: 'EMPTY_BUNDLE', message: `Generated an empty chunk: "main"` } ] }; rollup-2.61.1/test/function/samples/can-import-self-treeshake/lib.js000066400000000000000000000001271415504077600254540ustar00rootroot00000000000000import * as lib from './lib'; export const op = x => x * x; export const run = () => 4;rollup-2.61.1/test/function/samples/can-import-self-treeshake/main.js000066400000000000000000000000461415504077600256320ustar00rootroot00000000000000import { run } from './lib.js'; run();rollup-2.61.1/test/function/samples/can-import-self/000077500000000000000000000000001415504077600223775ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/can-import-self/_config.js000066400000000000000000000005141415504077600243410ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'a module importing its own bindings', exports(exports) { assert.equal(exports.result, 4); }, warnings: [ { code: 'CIRCULAR_DEPENDENCY', cycle: ['lib.js', 'lib.js'], importer: 'lib.js', message: 'Circular dependency: lib.js -> lib.js' } ] }; rollup-2.61.1/test/function/samples/can-import-self/lib.js000066400000000000000000000001411415504077600234770ustar00rootroot00000000000000import * as lib from './lib'; export const op = x => x * x; export const run = () => lib.op( 2 );rollup-2.61.1/test/function/samples/can-import-self/main.js000066400000000000000000000000741415504077600236620ustar00rootroot00000000000000import { run } from './lib.js'; export const result = run();rollup-2.61.1/test/function/samples/cannot-call-external-namespace/000077500000000000000000000000001415504077600253445ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/cannot-call-external-namespace/_config.js000066400000000000000000000005161415504077600273100ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/cannot-call-external-namespace/main.js000066400000000000000000000001271415504077600266260ustar00rootroot00000000000000import * as foo from 'fs'; try { foo(); } catch (e) {} try { foo``; } catch (e) {} rollup-2.61.1/test/function/samples/cannot-call-internal-namespace/000077500000000000000000000000001415504077600253365ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/cannot-call-internal-namespace/_config.js000066400000000000000000000004531415504077600273020ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/cannot-call-internal-namespace/foo.js000066400000000000000000000000241415504077600264530ustar00rootroot00000000000000export const a = 1; rollup-2.61.1/test/function/samples/cannot-call-internal-namespace/main.js000066400000000000000000000001251415504077600266160ustar00rootroot00000000000000import * as foo from './foo.js'; try { foo(); } catch {} try { foo``; } catch {} rollup-2.61.1/test/function/samples/cannot-resolve-sourcemap-warning/000077500000000000000000000000001415504077600257755ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/cannot-resolve-sourcemap-warning/_config.js000066400000000000000000000017021415504077600277370ustar00rootroot00000000000000const path = require('path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = { description: 'handles when a sourcemap cannot be resolved in a warning', options: { plugins: { name: 'test-plugin', transform() { return { code: 'export default this', map: { mappings: 'X' } }; } } }, warnings: [ { 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/guide/en/#error-this-is-undefined' } ] }; rollup-2.61.1/test/function/samples/cannot-resolve-sourcemap-warning/main.js000066400000000000000000000000411415504077600272520ustar00rootroot00000000000000throw new Error('Not executed'); rollup-2.61.1/test/function/samples/catch-block-scope/000077500000000000000000000000001415504077600226605ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/catch-block-scope/_config.js000066400000000000000000000001111415504077600246130ustar00rootroot00000000000000module.exports = { description: 'uses correct scope in catch blocks' }; rollup-2.61.1/test/function/samples/catch-block-scope/main.js000066400000000000000000000004321415504077600241410ustar00rootroot00000000000000try { 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-2.61.1/test/function/samples/catch-dynamic-import-failure/000077500000000000000000000000001415504077600250405ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/catch-dynamic-import-failure/_config.js000066400000000000000000000010221415504077600267750ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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 module 'does-not-exist'"; assert.strictEqual(result[2].message.slice(0, expectedError.length), expectedError); }); } }; rollup-2.61.1/test/function/samples/catch-dynamic-import-failure/exists-default.js000066400000000000000000000000661415504077600303410ustar00rootroot00000000000000export default 42; throw new Error('exists-default'); rollup-2.61.1/test/function/samples/catch-dynamic-import-failure/exists-named.js000066400000000000000000000000721415504077600277760ustar00rootroot00000000000000export const value = 42; throw new Error('exists-named'); rollup-2.61.1/test/function/samples/catch-dynamic-import-failure/main.js000066400000000000000000000002571415504077600263260ustar00rootroot00000000000000export 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-2.61.1/test/function/samples/catch-scope-shadowing/000077500000000000000000000000001415504077600235515ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/catch-scope-shadowing/_config.js000066400000000000000000000001361415504077600255130ustar00rootroot00000000000000module.exports = { description: 'correctly associates shadowed variables in catch scopes' }; rollup-2.61.1/test/function/samples/catch-scope-shadowing/main.js000066400000000000000000000004611415504077600250340ustar00rootroot00000000000000var 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-2.61.1/test/function/samples/catch-scope-variables/000077500000000000000000000000001415504077600235365ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/catch-scope-variables/_config.js000066400000000000000000000001241415504077600254750ustar00rootroot00000000000000module.exports = { description: 'handles variable declarations in catch scopes' }; rollup-2.61.1/test/function/samples/catch-scope-variables/main.js000066400000000000000000000004431415504077600250210ustar00rootroot00000000000000var 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-2.61.1/test/function/samples/chained-mutable-array-methods/000077500000000000000000000000001415504077600251765ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/chained-mutable-array-methods/_config.js000066400000000000000000000003571415504077600271450ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'recognizes side-effects when applying mutable array methods to chained array methods (#3555)', exports(exports) { assert.deepStrictEqual(exports.a, ['PASS']); } }; rollup-2.61.1/test/function/samples/chained-mutable-array-methods/main.js000066400000000000000000000001521415504077600264560ustar00rootroot00000000000000function f(x) { return (x ? [] : ['FAIL']).map(o => o); } export const a = f(0); a.splice(0, 1, 'PASS'); rollup-2.61.1/test/function/samples/check-resolve-for-entry/000077500000000000000000000000001415504077600240545ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/check-resolve-for-entry/_config.js000066400000000000000000000004061415504077600260160ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/chunk-external-dependency-execution-order/000077500000000000000000000000001415504077600275555ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/chunk-external-dependency-execution-order/_config.js000066400000000000000000000007211415504077600315170ustar00rootroot00000000000000const assert = require('assert'); const executionOrder = []; module.exports = { 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-2.61.1/test/function/samples/chunk-external-dependency-execution-order/dep.js000066400000000000000000000000661415504077600306650ustar00rootroot00000000000000import 'external-second'; executionOrder.push('dep'); rollup-2.61.1/test/function/samples/chunk-external-dependency-execution-order/main.js000066400000000000000000000001111415504077600310300ustar00rootroot00000000000000import 'external-first'; import './dep.js'; executionOrder.push('main'); rollup-2.61.1/test/function/samples/chunking-duplicate-reexport/000077500000000000000000000000001415504077600250235ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/chunking-duplicate-reexport/_config.js000066400000000000000000000003731415504077600267700ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'handles duplicate reexports when using dynamic imports', exports(exports) { return exports.then(result => assert.deepStrictEqual(result, [{ answer: 42 }, { answer: 42 }])); } }; rollup-2.61.1/test/function/samples/chunking-duplicate-reexport/chunk1.js000066400000000000000000000000431415504077600265470ustar00rootroot00000000000000export { answer } from './lib.js'; rollup-2.61.1/test/function/samples/chunking-duplicate-reexport/chunk2.js000066400000000000000000000000431415504077600265500ustar00rootroot00000000000000export { answer } from './lib.js'; rollup-2.61.1/test/function/samples/chunking-duplicate-reexport/lib.js000066400000000000000000000000321415504077600261220ustar00rootroot00000000000000export const answer = 42; rollup-2.61.1/test/function/samples/chunking-duplicate-reexport/main.js000066400000000000000000000001141415504077600263010ustar00rootroot00000000000000export default Promise.all([import('./chunk1.js'), import('./chunk2.js')]); rollup-2.61.1/test/function/samples/circular-default-exports/000077500000000000000000000000001415504077600243275ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/circular-default-exports/_config.js000066400000000000000000000003601415504077600262700ustar00rootroot00000000000000module.exports = { description: 'handles circular default exports', warnings: [ { code: 'CIRCULAR_DEPENDENCY', cycle: ['main.js', 'main.js'], importer: 'main.js', message: 'Circular dependency: main.js -> main.js' } ] }; rollup-2.61.1/test/function/samples/circular-default-exports/main.js000066400000000000000000000000621415504077600256070ustar00rootroot00000000000000import foo from './main.js'; export default foo; rollup-2.61.1/test/function/samples/circular-missed-reexports-2/000077500000000000000000000000001415504077600246555ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/circular-missed-reexports-2/_config.js000066400000000000000000000010011415504077600266070ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { description: 'handles circular reexports', exports(exports) { assert.strictEqual(exports.exists, 42); }, error: { code: 'CIRCULAR_REEXPORT', id: path.join(__dirname, 'dep1.js'), message: '"doesNotExist" cannot be exported from dep1.js as it is a reexport that references itself.', watchFiles: [ path.join(__dirname, 'main.js'), path.join(__dirname, 'dep1.js'), path.join(__dirname, 'dep2.js') ] } }; rollup-2.61.1/test/function/samples/circular-missed-reexports-2/dep1.js000066400000000000000000000000521415504077600260410ustar00rootroot00000000000000export { doesNotExist } from './dep2.js'; rollup-2.61.1/test/function/samples/circular-missed-reexports-2/dep2.js000066400000000000000000000000521415504077600260420ustar00rootroot00000000000000export { doesNotExist } from './dep1.js'; rollup-2.61.1/test/function/samples/circular-missed-reexports-2/main.js000066400000000000000000000000521415504077600261340ustar00rootroot00000000000000export { doesNotExist } from './dep1.js'; rollup-2.61.1/test/function/samples/circular-missed-reexports/000077500000000000000000000000001415504077600245165ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/circular-missed-reexports/_config.js000066400000000000000000000017511415504077600264640ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const ID_MAIN = path.join(__dirname, 'main.js'); const ID_DEP1 = path.join(__dirname, 'dep1.js'); module.exports = { description: 'handles circular reexports', exports(exports) { assert.strictEqual(exports.exists, 42); }, warnings: [ { code: 'CIRCULAR_DEPENDENCY', cycle: ['dep1.js', 'dep2.js', 'dep1.js'], importer: 'dep1.js', message: 'Circular dependency: dep1.js -> dep2.js -> dep1.js' }, { code: 'CIRCULAR_DEPENDENCY', cycle: ['dep1.js', 'dep1.js'], importer: 'dep1.js', message: 'Circular dependency: dep1.js -> dep1.js' }, { code: 'NON_EXISTENT_EXPORT', message: "Non-existent export 'doesNotExist' is imported from dep1.js", name: 'doesNotExist', source: ID_DEP1, id: ID_MAIN, pos: 17, loc: { file: ID_MAIN, line: 1, column: 17 }, frame: ` 1: import { exists, doesNotExist } from './dep1.js'; ^ 2: export { exists };` } ] }; rollup-2.61.1/test/function/samples/circular-missed-reexports/dep1.js000066400000000000000000000003051415504077600257030ustar00rootroot00000000000000export * 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-2.61.1/test/function/samples/circular-missed-reexports/dep2.js000066400000000000000000000001131415504077600257010ustar00rootroot00000000000000export * from './dep1.js'; export { exists2 as exists1 } from './dep1.js'; rollup-2.61.1/test/function/samples/circular-missed-reexports/main.js000066400000000000000000000001051415504077600257740ustar00rootroot00000000000000import { exists, doesNotExist } from './dep1.js'; export { exists }; rollup-2.61.1/test/function/samples/circular-preserve-modules/000077500000000000000000000000001415504077600245025ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/circular-preserve-modules/_config.js000066400000000000000000000037101415504077600264450ustar00rootroot00000000000000const path = require('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 = { description: 'correctly handles circular dependencies whe preserving modules', options: { output: { preserveModules: true } }, warnings: [ { code: 'CIRCULAR_DEPENDENCY', cycle: ['main.js', 'first.js', 'main.js'], importer: 'main.js', message: 'Circular dependency: main.js -> first.js -> main.js' }, { code: 'CIRCULAR_DEPENDENCY', cycle: ['main.js', 'second.js', 'main.js'], importer: 'main.js', message: 'Circular dependency: main.js -> second.js -> main.js' }, { code: 'CYCLIC_CROSS_CHUNK_REEXPORT', exporter: ID_SECOND, importer: 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 "preserveModules" to ensure these modules end up in the same chunk.', reexporter: ID_MAIN }, { code: 'CYCLIC_CROSS_CHUNK_REEXPORT', exporter: ID_FIRST, importer: 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 "preserveModules" to ensure these modules end up in the same chunk.', reexporter: ID_MAIN } ] }; rollup-2.61.1/test/function/samples/circular-preserve-modules/first.js000066400000000000000000000001511415504077600261640ustar00rootroot00000000000000import { second } from './main.js'; export const first = 'first'; export const getSecond = () => second; rollup-2.61.1/test/function/samples/circular-preserve-modules/main.js000066400000000000000000000003371415504077600257670ustar00rootroot00000000000000import { getSecond } from './first'; import { second, getFirst } from './second'; export { first } from './first.js'; export { second }; assert.strictEqual(getFirst(), 'first'); assert.strictEqual(getSecond(), 'second'); rollup-2.61.1/test/function/samples/circular-preserve-modules/second.js000066400000000000000000000001501415504077600263070ustar00rootroot00000000000000import { first } from './main.js'; export const second = 'second'; export const getFirst = () => first; rollup-2.61.1/test/function/samples/class-methods-not-renamed/000077500000000000000000000000001415504077600243545ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/class-methods-not-renamed/_config.js000066400000000000000000000001651415504077600263200ustar00rootroot00000000000000module.exports = { description: 'does not rename class methods incorrectly', options: { external: ['path'] } }; rollup-2.61.1/test/function/samples/class-methods-not-renamed/foo.js000066400000000000000000000002721415504077600254760ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/class-methods-not-renamed/main.js000066400000000000000000000000701415504077600256330ustar00rootroot00000000000000import Foo from './foo'; assert.ok( new Foo().bar() ); rollup-2.61.1/test/function/samples/code-splitting-export-default-from-entry/000077500000000000000000000000001415504077600273655ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/code-splitting-export-default-from-entry/_config.js000066400000000000000000000003631415504077600313310ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'correctly imports the default from an entry point', options: { input: ['main', 'dep'] }, exports(exports) { assert.deepStrictEqual(exports, { value: 42 }); } }; rollup-2.61.1/test/function/samples/code-splitting-export-default-from-entry/dep.js000066400000000000000000000000231415504077600304660ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/code-splitting-export-default-from-entry/main.js000066400000000000000000000000501415504077600306420ustar00rootroot00000000000000export {default as value} from './dep'; rollup-2.61.1/test/function/samples/compact-multiple-imports/000077500000000000000000000000001415504077600243515ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/compact-multiple-imports/_config.js000066400000000000000000000004271415504077600263160ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/compact-multiple-imports/main.js000066400000000000000000000002721415504077600256340ustar00rootroot00000000000000import '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-2.61.1/test/function/samples/compact/000077500000000000000000000000001415504077600210255ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/compact/_config.js000066400000000000000000000006131415504077600227670ustar00rootroot00000000000000module.exports = { description: 'compact output with compact: true', options: { external: ['external'], output: { compact: true, namespaceToStringTag: true } }, warnings: [ { code: 'CIRCULAR_DEPENDENCY', cycle: ['main.js', 'main.js'], importer: 'main.js', message: 'Circular dependency: main.js -> main.js' } ], context: { require() { return 42; } } }; rollup-2.61.1/test/function/samples/compact/main.js000066400000000000000000000003711415504077600223100ustar00rootroot00000000000000import 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-2.61.1/test/function/samples/conditional-catch/000077500000000000000000000000001415504077600227625ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/conditional-catch/_config.js000066400000000000000000000001171415504077600247230ustar00rootroot00000000000000module.exports = { description: 'handles conditional catch blocks (#3869)' }; rollup-2.61.1/test/function/samples/conditional-catch/main.js000066400000000000000000000003001415504077600242350ustar00rootroot00000000000000function g() { var result; g: { try { break g; } catch (_) {} return; } try { throw 'Expected'; } catch (e) { result = e; } assert.strictEqual(result, 'Expected'); } g(); rollup-2.61.1/test/function/samples/conditional-definition/000077500000000000000000000000001415504077600240305ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/conditional-definition/_config.js000066400000000000000000000001401415504077600257650ustar00rootroot00000000000000module.exports = { description: 'avoids infinite loop when testing conditional definitions' }; rollup-2.61.1/test/function/samples/conditional-definition/env.js000066400000000000000000000002441415504077600251560ustar00rootroot00000000000000var env; if ( typeof window !== 'undefined' ) { env = function () { return 'browser'; }; } else { env = function () { return 'node'; }; } export { env }; rollup-2.61.1/test/function/samples/conditional-definition/main.js000066400000000000000000000002251415504077600253110ustar00rootroot00000000000000import { env } from './env'; assert.equal( env(), 'node' ); assert.equal( env(), 'node' ); // to check that the env Declaration is only tested once rollup-2.61.1/test/function/samples/conditionals-deoptimization/000077500000000000000000000000001415504077600251225ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/conditionals-deoptimization/_config.js000066400000000000000000000003451415504077600270660ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'handles deoptimization of conditionals', exports(exports) { assert.deepStrictEqual(exports, { first: true, second: true, third: true, fourth: true }); } }; rollup-2.61.1/test/function/samples/conditionals-deoptimization/main.js000066400000000000000000000006031415504077600264030ustar00rootroot00000000000000export let first = false; export let second = false; export let third = false; export let fourth = false; let flag = false; checkConditional(); checkLogical(); flag = true; checkConditional(); checkLogical(); function checkConditional() { if (flag ? true : false) first = true; else second = true; } function checkLogical() { if (flag && true) third = true; else fourth = true; } rollup-2.61.1/test/function/samples/configure-external-module-b/000077500000000000000000000000001415504077600247025ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/configure-external-module-b/_config.js000066400000000000000000000003461415504077600266470ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'allows external module to be configured (b)', options: { external: ['path'] }, exports() { assert.equal(require('path').resolve.configured, 'yes'); } }; rollup-2.61.1/test/function/samples/configure-external-module-b/main.js000066400000000000000000000000751415504077600261660ustar00rootroot00000000000000import { resolve } from 'path'; resolve.configured = 'yes'; rollup-2.61.1/test/function/samples/configure-external-module/000077500000000000000000000000001415504077600244635ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/configure-external-module/_config.js000066400000000000000000000003421415504077600264240ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'allows external module to be configured', options: { external: ['path'] }, exports() { assert.equal(require('path').resolve.configured, 'yes'); } }; rollup-2.61.1/test/function/samples/configure-external-module/main.js000066400000000000000000000001001415504077600257340ustar00rootroot00000000000000import * as path from 'path'; path.resolve.configured = 'yes'; rollup-2.61.1/test/function/samples/configure-relative-external-module/000077500000000000000000000000001415504077600262745ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/configure-relative-external-module/_config.js000066400000000000000000000006461415504077600302440ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const mockedValue = { val: 'A value' }; module.exports = { 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-2.61.1/test/function/samples/configure-relative-external-module/main.js000066400000000000000000000001401415504077600275510ustar00rootroot00000000000000import relativeDep from './nonexistent-relative-dependency.js'; relativeDep.wasAltered = true; rollup-2.61.1/test/function/samples/conflicting-reexports/000077500000000000000000000000001415504077600237275ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/conflicting-reexports/named-import-external/000077500000000000000000000000001415504077600301435ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/conflicting-reexports/named-import-external/_config.js000066400000000000000000000015021415504077600321030ustar00rootroot00000000000000const path = require('path'); const REEXPORT_ID = path.join(__dirname, 'reexport.js'); module.exports = { description: 'warns when a conflicting binding is imported via a named import from external namespaces', warnings: [ { code: 'AMBIGUOUS_EXTERNAL_NAMESPACES', message: 'Ambiguous external namespace resolution: "reexport.js" re-exports "foo" from one of the external modules "first" and "second", guessing "first".', name: 'foo', reexporter: REEXPORT_ID, sources: ['first', 'second'] }, { code: 'UNUSED_EXTERNAL_IMPORT', message: '"foo" is imported from external module "second" but never used in "reexport.js".', names: ['foo'], source: 'second', sources: [REEXPORT_ID] } ], options: { external: ['first', 'second'] }, context: { require(id) { return { foo: id }; } } }; rollup-2.61.1/test/function/samples/conflicting-reexports/named-import-external/_expected/000077500000000000000000000000001415504077600321035ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/conflicting-reexports/named-import-external/_expected/amd.js000066400000000000000000000013701415504077600332030ustar00rootroot00000000000000define(['exports', 'external'], function (exports, external) { 'use strict'; const renamedIndirectOverride = external.indirectOverride; Object.defineProperty(exports, 'noOverride', { enumerable: true, get: function () { return external.noOverride; } }); Object.defineProperty(exports, 'renamedDirectOverride', { enumerable: true, get: function () { return external.directOverride; } }); exports.renamedIndirectOverride = renamedIndirectOverride; Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); }); rollup-2.61.1/test/function/samples/conflicting-reexports/named-import-external/_expected/cjs.js000066400000000000000000000013021415504077600332140ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var external = require('external'); const renamedIndirectOverride = external.indirectOverride; Object.defineProperty(exports, 'noOverride', { enumerable: true, get: function () { return external.noOverride; } }); Object.defineProperty(exports, 'renamedDirectOverride', { enumerable: true, get: function () { return external.directOverride; } }); exports.renamedIndirectOverride = renamedIndirectOverride; Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); rollup-2.61.1/test/function/samples/conflicting-reexports/named-import-external/_expected/es.js000066400000000000000000000003571415504077600330550ustar00rootroot00000000000000import { indirectOverride } from 'external'; export * from 'external'; export { noOverride, directOverride as renamedDirectOverride } from 'external'; const renamedIndirectOverride = indirectOverride; export { renamedIndirectOverride }; rollup-2.61.1/test/function/samples/conflicting-reexports/named-import-external/_expected/iife.js000066400000000000000000000014071415504077600333570ustar00rootroot00000000000000var bundle = (function (exports, external) { 'use strict'; const renamedIndirectOverride = external.indirectOverride; Object.defineProperty(exports, 'noOverride', { enumerable: true, get: function () { return external.noOverride; } }); Object.defineProperty(exports, 'renamedDirectOverride', { enumerable: true, get: function () { return external.directOverride; } }); exports.renamedIndirectOverride = renamedIndirectOverride; Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; }({}, external)); rollup-2.61.1/test/function/samples/conflicting-reexports/named-import-external/_expected/system.js000066400000000000000000000012261415504077600337660ustar00rootroot00000000000000System.register('bundle', ['external'], function (exports) { 'use strict'; var _starExcludes = { renamedIndirectOverride: 1, default: 1, noOverride: 1, renamedDirectOverride: 1 }; var indirectOverride; return { setters: [function (module) { indirectOverride = module.indirectOverride; var _setter = {}; for (var _$p in module) { if (!_starExcludes[_$p]) _setter[_$p] = module[_$p]; } _setter.noOverride = module.noOverride; _setter.renamedDirectOverride = module.directOverride; exports(_setter); }], execute: function () { const renamedIndirectOverride = exports('renamedIndirectOverride', indirectOverride); } }; }); rollup-2.61.1/test/function/samples/conflicting-reexports/named-import-external/_expected/umd.js000066400000000000000000000020751415504077600332320ustar00rootroot00000000000000(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, 'noOverride', { enumerable: true, get: function () { return external.noOverride; } }); Object.defineProperty(exports, 'renamedDirectOverride', { enumerable: true, get: function () { return external.directOverride; } }); exports.renamedIndirectOverride = renamedIndirectOverride; Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); }))); rollup-2.61.1/test/function/samples/conflicting-reexports/named-import-external/main.js000066400000000000000000000001101415504077600314150ustar00rootroot00000000000000import { foo } from './reexport.js'; assert.strictEqual(foo, 'first'); rollup-2.61.1/test/function/samples/conflicting-reexports/named-import-external/reexport.js000066400000000000000000000000571415504077600323530ustar00rootroot00000000000000export * from 'first'; export * from 'second'; rollup-2.61.1/test/function/samples/conflicting-reexports/named-import/000077500000000000000000000000001415504077600263235ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/conflicting-reexports/named-import/_config.js000066400000000000000000000012771415504077600302740ustar00rootroot00000000000000const path = require('path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = { description: 'throws when a conflicting binding is imported via a named import', error: { code: 'MISSING_EXPORT', frame: ` 1: import { foo } from './reexport.js'; ^ 2: 3: assert.strictEqual(foo, 1);`, id: ID_MAIN, loc: { column: 9, file: ID_MAIN, line: 1 }, message: "'foo' is not exported by reexport.js, imported by main.js", pos: 9, url: 'https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module', watchFiles: [ ID_MAIN, path.join(__dirname, 'reexport.js'), path.join(__dirname, 'first.js'), path.join(__dirname, 'second.js') ] } }; rollup-2.61.1/test/function/samples/conflicting-reexports/named-import/_expected/000077500000000000000000000000001415504077600302635ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/conflicting-reexports/named-import/_expected/amd.js000066400000000000000000000013701415504077600313630ustar00rootroot00000000000000define(['exports', 'external'], function (exports, external) { 'use strict'; const renamedIndirectOverride = external.indirectOverride; Object.defineProperty(exports, 'noOverride', { enumerable: true, get: function () { return external.noOverride; } }); Object.defineProperty(exports, 'renamedDirectOverride', { enumerable: true, get: function () { return external.directOverride; } }); exports.renamedIndirectOverride = renamedIndirectOverride; Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); }); rollup-2.61.1/test/function/samples/conflicting-reexports/named-import/_expected/cjs.js000066400000000000000000000013021415504077600313740ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var external = require('external'); const renamedIndirectOverride = external.indirectOverride; Object.defineProperty(exports, 'noOverride', { enumerable: true, get: function () { return external.noOverride; } }); Object.defineProperty(exports, 'renamedDirectOverride', { enumerable: true, get: function () { return external.directOverride; } }); exports.renamedIndirectOverride = renamedIndirectOverride; Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); rollup-2.61.1/test/function/samples/conflicting-reexports/named-import/_expected/es.js000066400000000000000000000003571415504077600312350ustar00rootroot00000000000000import { indirectOverride } from 'external'; export * from 'external'; export { noOverride, directOverride as renamedDirectOverride } from 'external'; const renamedIndirectOverride = indirectOverride; export { renamedIndirectOverride }; rollup-2.61.1/test/function/samples/conflicting-reexports/named-import/_expected/iife.js000066400000000000000000000014071415504077600315370ustar00rootroot00000000000000var bundle = (function (exports, external) { 'use strict'; const renamedIndirectOverride = external.indirectOverride; Object.defineProperty(exports, 'noOverride', { enumerable: true, get: function () { return external.noOverride; } }); Object.defineProperty(exports, 'renamedDirectOverride', { enumerable: true, get: function () { return external.directOverride; } }); exports.renamedIndirectOverride = renamedIndirectOverride; Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; }({}, external)); rollup-2.61.1/test/function/samples/conflicting-reexports/named-import/_expected/system.js000066400000000000000000000012261415504077600321460ustar00rootroot00000000000000System.register('bundle', ['external'], function (exports) { 'use strict'; var _starExcludes = { renamedIndirectOverride: 1, default: 1, noOverride: 1, renamedDirectOverride: 1 }; var indirectOverride; return { setters: [function (module) { indirectOverride = module.indirectOverride; var _setter = {}; for (var _$p in module) { if (!_starExcludes[_$p]) _setter[_$p] = module[_$p]; } _setter.noOverride = module.noOverride; _setter.renamedDirectOverride = module.directOverride; exports(_setter); }], execute: function () { const renamedIndirectOverride = exports('renamedIndirectOverride', indirectOverride); } }; }); rollup-2.61.1/test/function/samples/conflicting-reexports/named-import/_expected/umd.js000066400000000000000000000020751415504077600314120ustar00rootroot00000000000000(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, 'noOverride', { enumerable: true, get: function () { return external.noOverride; } }); Object.defineProperty(exports, 'renamedDirectOverride', { enumerable: true, get: function () { return external.directOverride; } }); exports.renamedIndirectOverride = renamedIndirectOverride; Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); }))); rollup-2.61.1/test/function/samples/conflicting-reexports/named-import/first.js000066400000000000000000000000261415504077600300060ustar00rootroot00000000000000export const foo = 1; rollup-2.61.1/test/function/samples/conflicting-reexports/named-import/main.js000066400000000000000000000001021415504077600275760ustar00rootroot00000000000000import { foo } from './reexport.js'; assert.strictEqual(foo, 1); rollup-2.61.1/test/function/samples/conflicting-reexports/named-import/reexport.js000066400000000000000000000000711415504077600305270ustar00rootroot00000000000000export * from './first.js'; export * from './second.js'; rollup-2.61.1/test/function/samples/conflicting-reexports/named-import/second.js000066400000000000000000000000261415504077600301320ustar00rootroot00000000000000export const foo = 2; rollup-2.61.1/test/function/samples/conflicting-reexports/namespace-import/000077500000000000000000000000001415504077600271735ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/conflicting-reexports/namespace-import/_config.js000066400000000000000000000017541415504077600311440ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'warns when a conflicting binding is imported via a namespace import', warnings: [ { code: 'NAMESPACE_CONFLICT', message: 'Conflicting namespaces: "reexport.js" re-exports "foo" from both "first.js" and "second.js" (will be ignored)', name: 'foo', reexporter: path.join(__dirname, 'reexport.js'), sources: [path.join(__dirname, 'first.js'), path.join(__dirname, 'second.js')] }, { code: 'MISSING_EXPORT', exporter: 'reexport.js', frame: ` 2: 3: assert.deepStrictEqual(ns, { __proto__: null, bar: 1, baz: 2 }); 4: assert.strictEqual(ns.foo, undefined) ^`, id: path.join(__dirname, 'main.js'), importer: 'main.js', loc: { column: 22, file: path.join(__dirname, 'main.js'), line: 4 }, message: "'foo' is not exported by 'reexport.js'", missing: 'foo', pos: 125, url: 'https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module' } ] }; rollup-2.61.1/test/function/samples/conflicting-reexports/namespace-import/_expected/000077500000000000000000000000001415504077600311335ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/conflicting-reexports/namespace-import/_expected/amd.js000066400000000000000000000013701415504077600322330ustar00rootroot00000000000000define(['exports', 'external'], function (exports, external) { 'use strict'; const renamedIndirectOverride = external.indirectOverride; Object.defineProperty(exports, 'noOverride', { enumerable: true, get: function () { return external.noOverride; } }); Object.defineProperty(exports, 'renamedDirectOverride', { enumerable: true, get: function () { return external.directOverride; } }); exports.renamedIndirectOverride = renamedIndirectOverride; Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); }); rollup-2.61.1/test/function/samples/conflicting-reexports/namespace-import/_expected/cjs.js000066400000000000000000000013021415504077600322440ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var external = require('external'); const renamedIndirectOverride = external.indirectOverride; Object.defineProperty(exports, 'noOverride', { enumerable: true, get: function () { return external.noOverride; } }); Object.defineProperty(exports, 'renamedDirectOverride', { enumerable: true, get: function () { return external.directOverride; } }); exports.renamedIndirectOverride = renamedIndirectOverride; Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); rollup-2.61.1/test/function/samples/conflicting-reexports/namespace-import/_expected/es.js000066400000000000000000000003571415504077600321050ustar00rootroot00000000000000import { indirectOverride } from 'external'; export * from 'external'; export { noOverride, directOverride as renamedDirectOverride } from 'external'; const renamedIndirectOverride = indirectOverride; export { renamedIndirectOverride }; rollup-2.61.1/test/function/samples/conflicting-reexports/namespace-import/_expected/iife.js000066400000000000000000000014071415504077600324070ustar00rootroot00000000000000var bundle = (function (exports, external) { 'use strict'; const renamedIndirectOverride = external.indirectOverride; Object.defineProperty(exports, 'noOverride', { enumerable: true, get: function () { return external.noOverride; } }); Object.defineProperty(exports, 'renamedDirectOverride', { enumerable: true, get: function () { return external.directOverride; } }); exports.renamedIndirectOverride = renamedIndirectOverride; Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; }({}, external)); rollup-2.61.1/test/function/samples/conflicting-reexports/namespace-import/_expected/system.js000066400000000000000000000012261415504077600330160ustar00rootroot00000000000000System.register('bundle', ['external'], function (exports) { 'use strict'; var _starExcludes = { renamedIndirectOverride: 1, default: 1, noOverride: 1, renamedDirectOverride: 1 }; var indirectOverride; return { setters: [function (module) { indirectOverride = module.indirectOverride; var _setter = {}; for (var _$p in module) { if (!_starExcludes[_$p]) _setter[_$p] = module[_$p]; } _setter.noOverride = module.noOverride; _setter.renamedDirectOverride = module.directOverride; exports(_setter); }], execute: function () { const renamedIndirectOverride = exports('renamedIndirectOverride', indirectOverride); } }; }); rollup-2.61.1/test/function/samples/conflicting-reexports/namespace-import/_expected/umd.js000066400000000000000000000020751415504077600322620ustar00rootroot00000000000000(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, 'noOverride', { enumerable: true, get: function () { return external.noOverride; } }); Object.defineProperty(exports, 'renamedDirectOverride', { enumerable: true, get: function () { return external.directOverride; } }); exports.renamedIndirectOverride = renamedIndirectOverride; Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); }))); rollup-2.61.1/test/function/samples/conflicting-reexports/namespace-import/first.js000066400000000000000000000000541415504077600306570ustar00rootroot00000000000000export const foo = 1; export const bar = 1; rollup-2.61.1/test/function/samples/conflicting-reexports/namespace-import/main.js000066400000000000000000000002141415504077600304520ustar00rootroot00000000000000import * as ns from './reexport.js'; assert.deepStrictEqual(ns, { __proto__: null, bar: 1, baz: 2 }); assert.strictEqual(ns.foo, undefined)rollup-2.61.1/test/function/samples/conflicting-reexports/namespace-import/reexport.js000066400000000000000000000000711415504077600313770ustar00rootroot00000000000000export * from './first.js'; export * from './second.js'; rollup-2.61.1/test/function/samples/conflicting-reexports/namespace-import/second.js000066400000000000000000000000541415504077600310030ustar00rootroot00000000000000export const foo = 2; export const baz = 2; rollup-2.61.1/test/function/samples/conflicting-reexports/same-binding/000077500000000000000000000000001415504077600262645ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/conflicting-reexports/same-binding/_config.js000066400000000000000000000001551415504077600302270ustar00rootroot00000000000000module.exports = { description: 'does not fail when the same binding is reexported from different files' }; rollup-2.61.1/test/function/samples/conflicting-reexports/same-binding/_expected/000077500000000000000000000000001415504077600302245ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/conflicting-reexports/same-binding/_expected/amd.js000066400000000000000000000013701415504077600313240ustar00rootroot00000000000000define(['exports', 'external'], function (exports, external) { 'use strict'; const renamedIndirectOverride = external.indirectOverride; Object.defineProperty(exports, 'noOverride', { enumerable: true, get: function () { return external.noOverride; } }); Object.defineProperty(exports, 'renamedDirectOverride', { enumerable: true, get: function () { return external.directOverride; } }); exports.renamedIndirectOverride = renamedIndirectOverride; Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); }); rollup-2.61.1/test/function/samples/conflicting-reexports/same-binding/_expected/cjs.js000066400000000000000000000013021415504077600313350ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var external = require('external'); const renamedIndirectOverride = external.indirectOverride; Object.defineProperty(exports, 'noOverride', { enumerable: true, get: function () { return external.noOverride; } }); Object.defineProperty(exports, 'renamedDirectOverride', { enumerable: true, get: function () { return external.directOverride; } }); exports.renamedIndirectOverride = renamedIndirectOverride; Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); rollup-2.61.1/test/function/samples/conflicting-reexports/same-binding/_expected/es.js000066400000000000000000000003571415504077600311760ustar00rootroot00000000000000import { indirectOverride } from 'external'; export * from 'external'; export { noOverride, directOverride as renamedDirectOverride } from 'external'; const renamedIndirectOverride = indirectOverride; export { renamedIndirectOverride }; rollup-2.61.1/test/function/samples/conflicting-reexports/same-binding/_expected/iife.js000066400000000000000000000014071415504077600315000ustar00rootroot00000000000000var bundle = (function (exports, external) { 'use strict'; const renamedIndirectOverride = external.indirectOverride; Object.defineProperty(exports, 'noOverride', { enumerable: true, get: function () { return external.noOverride; } }); Object.defineProperty(exports, 'renamedDirectOverride', { enumerable: true, get: function () { return external.directOverride; } }); exports.renamedIndirectOverride = renamedIndirectOverride; Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); return exports; }({}, external)); rollup-2.61.1/test/function/samples/conflicting-reexports/same-binding/_expected/system.js000066400000000000000000000012261415504077600321070ustar00rootroot00000000000000System.register('bundle', ['external'], function (exports) { 'use strict'; var _starExcludes = { renamedIndirectOverride: 1, default: 1, noOverride: 1, renamedDirectOverride: 1 }; var indirectOverride; return { setters: [function (module) { indirectOverride = module.indirectOverride; var _setter = {}; for (var _$p in module) { if (!_starExcludes[_$p]) _setter[_$p] = module[_$p]; } _setter.noOverride = module.noOverride; _setter.renamedDirectOverride = module.directOverride; exports(_setter); }], execute: function () { const renamedIndirectOverride = exports('renamedIndirectOverride', indirectOverride); } }; }); rollup-2.61.1/test/function/samples/conflicting-reexports/same-binding/_expected/umd.js000066400000000000000000000020751415504077600313530ustar00rootroot00000000000000(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, 'noOverride', { enumerable: true, get: function () { return external.noOverride; } }); Object.defineProperty(exports, 'renamedDirectOverride', { enumerable: true, get: function () { return external.directOverride; } }); exports.renamedIndirectOverride = renamedIndirectOverride; Object.keys(external).forEach(function (k) { if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, { enumerable: true, get: function () { return external[k]; } }); }); Object.defineProperty(exports, '__esModule', { value: true }); }))); rollup-2.61.1/test/function/samples/conflicting-reexports/same-binding/first.js000066400000000000000000000000431415504077600277460ustar00rootroot00000000000000export { foo } from './shared.js'; rollup-2.61.1/test/function/samples/conflicting-reexports/same-binding/main.js000066400000000000000000000001021415504077600275370ustar00rootroot00000000000000import { foo } from './reexport.js'; assert.strictEqual(foo, 1); rollup-2.61.1/test/function/samples/conflicting-reexports/same-binding/reexport.js000066400000000000000000000000711415504077600304700ustar00rootroot00000000000000export * from './first.js'; export * from './second.js'; rollup-2.61.1/test/function/samples/conflicting-reexports/same-binding/second.js000066400000000000000000000000431415504077600300720ustar00rootroot00000000000000export { foo } from './shared.js'; rollup-2.61.1/test/function/samples/conflicting-reexports/same-binding/shared.js000066400000000000000000000000261415504077600300660ustar00rootroot00000000000000export const foo = 1; rollup-2.61.1/test/function/samples/confused-default-identifier/000077500000000000000000000000001415504077600247475ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/confused-default-identifier/_config.js000066400000000000000000000002731415504077600267130ustar00rootroot00000000000000module.exports = { description: 'Rollup should not get confused and allow "default" as an identifier name', warnings() {} // suppress }; // https://github.com/rollup/rollup/issues/215 rollup-2.61.1/test/function/samples/confused-default-identifier/foo.js000066400000000000000000000000441415504077600260660ustar00rootroot00000000000000export default function Foo () { } rollup-2.61.1/test/function/samples/confused-default-identifier/main.js000066400000000000000000000001361415504077600262310ustar00rootroot00000000000000// export export {default as Foo} from './foo'; export default function () { // whatever } rollup-2.61.1/test/function/samples/consistent-renaming-b/000077500000000000000000000000001415504077600236055ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/consistent-renaming-b/_config.js000066400000000000000000000001011415504077600255370ustar00rootroot00000000000000module.exports = { description: 'consistent renaming test b' }; rollup-2.61.1/test/function/samples/consistent-renaming-b/altdir/000077500000000000000000000000001415504077600250645ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/consistent-renaming-b/altdir/two.js000066400000000000000000000001261415504077600262320ustar00rootroot00000000000000function two () { // imported as _two by subdir/two.js return 2; } export { two }; rollup-2.61.1/test/function/samples/consistent-renaming-b/main.js000066400000000000000000000001651415504077600250710ustar00rootroot00000000000000import one from './subdir/one'; import Two from './subdir/two'; assert.equal( one(), 1 ); assert.equal( Two(), 2 ); rollup-2.61.1/test/function/samples/consistent-renaming-b/subdir/000077500000000000000000000000001415504077600250755ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/consistent-renaming-b/subdir/one.js000066400000000000000000000001341415504077600262120ustar00rootroot00000000000000import { two } from '../altdir/two'; export default function one () { return two() - 1; } rollup-2.61.1/test/function/samples/consistent-renaming-b/subdir/two.js000066400000000000000000000002001415504077600262340ustar00rootroot00000000000000import { two as _two } from '../altdir/two'; export default function two () { // imported as Two by main.js return _two(); } rollup-2.61.1/test/function/samples/consistent-renaming-c/000077500000000000000000000000001415504077600236065ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/consistent-renaming-c/-internal.js000066400000000000000000000001061415504077600260320ustar00rootroot00000000000000/*** -internal.js */ function two () { return 99; } export { two }; rollup-2.61.1/test/function/samples/consistent-renaming-c/_config.js000066400000000000000000000001011415504077600255400ustar00rootroot00000000000000module.exports = { description: 'consistent renaming test c' }; rollup-2.61.1/test/function/samples/consistent-renaming-c/main.js000066400000000000000000000002061415504077600250660ustar00rootroot00000000000000import One from './one'; import two from './two'; assert.equal( One(), 1 ); assert.equal( two(), 2 ); assert.equal( One.two(), 99 ); rollup-2.61.1/test/function/samples/consistent-renaming-c/one.js000066400000000000000000000002371415504077600247270ustar00rootroot00000000000000import three from './one/three'; import Two from './one/two'; export default function One () { return 1; } One.three = three; /*** one.js */ One.two = Two;rollup-2.61.1/test/function/samples/consistent-renaming-c/one/000077500000000000000000000000001415504077600243675ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/consistent-renaming-c/one/three.js000066400000000000000000000001361415504077600260340ustar00rootroot00000000000000import { two } from '../-internal'; export default function three () { return 1 + two(); } rollup-2.61.1/test/function/samples/consistent-renaming-c/one/two.js000066400000000000000000000001641415504077600255370ustar00rootroot00000000000000import { two as _two } from '../-internal'; /*** one/two.js */ export default function two () { return _two(); } rollup-2.61.1/test/function/samples/consistent-renaming-c/two.js000066400000000000000000000001271415504077600247550ustar00rootroot00000000000000import One from './one'; /*** two.js */ export default function two () { return 2; } rollup-2.61.1/test/function/samples/consistent-renaming-d/000077500000000000000000000000001415504077600236075ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/consistent-renaming-d/Baz.js000066400000000000000000000000751415504077600246630ustar00rootroot00000000000000function Baz () { this.isBaz = true; } export default Baz; rollup-2.61.1/test/function/samples/consistent-renaming-d/_config.js000066400000000000000000000001011415504077600255410ustar00rootroot00000000000000module.exports = { description: 'consistent renaming test d' }; rollup-2.61.1/test/function/samples/consistent-renaming-d/bar.js000066400000000000000000000002761415504077600247160ustar00rootroot00000000000000import 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-2.61.1/test/function/samples/consistent-renaming-d/foo.js000066400000000000000000000001171415504077600247270ustar00rootroot00000000000000import baz from './foo/baz'; export default function Foo () {} Foo.baz = baz;rollup-2.61.1/test/function/samples/consistent-renaming-d/foo/000077500000000000000000000000001415504077600243725ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/consistent-renaming-d/foo/baz.js000066400000000000000000000001221415504077600254770ustar00rootroot00000000000000import Baz from '../Baz'; export default function baz () { return new Baz(); } rollup-2.61.1/test/function/samples/consistent-renaming-d/main.js000066400000000000000000000002041415504077600250650ustar00rootroot00000000000000import Foo from './foo'; import bar from './bar'; var baz = Foo.baz(); assert.ok( baz.isBaz ); assert.ok( bar().inheritsFromBaz ); rollup-2.61.1/test/function/samples/consistent-renaming-e/000077500000000000000000000000001415504077600236105ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/consistent-renaming-e/_config.js000066400000000000000000000001011415504077600255420ustar00rootroot00000000000000module.exports = { description: 'consistent renaming test e' }; rollup-2.61.1/test/function/samples/consistent-renaming-e/a.js000066400000000000000000000002011415504077600243570ustar00rootroot00000000000000import { b } from './utils'; function c () { console.log( 'main/c' ); } export default function a () { return 'EH? ' + b(); } rollup-2.61.1/test/function/samples/consistent-renaming-e/b.js000066400000000000000000000001261415504077600243660ustar00rootroot00000000000000function c () { console.log( 'a/c' ); } export default function b () { return 42; } rollup-2.61.1/test/function/samples/consistent-renaming-e/main.js000066400000000000000000000001431415504077600250700ustar00rootroot00000000000000import a from './a'; import b from './b'; assert.equal( a(), 'EH? BEE' ); assert.equal( b(), 42 );rollup-2.61.1/test/function/samples/consistent-renaming-e/utils.js000066400000000000000000000000471415504077600253070ustar00rootroot00000000000000export function b () { return 'BEE'; }rollup-2.61.1/test/function/samples/consistent-renaming-f/000077500000000000000000000000001415504077600236115ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/consistent-renaming-f/_config.js000066400000000000000000000001011415504077600255430ustar00rootroot00000000000000module.exports = { description: 'consistent renaming test f' }; rollup-2.61.1/test/function/samples/consistent-renaming-f/bar.js000066400000000000000000000000701415504077600247100ustar00rootroot00000000000000export default function foo() { return 'consistent'; } rollup-2.61.1/test/function/samples/consistent-renaming-f/main.js000066400000000000000000000002011415504077600250640ustar00rootroot00000000000000import bar from './bar'; function test( foo ) { assert.equal(foo, 1); return bar(); } assert.equal( test(1), 'consistent' ); rollup-2.61.1/test/function/samples/consistent-renaming/000077500000000000000000000000001415504077600233665ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/consistent-renaming/_config.js000066400000000000000000000000771415504077600253340ustar00rootroot00000000000000module.exports = { description: 'consistent renaming test' }; rollup-2.61.1/test/function/samples/consistent-renaming/main.js000066400000000000000000000003221415504077600246450ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/consistent-renaming/one.js000066400000000000000000000000231415504077600245000ustar00rootroot00000000000000export var one = 1;rollup-2.61.1/test/function/samples/consistent-renaming/three.js000066400000000000000000000000251415504077600250300ustar00rootroot00000000000000export var three = 3;rollup-2.61.1/test/function/samples/consistent-renaming/two.js000066400000000000000000000001601415504077600245320ustar00rootroot00000000000000import { one as _one } from './one'; import { three as _three } from './three'; export var two = _three - _one;rollup-2.61.1/test/function/samples/consistently-renames-destructured-parameters/000077500000000000000000000000001415504077600304415ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/consistently-renames-destructured-parameters/_config.js000066400000000000000000000001331415504077600324000ustar00rootroot00000000000000module.exports = { description: 'destructured parameters are properly renamed (#2418)' }; rollup-2.61.1/test/function/samples/consistently-renames-destructured-parameters/main.js000066400000000000000000000011641415504077600317250ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/consistently-renames-destructured-parameters/module_1.js000066400000000000000000000001041415504077600324770ustar00rootroot00000000000000export function name() { return 'important to trigger renaming'; } rollup-2.61.1/test/function/samples/context-resolve-skipself/000077500000000000000000000000001415504077600243565ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/context-resolve-skipself/_config.js000066400000000000000000000020001415504077600263100ustar00rootroot00000000000000const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/context-resolve-skipself/existing.js000066400000000000000000000000311415504077600265400ustar00rootroot00000000000000console.log('existing'); rollup-2.61.1/test/function/samples/context-resolve-skipself/main.js000066400000000000000000000003441415504077600256410ustar00rootroot00000000000000import resolutions from 'resolutions'; assert.deepStrictEqual(resolutions, [ { id: 'own-resolution', text: 'all' }, { id: 'own-resolution', text: 'unskipped' }, { id: 'other-resolution', text: 'skipped' } ]); rollup-2.61.1/test/function/samples/context-resolve/000077500000000000000000000000001415504077600225405ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/context-resolve/_config.js000066400000000000000000000061321415504077600245040ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const tests = [ { source: './existing', expected: { id: path.join(__dirname, 'existing.js'), external: false, meta: {}, 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'), external: true, meta: {}, moduleSideEffects: true, syntheticNamedExports: false } }, { source: './marked-external-relative', expected: { id: path.join(__dirname, 'marked-external-relative'), external: true, meta: {}, moduleSideEffects: true, syntheticNamedExports: false } }, { source: 'marked-external-absolute', expected: { id: 'marked-external-absolute', external: true, meta: {}, moduleSideEffects: true, syntheticNamedExports: false } }, { source: 'resolved-name', expected: { id: 'resolved:resolved-name', external: false, meta: {}, moduleSideEffects: true, syntheticNamedExports: false } }, { source: 'resolved-false', expected: { id: 'resolved-false', external: true, meta: {}, moduleSideEffects: true, syntheticNamedExports: false } }, { source: 'resolved-object', expected: { id: 'resolved:resolved-object', external: false, meta: {}, moduleSideEffects: true, syntheticNamedExports: false } }, { source: 'resolved-object-non-external', expected: { id: 'resolved:resolved-object-non-external', external: false, meta: {}, moduleSideEffects: true, syntheticNamedExports: false } }, { source: 'resolved-object-external', expected: { id: 'resolved:resolved-object-external', external: true, meta: {}, moduleSideEffects: true, syntheticNamedExports: false } } ]; module.exports = { 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-2.61.1/test/function/samples/context-resolve/existing.js000066400000000000000000000000311415504077600247220ustar00rootroot00000000000000console.log('existing'); rollup-2.61.1/test/function/samples/context-resolve/main.js000066400000000000000000000001141415504077600240160ustar00rootroot00000000000000import resolutions from 'resolutions'; assert.strictEqual(resolutions,11); rollup-2.61.1/test/function/samples/correct-var-before-declaration-deopt/000077500000000000000000000000001415504077600264625ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/correct-var-before-declaration-deopt/_config.js000066400000000000000000000001241415504077600304210ustar00rootroot00000000000000module.exports = { description: 'adds necessary deoptimizations when using var' }; rollup-2.61.1/test/function/samples/correct-var-before-declaration-deopt/_expected.js000066400000000000000000000003751415504077600307650ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/correct-var-before-declaration-deopt/main.js000066400000000000000000000003001415504077600277350ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/create-undefined-export-property-compact/000077500000000000000000000000001415504077600274265ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/create-undefined-export-property-compact/_config.js000066400000000000000000000011251415504077600313670ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/create-undefined-export-property-compact/main.js000066400000000000000000000001661415504077600307130ustar00rootroot00000000000000export let foo; export let bar, quux = 3, baz; export function defineFooBar() { foo = 'defined'; bar = 'defined'; } rollup-2.61.1/test/function/samples/create-undefined-export-property/000077500000000000000000000000001415504077600260025ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/create-undefined-export-property/_config.js000066400000000000000000000010541415504077600277440ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/create-undefined-export-property/main.js000066400000000000000000000001661415504077600272670ustar00rootroot00000000000000export let foo; export let bar, quux = 3, baz; export function defineFooBar() { foo = 'defined'; bar = 'defined'; } rollup-2.61.1/test/function/samples/cross-chunk-live-binding-compact/000077500000000000000000000000001415504077600256275ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/cross-chunk-live-binding-compact/_config.js000066400000000000000000000007211415504077600275710ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/cross-chunk-live-binding-compact/main.js000066400000000000000000000001171415504077600271100ustar00rootroot00000000000000export { named, incrementNamed } from './named.js'; export * from './star.js'; rollup-2.61.1/test/function/samples/cross-chunk-live-binding-compact/named.js000066400000000000000000000001031415504077600272430ustar00rootroot00000000000000export let named = 0; export const incrementNamed = () => named++; rollup-2.61.1/test/function/samples/cross-chunk-live-binding-compact/star.js000066400000000000000000000001001415504077600271250ustar00rootroot00000000000000export let star = 0; export const incrementStar = () => star++; rollup-2.61.1/test/function/samples/cross-chunk-live-binding/000077500000000000000000000000001415504077600242035ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/cross-chunk-live-binding/_config.js000066400000000000000000000006371415504077600261530ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/cross-chunk-live-binding/main.js000066400000000000000000000001171415504077600254640ustar00rootroot00000000000000export { named, incrementNamed } from './named.js'; export * from './star.js'; rollup-2.61.1/test/function/samples/cross-chunk-live-binding/named.js000066400000000000000000000001031415504077600256170ustar00rootroot00000000000000export let named = 0; export const incrementNamed = () => named++; rollup-2.61.1/test/function/samples/cross-chunk-live-binding/star.js000066400000000000000000000001001415504077600255010ustar00rootroot00000000000000export let star = 0; export const incrementStar = () => star++; rollup-2.61.1/test/function/samples/custom-external-module-options/000077500000000000000000000000001415504077600255055ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/custom-external-module-options/_config.js000066400000000000000000000010021415504077600274400ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/custom-external-module-options/main.js000066400000000000000000000000231415504077600267620ustar00rootroot00000000000000import 'external'; rollup-2.61.1/test/function/samples/custom-external-resolver-async/000077500000000000000000000000001415504077600255035ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/custom-external-resolver-async/_config.js000066400000000000000000000006221415504077600274450ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/custom-external-resolver-async/js_modules/000077500000000000000000000000001415504077600276475ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/custom-external-resolver-async/js_modules/external.js000066400000000000000000000000451415504077600320260ustar00rootroot00000000000000export default { isExternal: true }; rollup-2.61.1/test/function/samples/custom-external-resolver-async/main.js000066400000000000000000000001231415504077600267610ustar00rootroot00000000000000import external from 'external'; export default { success: external.isExternal }; rollup-2.61.1/test/function/samples/custom-external-resolver-sync/000077500000000000000000000000001415504077600253425ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/custom-external-resolver-sync/_config.js000066400000000000000000000005721415504077600273100ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/custom-external-resolver-sync/js_modules/000077500000000000000000000000001415504077600275065ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/custom-external-resolver-sync/js_modules/external.js000066400000000000000000000000451415504077600316650ustar00rootroot00000000000000export default { isExternal: true }; rollup-2.61.1/test/function/samples/custom-external-resolver-sync/main.js000066400000000000000000000001231415504077600266200ustar00rootroot00000000000000import external from 'external'; export default { success: external.isExternal }; rollup-2.61.1/test/function/samples/custom-iterator-2/000077500000000000000000000000001415504077600226775ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/custom-iterator-2/_config.js000066400000000000000000000001111415504077600246320ustar00rootroot00000000000000module.exports = { description: 'handles manually defined iterators' }; rollup-2.61.1/test/function/samples/custom-iterator-2/main.js000066400000000000000000000004751415504077600241670ustar00rootroot00000000000000var 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-2.61.1/test/function/samples/custom-iterator/000077500000000000000000000000001415504077600225405ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/custom-iterator/_config.js000066400000000000000000000001111415504077600244730ustar00rootroot00000000000000module.exports = { description: 'handles manually defined iterators' }; rollup-2.61.1/test/function/samples/custom-iterator/main.js000066400000000000000000000002371415504077600240240ustar00rootroot00000000000000var obj = { x: false }; var p = { *[Symbol.iterator]() { yield obj; } }; [...p][0].x = true; if (!obj.x) { throw new Error('x was not reassigned'); } rollup-2.61.1/test/function/samples/custom-loaders/000077500000000000000000000000001415504077600223405ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/custom-loaders/_config.js000066400000000000000000000006201415504077600243000ustar00rootroot00000000000000const fs = require('fs'); module.exports = { description: 'uses custom loaders, falling back to default', options: { plugins: [ { load(id) { if (/foo\.js/.test(id)) { return fs.readFileSync(id, 'utf-8').replace('@', 1); } } }, { load(id) { if (/bar\.js/.test(id)) { return fs.readFileSync(id, 'utf-8').replace('@', 2); } } } ] } }; rollup-2.61.1/test/function/samples/custom-loaders/bar.js000066400000000000000000000000241415504077600234360ustar00rootroot00000000000000export default '@'; rollup-2.61.1/test/function/samples/custom-loaders/baz.js000066400000000000000000000000241415504077600234460ustar00rootroot00000000000000export default '@'; rollup-2.61.1/test/function/samples/custom-loaders/foo.js000066400000000000000000000000241415504077600234550ustar00rootroot00000000000000export default '@'; rollup-2.61.1/test/function/samples/custom-loaders/main.js000066400000000000000000000002321415504077600236170ustar00rootroot00000000000000import foo from './foo'; import bar from './bar'; import baz from './baz'; assert.equal( foo, '1' ); assert.equal( bar, '2' ); assert.equal( baz, '@' ); rollup-2.61.1/test/function/samples/custom-module-options/000077500000000000000000000000001415504077600236655ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/custom-module-options/_config.js000066400000000000000000000035131415504077600256310ustar00rootroot00000000000000const assert = require('assert'); 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 = { description: 'supports adding custom options to modules', options: { plugins: [ getTestPlugin(1), getTestPlugin(2), getTestPlugin(3), { name: 'wrap-up', buildEnd() { assert.deepStrictEqual( [...this.getModuleIds()] .filter(id => id.includes('resolve')) .sort() .map(id => ({ id, meta: this.getModuleInfo(id).meta })), [ { id: 'resolve1-load2-transform3', meta: { 'test-1': { resolved: 1 }, 'test-2': { loaded: 2 }, 'test-3': { transformed: 3 } } }, { id: 'resolve2-load2-transform3', meta: { 'test-2': { loaded: 2 }, 'test-3': { transformed: 3 } } }, { id: 'resolve3-load3-transform1-transform3', meta: { '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-2.61.1/test/function/samples/custom-module-options/main.js000066400000000000000000000003021415504077600251420ustar00rootroot00000000000000export { 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-2.61.1/test/function/samples/custom-path-resolver-async/000077500000000000000000000000001415504077600246155ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/custom-path-resolver-async/_config.js000066400000000000000000000010741415504077600265610ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { description: 'uses a custom path resolver (asynchronous)', options: { plugins: [ { resolveId(importee) { let resolved; if (path.normalize(importee) === path.join(__dirname, 'main.js')) return importee; if (importee === 'foo') { resolved = path.join(__dirname, 'bar.js'); } else { resolved = false; } return Promise.resolve(resolved); } } ] }, exports(exports) { assert.strictEqual(exports.path, require('path')); } }; rollup-2.61.1/test/function/samples/custom-path-resolver-async/bar.js000066400000000000000000000000251415504077600257140ustar00rootroot00000000000000export default 'bar';rollup-2.61.1/test/function/samples/custom-path-resolver-async/main.js000066400000000000000000000001361415504077600260770ustar00rootroot00000000000000import foo from 'foo'; import path from 'path'; assert.equal( foo, 'bar' ); export { path };rollup-2.61.1/test/function/samples/custom-path-resolver-on-entry/000077500000000000000000000000001415504077600252535ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/custom-path-resolver-on-entry/_config.js000066400000000000000000000013441415504077600272170ustar00rootroot00000000000000const assert = require('assert'); const fs = require('fs'); const path = require('path'); const cachedModules = { '@main.js': 'import foo from "./foo"; export default foo();' }; module.exports = { 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 fs.readFileSync(moduleId, 'utf-8'); } } ] }, exports(exports) { assert.equal(exports, 42); } }; rollup-2.61.1/test/function/samples/custom-path-resolver-on-entry/bar.js000066400000000000000000000000531415504077600263530ustar00rootroot00000000000000export default function () { return 21; } rollup-2.61.1/test/function/samples/custom-path-resolver-on-entry/foo.js000066400000000000000000000001141415504077600263700ustar00rootroot00000000000000import bar from './bar'; export default function () { return bar() * 2; } rollup-2.61.1/test/function/samples/custom-path-resolver-plural-b/000077500000000000000000000000001415504077600252165ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/custom-path-resolver-plural-b/_config.js000066400000000000000000000006171415504077600271640ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/custom-path-resolver-plural/000077500000000000000000000000001415504077600247775ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/custom-path-resolver-plural/_config.js000066400000000000000000000010421415504077600267360ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/custom-path-resolver-plural/globals-math.js000066400000000000000000000000661415504077600277110ustar00rootroot00000000000000export var sin = Math.sin; export var cos = Math.cos; rollup-2.61.1/test/function/samples/custom-path-resolver-plural/main.js000066400000000000000000000001111415504077600262520ustar00rootroot00000000000000import { sin } from '@Math'; import '!path'; export var res = sin( 0 ); rollup-2.61.1/test/function/samples/custom-path-resolver-sync/000077500000000000000000000000001415504077600244545ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/custom-path-resolver-sync/_config.js000066400000000000000000000007311415504077600264170ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { 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('path')); } }; rollup-2.61.1/test/function/samples/custom-path-resolver-sync/bar.js000066400000000000000000000000251415504077600255530ustar00rootroot00000000000000export default 'bar';rollup-2.61.1/test/function/samples/custom-path-resolver-sync/main.js000066400000000000000000000001361415504077600257360ustar00rootroot00000000000000import foo from 'foo'; import path from 'path'; assert.equal( foo, 'bar' ); export { path };rollup-2.61.1/test/function/samples/custom-resolve-options/000077500000000000000000000000001415504077600240575ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/custom-resolve-options/_config.js000066400000000000000000000015521415504077600260240ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/custom-resolve-options/main.js000066400000000000000000000000411415504077600253340ustar00rootroot00000000000000throw new Error('Not executed'); rollup-2.61.1/test/function/samples/cycles-default-anonymous-function-hoisted/000077500000000000000000000000001415504077600276115ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/cycles-default-anonymous-function-hoisted/_config.js000066400000000000000000000003741415504077600315570ustar00rootroot00000000000000module.exports = { description: 'Anonymous function declarations are hoisted', warnings: [ { code: 'CIRCULAR_DEPENDENCY', cycle: ['f.js', 'g.js', 'f.js'], importer: 'f.js', message: 'Circular dependency: f.js -> g.js -> f.js' } ] }; rollup-2.61.1/test/function/samples/cycles-default-anonymous-function-hoisted/f.js000066400000000000000000000001571415504077600303770ustar00rootroot00000000000000import g from "./g.js"; export default function (fn) { return function (str) { return str || g(fn.name); } } rollup-2.61.1/test/function/samples/cycles-default-anonymous-function-hoisted/g.js000066400000000000000000000001231415504077600303710ustar00rootroot00000000000000import f from "./f.js"; export default f(function fn(str) { return str + str; });rollup-2.61.1/test/function/samples/cycles-default-anonymous-function-hoisted/main.js000066400000000000000000000001121415504077600310650ustar00rootroot00000000000000import f from "./f.js"; import g from "./g.js"; assert.equal(g(), "fn"); rollup-2.61.1/test/function/samples/cycles-defaults/000077500000000000000000000000001415504077600224665ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/cycles-defaults/_config.js000066400000000000000000000005401415504077600244270ustar00rootroot00000000000000module.exports = { description: 'cycles work with default exports', warnings: [ { code: 'CIRCULAR_DEPENDENCY', cycle: ['a.js', 'b.js', 'a.js'], importer: 'a.js', 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-2.61.1/test/function/samples/cycles-defaults/a.js000066400000000000000000000001101415504077600232340ustar00rootroot00000000000000import b from './b'; export default { a: 1, get b() { return b.b; } }; rollup-2.61.1/test/function/samples/cycles-defaults/b.js000066400000000000000000000001101415504077600232350ustar00rootroot00000000000000import a from './a'; export default { b: 2, get a() { return a.a; } }; rollup-2.61.1/test/function/samples/cycles-defaults/main.js000066400000000000000000000002131415504077600237440ustar00rootroot00000000000000import 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-2.61.1/test/function/samples/cycles-export-star/000077500000000000000000000000001415504077600231475ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/cycles-export-star/_config.js000066400000000000000000000006531415504077600251150ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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', cycle: ['a.js', 'b.js', 'a.js'], importer: 'a.js', message: 'Circular dependency: a.js -> b.js -> a.js' } ] }; rollup-2.61.1/test/function/samples/cycles-export-star/a.js000066400000000000000000000000761415504077600237300ustar00rootroot00000000000000export * from './b.js'; export function a() { return 'a'; } rollup-2.61.1/test/function/samples/cycles-export-star/b.js000066400000000000000000000000761415504077600237310ustar00rootroot00000000000000export * from './a.js'; export function b() { return 'b'; } rollup-2.61.1/test/function/samples/cycles-export-star/main.js000066400000000000000000000000651415504077600244320ustar00rootroot00000000000000import { b } from './a.js'; assert.equal(b(), 'b'); rollup-2.61.1/test/function/samples/cycles-immediate/000077500000000000000000000000001415504077600226155ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/cycles-immediate/_config.js000066400000000000000000000006141415504077600245600ustar00rootroot00000000000000module.exports = { description: 'handles cycles where imports are immediately used', warnings: [ { code: 'CIRCULAR_DEPENDENCY', cycle: ['evens.js', 'odds.js', 'evens.js'], importer: 'evens.js', 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-2.61.1/test/function/samples/cycles-immediate/evens.js000066400000000000000000000006401415504077600242730ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/cycles-immediate/main.js000066400000000000000000000016561415504077600241070ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/cycles-immediate/odds.js000066400000000000000000000006001415504077600241000ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/cycles-pathological-2/000077500000000000000000000000001415504077600234645ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/cycles-pathological-2/_config.js000066400000000000000000000012231415504077600254240ustar00rootroot00000000000000module.exports = { description: 'resolves even more pathological cyclical dependencies gracefully', warnings: [ { code: 'CIRCULAR_DEPENDENCY', cycle: ['main.js', 'b.js', 'main.js'], importer: 'main.js', message: 'Circular dependency: main.js -> b.js -> main.js' }, { code: 'CIRCULAR_DEPENDENCY', cycle: ['b.js', 'd.js', 'c.js', 'b.js'], importer: 'b.js', message: 'Circular dependency: b.js -> d.js -> c.js -> b.js' }, { code: 'CIRCULAR_DEPENDENCY', cycle: ['main.js', 'b.js', 'd.js', 'c.js', 'main.js'], importer: 'main.js', message: 'Circular dependency: main.js -> b.js -> d.js -> c.js -> main.js' } ] }; rollup-2.61.1/test/function/samples/cycles-pathological-2/b.js000066400000000000000000000002521415504077600242420ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/cycles-pathological-2/c.js000066400000000000000000000002001415504077600242340ustar00rootroot00000000000000import { b, bv } from './b'; import { a, av } from './main'; export function c() { a(av); b(bv); } export var cv = av + bv; rollup-2.61.1/test/function/samples/cycles-pathological-2/d.js000066400000000000000000000001231415504077600242410ustar00rootroot00000000000000import { c, cv } from './c'; export function d() { c(cv); } export var dv = cv; rollup-2.61.1/test/function/samples/cycles-pathological-2/main.js000066400000000000000000000002471415504077600247510ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/cycles-stack-overflow/000077500000000000000000000000001415504077600236255ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/cycles-stack-overflow/_config.js000066400000000000000000000006611415504077600255720ustar00rootroot00000000000000module.exports = { description: 'does not stack overflow on crazy cyclical dependencies', warnings: [ { code: 'CIRCULAR_DEPENDENCY', cycle: ['c.js', 'd.js', 'b.js', 'c.js'], importer: 'c.js', message: 'Circular dependency: c.js -> d.js -> b.js -> c.js' }, { code: 'CIRCULAR_DEPENDENCY', cycle: ['c.js', 'd.js', 'c.js'], importer: 'c.js', message: 'Circular dependency: c.js -> d.js -> c.js' } ] }; rollup-2.61.1/test/function/samples/cycles-stack-overflow/b.js000066400000000000000000000002111415504077600243760ustar00rootroot00000000000000import { C } from './c.js'; export function B () {}; B.prototype = { c: function () { return function () { new C(); }; }() }; rollup-2.61.1/test/function/samples/cycles-stack-overflow/c.js000066400000000000000000000002301415504077600244000ustar00rootroot00000000000000import { D } from './d.js'; export function C () { this.x = 'x'; } C.prototype = { d: function () { return function () { new D(); }; }() }; rollup-2.61.1/test/function/samples/cycles-stack-overflow/d.js000066400000000000000000000002451415504077600244070ustar00rootroot00000000000000import { B } from './b.js'; import { C } from './c.js'; export function D () {}; D.prototype = { c: function () { return function () { new C(); }; }() }; rollup-2.61.1/test/function/samples/cycles-stack-overflow/main.js000066400000000000000000000000751415504077600251110ustar00rootroot00000000000000import { C } from './c.js'; assert.equal( new C().x, 'x' ); rollup-2.61.1/test/function/samples/cyclic-assignments/000077500000000000000000000000001415504077600231765ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/cyclic-assignments/_config.js000066400000000000000000000001131415504077600251330ustar00rootroot00000000000000module.exports = { description: 'does not fail for cyclic assignments' }; rollup-2.61.1/test/function/samples/cyclic-assignments/main.js000066400000000000000000000002111415504077600244520ustar00rootroot00000000000000let a = { foo: () => {}, bar: () => () => {} }; let b = a; a = b; a.foo = () => {}; a.foo(); b = b; b.bar = () => () => {}; b.bar()(); rollup-2.61.1/test/function/samples/deconflict-deconflicted/000077500000000000000000000000001415504077600241325ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deconflict-deconflicted/_config.js000066400000000000000000000001601415504077600260710ustar00rootroot00000000000000module.exports = { description: 'also deconflict variables which already appear to be deconflicted (#2683)' }; rollup-2.61.1/test/function/samples/deconflict-deconflicted/dep.js000066400000000000000000000001121415504077600252320ustar00rootroot00000000000000var value = '1'; export function x(value$1) { return value$1 + value; } rollup-2.61.1/test/function/samples/deconflict-deconflicted/main.js000066400000000000000000000001011415504077600254040ustar00rootroot00000000000000import { x } from './dep.js'; assert.equal(x('name'), 'name1'); rollup-2.61.1/test/function/samples/deconflict-default-exported-named-function/000077500000000000000000000000001415504077600276705ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deconflict-default-exported-named-function/_config.js000066400000000000000000000001471415504077600316340ustar00rootroot00000000000000module.exports = { description: 'deconflict default exported named function and class expressions' }; rollup-2.61.1/test/function/samples/deconflict-default-exported-named-function/classDeclaration1.js000066400000000000000000000001251415504077600335600ustar00rootroot00000000000000export default class test { constructor() { this.name = 'classDeclaration1'; } } rollup-2.61.1/test/function/samples/deconflict-default-exported-named-function/classDeclaration2.js000066400000000000000000000001251415504077600335610ustar00rootroot00000000000000export default class test { constructor() { this.name = 'classDeclaration2'; } } rollup-2.61.1/test/function/samples/deconflict-default-exported-named-function/classExpression1.js000066400000000000000000000001261415504077600334730ustar00rootroot00000000000000export default (class test { constructor() { this.name = 'classExpression1'; } }) rollup-2.61.1/test/function/samples/deconflict-default-exported-named-function/classExpression2.js000066400000000000000000000001261415504077600334740ustar00rootroot00000000000000export default (class test { constructor() { this.name = 'classExpression2'; } }) functionDeclaration1.js000066400000000000000000000001041415504077600342160ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deconflict-default-exported-named-functionexport default function test() { return 'functionDeclaration1'; }; functionDeclaration2.js000066400000000000000000000001041415504077600342170ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deconflict-default-exported-named-functionexport default function test() { return 'functionDeclaration2'; }; functionExpression1.js000066400000000000000000000001051415504077600341310ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deconflict-default-exported-named-functionexport default (function test() { return 'functionExpression1'; }); functionExpression2.js000066400000000000000000000001051415504077600341320ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deconflict-default-exported-named-functionexport default (function test() { return 'functionExpression2'; }); rollup-2.61.1/test/function/samples/deconflict-default-exported-named-function/main.js000066400000000000000000000017671415504077600311650ustar00rootroot00000000000000import 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-2.61.1/test/function/samples/deconflict-default-exported-named-function/named.js000066400000000000000000000000651415504077600313130ustar00rootroot00000000000000export const test = function() { return 'named'; }; rollup-2.61.1/test/function/samples/deconflict-ids/000077500000000000000000000000001415504077600222665ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deconflict-ids/_config.js000066400000000000000000000001011415504077600242200ustar00rootroot00000000000000module.exports = { description: 'deconflicts reassigned ids' }; rollup-2.61.1/test/function/samples/deconflict-ids/conflict1.js000066400000000000000000000001051415504077600245020ustar00rootroot00000000000000function foo(){ throw new Error('Wrong foo function referenced.') } rollup-2.61.1/test/function/samples/deconflict-ids/conflict2.js000066400000000000000000000001051415504077600245030ustar00rootroot00000000000000function foo(){ throw new Error('Wrong foo function referenced.') } rollup-2.61.1/test/function/samples/deconflict-ids/main.js000066400000000000000000000001511415504077600235450ustar00rootroot00000000000000import './conflict1.js'; import foo from './used.js'; import './conflict2.js'; assert.equal(foo(1), 2); rollup-2.61.1/test/function/samples/deconflict-ids/used.js000066400000000000000000000001561415504077600235660ustar00rootroot00000000000000export default function foo() { foo = function(x){ return x + 1; }; return foo.apply(this, arguments); } rollup-2.61.1/test/function/samples/deconflict-parameter-defaults/000077500000000000000000000000001415504077600252745ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deconflict-parameter-defaults/_config.js000066400000000000000000000001441415504077600272350ustar00rootroot00000000000000module.exports = { description: 'consistently deconflict variable names for parameter defaults' }; rollup-2.61.1/test/function/samples/deconflict-parameter-defaults/main.js000066400000000000000000000011561415504077600265610ustar00rootroot00000000000000import './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-2.61.1/test/function/samples/deconflict-parameter-defaults/other.js000066400000000000000000000011411415504077600267500ustar00rootroot00000000000000var 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-2.61.1/test/function/samples/deconflict-synthetic-named-export-cross-chunk/000077500000000000000000000000001415504077600303575ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deconflict-synthetic-named-export-cross-chunk/_config.js000066400000000000000000000005731415504077600323260ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/deconflict-synthetic-named-export-cross-chunk/foo.js000066400000000000000000000000531415504077600314760ustar00rootroot00000000000000export const bar = { double: x => x * x }; rollup-2.61.1/test/function/samples/deconflict-synthetic-named-export-cross-chunk/main.js000066400000000000000000000001331415504077600316360ustar00rootroot00000000000000import { double } from './foo.js'; export default function (foo) { return double(foo); } rollup-2.61.1/test/function/samples/deconflict-synthetic-named-export/000077500000000000000000000000001415504077600261225ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deconflict-synthetic-named-export/_config.js000066400000000000000000000004451415504077600300670ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'deconflicts synthetic named exports', options: { plugins: [ { transform(code) { return { code, syntheticNamedExports: 'foo' }; } } ] }, exports(exports) { assert.strictEqual(exports(2), 4); } }; rollup-2.61.1/test/function/samples/deconflict-synthetic-named-export/foo.js000066400000000000000000000000531415504077600272410ustar00rootroot00000000000000export const foo = { double: x => x * x }; rollup-2.61.1/test/function/samples/deconflict-synthetic-named-export/main.js000066400000000000000000000001331415504077600274010ustar00rootroot00000000000000import { double } from './foo.js'; export default function (foo) { return double(foo); } rollup-2.61.1/test/function/samples/deconflicts-classes/000077500000000000000000000000001415504077600233275ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deconflicts-classes/_config.js000066400000000000000000000001041415504077600252640ustar00rootroot00000000000000module.exports = { description: 'deconflicts top-level classes' }; rollup-2.61.1/test/function/samples/deconflicts-classes/a.js000066400000000000000000000000561415504077600241060ustar00rootroot00000000000000var Foo = function Foo () {}; export { Foo }; rollup-2.61.1/test/function/samples/deconflicts-classes/b.js000066400000000000000000000000361415504077600241050ustar00rootroot00000000000000class Foo {}; export { Foo }; rollup-2.61.1/test/function/samples/deconflicts-classes/main.js000066400000000000000000000001401415504077600246040ustar00rootroot00000000000000import { Foo as A } from './a.js'; import { Foo as B } from './b.js'; assert.notEqual( A, B ); rollup-2.61.1/test/function/samples/deconflicts-exports-2/000077500000000000000000000000001415504077600235355ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deconflicts-exports-2/_config.js000066400000000000000000000002651415504077600255020ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'renames nested variables named "exports" if necessary', exports(exports) { assert.equal(exports.x, 2); } }; rollup-2.61.1/test/function/samples/deconflicts-exports-2/main.js000066400000000000000000000003151415504077600250160ustar00rootroot00000000000000function 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-2.61.1/test/function/samples/deconflicts-exports-3/000077500000000000000000000000001415504077600235365ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deconflicts-exports-3/_config.js000066400000000000000000000002531415504077600255000ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'renames variables named "module" if necessary', exports(exports) { assert.equal(exports, 1); } }; rollup-2.61.1/test/function/samples/deconflicts-exports-3/main.js000066400000000000000000000001251415504077600250160ustar00rootroot00000000000000var module = { exports: 99 }; assert.equal(module.exports, 99); export default 1; rollup-2.61.1/test/function/samples/deconflicts-exports/000077500000000000000000000000001415504077600233765ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deconflicts-exports/_config.js000066400000000000000000000004051415504077600253370ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/deconflicts-exports/main.js000066400000000000000000000002211415504077600246530ustar00rootroot00000000000000var exports = { number: 21 }; export var a = 'A'; export var b = exports.number * 2; assert.deepEqual( Object.keys( exports ), [ 'number' ]); rollup-2.61.1/test/function/samples/deconflicts-external-imports/000077500000000000000000000000001415504077600252075ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deconflicts-external-imports/_config.js000066400000000000000000000002771415504077600271570ustar00rootroot00000000000000module.exports = { description: 'deconflicts external imports', context: { require(id) { return function () { return id; }; } }, options: { external: ['foo', 'bar'] } }; rollup-2.61.1/test/function/samples/deconflicts-external-imports/a.js000066400000000000000000000001261415504077600257640ustar00rootroot00000000000000import foo from 'foo'; export default function () { assert.equal( foo(), 'foo' ); } rollup-2.61.1/test/function/samples/deconflicts-external-imports/b.js000066400000000000000000000001261415504077600257650ustar00rootroot00000000000000import foo from 'bar'; export default function () { assert.equal( foo(), 'bar' ); } rollup-2.61.1/test/function/samples/deconflicts-external-imports/main.js000066400000000000000000000000651415504077600264720ustar00rootroot00000000000000import a from './a'; import b from './b'; a(); b(); rollup-2.61.1/test/function/samples/deconflicts-generated-default-names/000077500000000000000000000000001415504077600263535ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deconflicts-generated-default-names/_config.js000066400000000000000000000001211415504077600303070ustar00rootroot00000000000000module.exports = { description: 'deconflicts generated default export names' }; rollup-2.61.1/test/function/samples/deconflicts-generated-default-names/foo.js000066400000000000000000000002061415504077600274720ustar00rootroot00000000000000export default notActuallyFoo; function notActuallyFoo () { return 'not ' + foo(); } function foo () { return 'actually foo'; } rollup-2.61.1/test/function/samples/deconflicts-generated-default-names/main.js000066400000000000000000000001051415504077600276310ustar00rootroot00000000000000import foo from './foo'; assert.equal( foo(), 'not actually foo' ); rollup-2.61.1/test/function/samples/deconflicts-globals/000077500000000000000000000000001415504077600233155ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deconflicts-globals/_config.js000066400000000000000000000001261415504077600252560ustar00rootroot00000000000000module.exports = { description: 'deconflicts names that are assumed to be global' }; rollup-2.61.1/test/function/samples/deconflicts-globals/bar.js000066400000000000000000000001471415504077600244210ustar00rootroot00000000000000import foo from './foo'; export default function() { assert.equal( foo(), 'foo' ); return Number; } rollup-2.61.1/test/function/samples/deconflicts-globals/foo.js000066400000000000000000000001061415504077600244330ustar00rootroot00000000000000export var Number = 42; export default function() { return 'foo'; } rollup-2.61.1/test/function/samples/deconflicts-globals/main.js000066400000000000000000000001701415504077600245750ustar00rootroot00000000000000import { Number } from './foo'; import bar from './bar'; assert.equal( Number, 42 ); assert.notEqual( bar(), Number ); rollup-2.61.1/test/function/samples/deconflicts-interop/000077500000000000000000000000001415504077600233525ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deconflicts-interop/_config.js000066400000000000000000000010771415504077600253210ustar00rootroot00000000000000module.exports = { 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: () => { return Object.defineProperty({ foo: 'foo', default: 'bar' }, '__esModule', { value: true }); } } }; rollup-2.61.1/test/function/samples/deconflicts-interop/main.js000066400000000000000000000014531415504077600246370ustar00rootroot00000000000000import 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-2.61.1/test/function/samples/deconstructed-exported-vars/000077500000000000000000000000001415504077600250465ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deconstructed-exported-vars/_config.js000066400000000000000000000003541415504077600270120ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'allows destructuring in exported variable declarations, synthetic or otherwise', exports(exports) { assert.equal(exports.a, 1); assert.equal(exports.d, 4); } }; rollup-2.61.1/test/function/samples/deconstructed-exported-vars/main.js000066400000000000000000000002061415504077600263260ustar00rootroot00000000000000let { a, b } = c(), [ d, e ] = f(); function c () { return { a: 1, b: 2 }; } function f () { return [ 4, 5 ]; } export { a, d }; rollup-2.61.1/test/function/samples/default-export-as-is-bound/000077500000000000000000000000001415504077600244615ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/default-export-as-is-bound/_config.js000066400000000000000000000001121415504077600264150ustar00rootroot00000000000000module.exports = { description: 'does bind export as default (#1078)' }; rollup-2.61.1/test/function/samples/default-export-as-is-bound/foo.js000066400000000000000000000001121415504077600255740ustar00rootroot00000000000000var a = 42; export function change() { a++; } export { a as default }; rollup-2.61.1/test/function/samples/default-export-as-is-bound/main.js000066400000000000000000000002251415504077600257420ustar00rootroot00000000000000import a from './foo'; import { change } from './foo'; assert.equal( a, 42 ); change(); assert.equal( a, 43, 'export as default should be bound' ); rollup-2.61.1/test/function/samples/default-export-before-declaration/000077500000000000000000000000001415504077600260655ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/default-export-before-declaration/_config.js000066400000000000000000000003011415504077600300210ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'handles default exports before a variable is declared', exports(exports) { assert.strictEqual(exports, undefined); } }; rollup-2.61.1/test/function/samples/default-export-before-declaration/main.js000066400000000000000000000000441415504077600273450ustar00rootroot00000000000000export default foo; var foo = true; rollup-2.61.1/test/function/samples/default-export-is-not-bound-b/000077500000000000000000000000001415504077600250755ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/default-export-is-not-bound-b/_config.js000066400000000000000000000003021415504077600270320ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'does not move default export statement above earlier statements', exports(exports) { assert.equal(exports.bar, 42); } }; rollup-2.61.1/test/function/samples/default-export-is-not-bound-b/foo.js000066400000000000000000000001721415504077600262160ustar00rootroot00000000000000var Foo = function () { this.bar = bar(); } export default Foo; Foo = 'something else'; function bar() { return 42; } rollup-2.61.1/test/function/samples/default-export-is-not-bound-b/main.js000066400000000000000000000000641415504077600263570ustar00rootroot00000000000000import Foo from './foo'; export default new Foo(); rollup-2.61.1/test/function/samples/default-export-is-not-bound/000077500000000000000000000000001415504077600246565ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/default-export-is-not-bound/_config.js000066400000000000000000000002621415504077600266200ustar00rootroot00000000000000module.exports = { description: 'does not bind default exports' }; // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/export-default rollup-2.61.1/test/function/samples/default-export-is-not-bound/foo.js000066400000000000000000000004351415504077600260010ustar00rootroot00000000000000var 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-2.61.1/test/function/samples/default-export-is-not-bound/main.js000066400000000000000000000002261415504077600261400ustar00rootroot00000000000000import a from './foo'; import { change } from './foo'; assert.equal( a, 42 ); change(); assert.equal( a, 42, 'default export should not be bound' ); rollup-2.61.1/test/function/samples/default-export-with-null-prototype/000077500000000000000000000000001415504077600263265ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/default-export-with-null-prototype/_config.js000066400000000000000000000005001415504077600302630ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/default-export-with-null-prototype/main.js000066400000000000000000000000631415504077600276070ustar00rootroot00000000000000import foo from 'foo'; assert.equal(foo.bar, 42); rollup-2.61.1/test/function/samples/default-exported-global/000077500000000000000000000000001415504077600241115ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/default-exported-global/_config.js000066400000000000000000000003141415504077600260510ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Tracks updates of default exported globals', exports(exports) { assert.deepStrictEqual(exports, { original: 1, updated: 2 }); } }; rollup-2.61.1/test/function/samples/default-exported-global/lib.js000066400000000000000000000001741415504077600252170ustar00rootroot00000000000000global.myGlobal = 1; export default myGlobal; global.myGlobal = 2; export const updated = myGlobal; delete global.myGlobal; rollup-2.61.1/test/function/samples/default-exported-global/main.js000066400000000000000000000000661415504077600253750ustar00rootroot00000000000000export { default as original, updated } from './lib'; rollup-2.61.1/test/function/samples/default-exports-in-parens-class-with-id/000077500000000000000000000000001415504077600270655ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/default-exports-in-parens-class-with-id/_config.js000066400000000000000000000001361415504077600310270ustar00rootroot00000000000000module.exports = { description: 'handles default class with id exports wrapped in parens' }; rollup-2.61.1/test/function/samples/default-exports-in-parens-class-with-id/foo.js000066400000000000000000000000351415504077600302040ustar00rootroot00000000000000export default (class A {}); rollup-2.61.1/test/function/samples/default-exports-in-parens-class-with-id/main.js000066400000000000000000000001221415504077600303420ustar00rootroot00000000000000import Foo from './foo.js'; var obj = new Foo(); assert.ok( obj instanceof Foo ); rollup-2.61.1/test/function/samples/default-exports-in-parens-class-without-id/000077500000000000000000000000001415504077600276155ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/default-exports-in-parens-class-without-id/_config.js000066400000000000000000000001411415504077600315530ustar00rootroot00000000000000module.exports = { description: 'handles default class without id exports wrapped in parens' }; rollup-2.61.1/test/function/samples/default-exports-in-parens-class-without-id/foo.js000066400000000000000000000000331415504077600307320ustar00rootroot00000000000000export default (class {}); rollup-2.61.1/test/function/samples/default-exports-in-parens-class-without-id/main.js000066400000000000000000000001221415504077600310720ustar00rootroot00000000000000import Foo from './foo.js'; var obj = new Foo(); assert.ok( obj instanceof Foo ); rollup-2.61.1/test/function/samples/default-exports-in-parens-function-with-id/000077500000000000000000000000001415504077600276055ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/default-exports-in-parens-function-with-id/_config.js000066400000000000000000000001411415504077600315430ustar00rootroot00000000000000module.exports = { description: 'handles default function with id exports wrapped in parens' }; rollup-2.61.1/test/function/samples/default-exports-in-parens-function-with-id/foo.js000066400000000000000000000001011415504077600307160ustar00rootroot00000000000000export default (function transform() { global.answer = 42; }); rollup-2.61.1/test/function/samples/default-exports-in-parens-function-with-id/main.js000066400000000000000000000001061415504077600310640ustar00rootroot00000000000000import foo from './foo.js'; foo(); assert.equal( global.answer, 42 ); rollup-2.61.1/test/function/samples/default-exports-in-parens-function-without-id/000077500000000000000000000000001415504077600303355ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/default-exports-in-parens-function-without-id/_config.js000066400000000000000000000001441415504077600322760ustar00rootroot00000000000000module.exports = { description: 'handles default function without id exports wrapped in parens' }; rollup-2.61.1/test/function/samples/default-exports-in-parens-function-without-id/foo.js000066400000000000000000000000701415504077600314530ustar00rootroot00000000000000export default (function () { global.answer = 42; }); rollup-2.61.1/test/function/samples/default-exports-in-parens-function-without-id/main.js000066400000000000000000000001061415504077600316140ustar00rootroot00000000000000import foo from './foo.js'; foo(); assert.equal( global.answer, 42 ); rollup-2.61.1/test/function/samples/default-function-export-conflict/000077500000000000000000000000001415504077600257645ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/default-function-export-conflict/_config.js000066400000000000000000000001131415504077600277210ustar00rootroot00000000000000module.exports = { description: 'default export of anonymous function' }; rollup-2.61.1/test/function/samples/default-function-export-conflict/foo.js000066400000000000000000000001161415504077600271030ustar00rootroot00000000000000function foo() { return 42; } export default function () { return foo(); } rollup-2.61.1/test/function/samples/default-function-export-conflict/main.js000066400000000000000000000000651415504077600272470ustar00rootroot00000000000000import foo from './foo'; assert.equal( foo(), 42 ); rollup-2.61.1/test/function/samples/default-not-reexported/000077500000000000000000000000001415504077600240005ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/default-not-reexported/_config.js000066400000000000000000000012221415504077600257370ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'default export is not re-exported with export *', error: { code: 'MISSING_EXPORT', message: `'default' is not exported by foo.js, imported by main.js`, id: path.join(__dirname, 'main.js'), pos: 7, watchFiles: [ path.join(__dirname, 'main.js'), path.join(__dirname, 'foo.js'), path.join(__dirname, 'bar.js') ], loc: { file: path.join(__dirname, 'main.js'), line: 1, column: 7 }, frame: ` 1: import def from './foo.js'; ^ 2: 3: console.log( def ); `, url: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module` } }; rollup-2.61.1/test/function/samples/default-not-reexported/bar.js000066400000000000000000000001051415504077600250760ustar00rootroot00000000000000export const named = 42; export default 'should not be re-exported'; rollup-2.61.1/test/function/samples/default-not-reexported/foo.js000066400000000000000000000000321415504077600251140ustar00rootroot00000000000000export * from './bar.js'; rollup-2.61.1/test/function/samples/default-not-reexported/main.js000066400000000000000000000000611415504077600252570ustar00rootroot00000000000000import def from './foo.js'; console.log( def ); rollup-2.61.1/test/function/samples/default-on-warn/000077500000000000000000000000001415504077600224025ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/default-on-warn/_config.js000066400000000000000000000016211415504077600243440ustar00rootroot00000000000000const assert = require('assert'); let oldConsoleWarn; const warnings = []; module.exports = { description: 'provides a default handler for warnings to onwarn that handles strings and objects', options: { onwarn(warning, defaultHandler) { if (warning.code === 'EVAL') { defaultHandler(warning); } else { defaultHandler(warning.message); } } }, before() { oldConsoleWarn = console.warn; console.warn = msg => warnings.push(msg); }, after() { console.warn = oldConsoleWarn; assert.deepStrictEqual(warnings, [ 'Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification', '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' ]); } }; rollup-2.61.1/test/function/samples/default-on-warn/main.js000066400000000000000000000000601415504077600236600ustar00rootroot00000000000000export const x = eval('42'); export default 42; rollup-2.61.1/test/function/samples/delete/000077500000000000000000000000001415504077600206415ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/delete/_config.js000066400000000000000000000001261415504077600226020ustar00rootroot00000000000000module.exports = { description: '`delete` operator at the top level is preserved' }; rollup-2.61.1/test/function/samples/delete/main.js000066400000000000000000000001361415504077600221230ustar00rootroot00000000000000var a = { b: 1 }; assert.strictEqual(a.b, 1); delete a.b; assert.strictEqual(a.b, undefined); rollup-2.61.1/test/function/samples/deoptimize-assumes-getters/000077500000000000000000000000001415504077600247015ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deoptimize-assumes-getters/_config.js000066400000000000000000000001431415504077600266410ustar00rootroot00000000000000module.exports = { description: 'assume full deoptimization may inject side-effectful getters' }; rollup-2.61.1/test/function/samples/deoptimize-assumes-getters/main.js000066400000000000000000000002711415504077600261630ustar00rootroot00000000000000const obj = {}; addGetter(obj); let mutated = false; obj.prop; assert.ok(mutated); function addGetter(o) { Object.defineProperty(o, 'prop', { get() { mutated = true; } }); } rollup-2.61.1/test/function/samples/deoptimize-cached-prop/000077500000000000000000000000001415504077600237335ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deoptimize-cached-prop/_config.js000066400000000000000000000001531415504077600256740ustar00rootroot00000000000000module.exports = { description: 'deoptimizes cached properties and return values if necessary (#3264)' }; rollup-2.61.1/test/function/samples/deoptimize-cached-prop/main.js000066400000000000000000000005431415504077600252170ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/deoptimize-call-expression-reassignments/000077500000000000000000000000001415504077600275365ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deoptimize-call-expression-reassignments/_config.js000066400000000000000000000002041415504077600314740ustar00rootroot00000000000000module.exports = { description: 'deoptimizes call expressions of conditional expressions if their return value is reassigned' }; rollup-2.61.1/test/function/samples/deoptimize-call-expression-reassignments/main.js000066400000000000000000000006001415504077600310140ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/deoptimize-call-expressions/000077500000000000000000000000001415504077600250415ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deoptimize-call-expressions/_config.js000066400000000000000000000002011415504077600267740ustar00rootroot00000000000000module.exports = { description: 'deoptimizes call expressions conditional expressions if their return value is reassigned' }; rollup-2.61.1/test/function/samples/deoptimize-call-expressions/main.js000066400000000000000000000004601415504077600263230ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/deoptimize-class/000077500000000000000000000000001415504077600226535ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deoptimize-class/_config.js000066400000000000000000000001301415504077600246070ustar00rootroot00000000000000module.exports = { description: 'handles deoptimization of static class properties' }; rollup-2.61.1/test/function/samples/deoptimize-class/main.js000066400000000000000000000006641415504077600241430ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/deoptimize-computed-class-keys/000077500000000000000000000000001415504077600254425ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deoptimize-computed-class-keys/_config.js000066400000000000000000000001441415504077600274030ustar00rootroot00000000000000module.exports = { description: 'deoptimizes computed class property keys', minNodeVersion: 12 }; rollup-2.61.1/test/function/samples/deoptimize-computed-class-keys/main.js000066400000000000000000000003461415504077600267270ustar00rootroot00000000000000var 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-2.61.1/test/function/samples/deoptimize-computed-keys/000077500000000000000000000000001415504077600243375ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deoptimize-computed-keys/_config.js000066400000000000000000000001201415504077600262720ustar00rootroot00000000000000module.exports = { description: 'deoptimizes computed object property keys' }; rollup-2.61.1/test/function/samples/deoptimize-computed-keys/main.js000066400000000000000000000003171415504077600256220ustar00rootroot00000000000000var 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-2.61.1/test/function/samples/deoptimize-conditional-expression-reassignments/000077500000000000000000000000001415504077600311265ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deoptimize-conditional-expression-reassignments/_config.js000066400000000000000000000001421415504077600330650ustar00rootroot00000000000000module.exports = { description: 'tracks reassignments of deoptimized conditional expressions' }; rollup-2.61.1/test/function/samples/deoptimize-conditional-expression-reassignments/main.js000066400000000000000000000003471415504077600324140ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/deoptimize-conditional-expressions/000077500000000000000000000000001415504077600264315ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deoptimize-conditional-expressions/_config.js000066400000000000000000000001461415504077600303740ustar00rootroot00000000000000module.exports = { description: 'keeps conditional expressions if their test value is reassigned' }; rollup-2.61.1/test/function/samples/deoptimize-conditional-expressions/main.js000066400000000000000000000004261415504077600277150ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/deoptimize-logical-expression-reassignments/000077500000000000000000000000001415504077600302355ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deoptimize-logical-expression-reassignments/_config.js000066400000000000000000000001361415504077600321770ustar00rootroot00000000000000module.exports = { description: 'tracks reassignments of deoptimized logical expressions' }; rollup-2.61.1/test/function/samples/deoptimize-logical-expression-reassignments/main.js000066400000000000000000000002761415504077600315240ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/deoptimize-logical-expressions/000077500000000000000000000000001415504077600255405ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deoptimize-logical-expressions/_config.js000066400000000000000000000001401415504077600274750ustar00rootroot00000000000000module.exports = { description: 'keeps logical expressions if the first part is reassigned' }; rollup-2.61.1/test/function/samples/deoptimize-logical-expressions/main.js000066400000000000000000000004061415504077600270220ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/deoptimize-member-expressions/000077500000000000000000000000001415504077600253755ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deoptimize-member-expressions/_config.js000066400000000000000000000001471415504077600273410ustar00rootroot00000000000000module.exports = { description: 'keeps accesses to computed properties if their key is reassigned' }; rollup-2.61.1/test/function/samples/deoptimize-member-expressions/main.js000066400000000000000000000005211415504077600266550ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/deoptimize-missing-namespace-members/000077500000000000000000000000001415504077600266015ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deoptimize-missing-namespace-members/_config.js000066400000000000000000000003101415504077600305350ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'handles deoptimization of non-existing namespace members', exports(exports) { assert.strictEqual(exports.bar, undefined); } }; rollup-2.61.1/test/function/samples/deoptimize-missing-namespace-members/main.js000066400000000000000000000001221415504077600300560ustar00rootroot00000000000000import * as ns from './other.js'; const foo = 'foo'; export const bar = ns[foo]; rollup-2.61.1/test/function/samples/deoptimize-missing-namespace-members/other.js000066400000000000000000000000001415504077600302460ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deoptimize-object-expressions-2/000077500000000000000000000000001415504077600255335ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deoptimize-object-expressions-2/_config.js000066400000000000000000000001441415504077600274740ustar00rootroot00000000000000module.exports = { description: 'track deoptimizations of computed properties of empty objects' }; rollup-2.61.1/test/function/samples/deoptimize-object-expressions-2/main.js000066400000000000000000000002231415504077600270120ustar00rootroot00000000000000const foo = {}; function doIt(x) { if (foo[x]) { return true; } foo[x] = true; } doIt('x'); assert.ok(doIt('x'), 'foo was not reassigned'); rollup-2.61.1/test/function/samples/deoptimize-object-expressions/000077500000000000000000000000001415504077600253745ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deoptimize-object-expressions/_config.js000066400000000000000000000001231415504077600273320ustar00rootroot00000000000000module.exports = { description: 'track deoptimizations of computed properties' }; rollup-2.61.1/test/function/samples/deoptimize-object-expressions/main.js000066400000000000000000000003061415504077600266550ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/deoptimize-object/000077500000000000000000000000001415504077600230145ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deoptimize-object/_config.js000066400000000000000000000001221415504077600247510ustar00rootroot00000000000000module.exports = { description: 'handles deoptimization of object properties' }; rollup-2.61.1/test/function/samples/deoptimize-object/main.js000066400000000000000000000004371415504077600243020ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/deoptimize-request-treeshaking-pass/000077500000000000000000000000001415504077600265045ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deoptimize-request-treeshaking-pass/_config.js000066400000000000000000000003731415504077600304510ustar00rootroot00000000000000const assert = require('assert'); const result = { value: 0 }; module.exports = { description: 'makes sure to request additional passes when a variable is deoptimized', context: { result }, exports() { assert.strictEqual(result.value, 2); } }; rollup-2.61.1/test/function/samples/deoptimize-request-treeshaking-pass/main.js000066400000000000000000000003341415504077600277660ustar00rootroot00000000000000function 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-2.61.1/test/function/samples/deoptimize-this-parameters/000077500000000000000000000000001415504077600246565ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deoptimize-this-parameters/_config.js000066400000000000000000000001201415504077600266110ustar00rootroot00000000000000module.exports = { description: 'handles deoptimization of this parameters' }; rollup-2.61.1/test/function/samples/deoptimize-this-parameters/main.js000066400000000000000000000005451415504077600261440ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/deprecated/000077500000000000000000000000001415504077600214775ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/context-resolve-id/000077500000000000000000000000001415504077600252325ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/context-resolve-id/_config.js000066400000000000000000000043651415504077600272040ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { description: 'correctly returns string or null for the context resolveId helper', context: { require(id) { switch (id) { case 'external-name': return { value: 'external name' }; case 'external-object': return { value: 'external object' }; case 'resolveto-unresolved': return { value: 'unresolved' }; default: throw new Error(`Unexpected import ${id}`); } } }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "this.resolveId" plugin context function used by plugin at position 1 is deprecated. The "this.resolve" plugin context function should be used instead.', plugin: 'at position 1' }, { code: 'UNRESOLVED_IMPORT', importer: 'main.js', message: "'resolveto-unresolved' is imported by main.js, but could not be resolved – treating it as an external dependency", source: 'resolveto-unresolved', url: 'https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency' } ], options: { strictDeprecations: false, plugins: [ { resolveId(id, importer) { if (id.startsWith('resolveto-')) { const resolutionId = id.slice('resolveto-'.length); return this.resolveId(resolutionId, importer).then(resolvedId => { if (!resolvedId) { assert.strictEqual(resolutionId, 'unresolved'); assert.strictEqual(resolvedId, null); } else { if (typeof resolvedId !== 'string') { throw new Error( `Only valid resolveId return types are string and null, found ${typeof resolvedId} ${JSON.stringify( resolvedId )}` ); } return { id: resolvedId, external: resolvedId.startsWith('external') }; } }); } } }, { resolveId(id) { switch (id) { case 'object': return { id: path.join(__dirname, 'existing-object.js'), external: false }; case 'external-object': return { id: 'external-object', external: true }; case 'name': return path.join(__dirname, 'existing-name.js'); case 'external-name': return false; } } } ] } }; rollup-2.61.1/test/function/samples/deprecated/context-resolve-id/existing-name.js000066400000000000000000000000461415504077600303400ustar00rootroot00000000000000export const value = 'existing name'; rollup-2.61.1/test/function/samples/deprecated/context-resolve-id/existing-object.js000066400000000000000000000000501415504077600306610ustar00rootroot00000000000000export const value = 'existing object'; rollup-2.61.1/test/function/samples/deprecated/context-resolve-id/main.js000066400000000000000000000010311415504077600265070ustar00rootroot00000000000000import { value as name } from 'resolveto-name'; import { value as externalName } from 'resolveto-external-name'; import { value as object } from 'resolveto-object'; import { value as externalObject } from 'resolveto-external-object'; import { value as unresolved } from 'resolveto-unresolved'; assert.strictEqual(externalName, 'external name'); assert.strictEqual(externalObject, 'external object'); assert.strictEqual(name, 'existing name'); assert.strictEqual(object, 'existing object'); assert.strictEqual(unresolved, 'unresolved'); rollup-2.61.1/test/function/samples/deprecated/deconflicts-interop-boolean/000077500000000000000000000000001415504077600270675ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/deconflicts-interop-boolean/_config.js000066400000000000000000000005421415504077600310320ustar00rootroot00000000000000module.exports = { description: 'deconflicts the interop function for "true"', options: { strictDeprecations: false, external(id) { return id.startsWith('external'); }, output: { interop: true } }, context: { require: () => { return Object.defineProperty({ foo: 'foo', default: 'bar' }, '__esModule', { value: true }); } } }; rollup-2.61.1/test/function/samples/deprecated/deconflicts-interop-boolean/main.js000066400000000000000000000005261415504077600303540ustar00rootroot00000000000000import external1 from 'external'; import * as external2 from 'external'; const _interopDefaultLegacy = null; const _interopNamespace = null; assert.strictEqual(_interopDefaultLegacy, null); assert.strictEqual(_interopNamespace, null); assert.strictEqual(external1, 'bar'); assert.deepStrictEqual(external2, { default: 'bar', foo: 'foo' }); rollup-2.61.1/test/function/samples/deprecated/dynamic-import-duplicates/000077500000000000000000000000001415504077600265665ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/dynamic-import-duplicates/_config.js000066400000000000000000000004451415504077600305330ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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); }); } }; rollup-2.61.1/test/function/samples/deprecated/dynamic-import-duplicates/foo.js000066400000000000000000000000221415504077600277010ustar00rootroot00000000000000export var x = 42;rollup-2.61.1/test/function/samples/deprecated/dynamic-import-duplicates/main.js000066400000000000000000000002001415504077600300400ustar00rootroot00000000000000export var x = 41; export var promise = Promise.all([import('./foo'), import('./foo')]).then(foos => { return foos[0].x; }); rollup-2.61.1/test/function/samples/deprecated/dynamic-import-inlining/000077500000000000000000000000001415504077600262405ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/dynamic-import-inlining/_config.js000066400000000000000000000004451415504077600302050ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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); }); } }; rollup-2.61.1/test/function/samples/deprecated/dynamic-import-inlining/foo.js000066400000000000000000000000221415504077600273530ustar00rootroot00000000000000export var x = 42;rollup-2.61.1/test/function/samples/deprecated/dynamic-import-inlining/main.js000066400000000000000000000001331415504077600275170ustar00rootroot00000000000000export var x = 41; export var promise = import('./foo').then(foo => { return foo.x; }); rollup-2.61.1/test/function/samples/deprecated/dynamic-import-name-warn/000077500000000000000000000000001415504077600263165ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/dynamic-import-name-warn/_config.js000066400000000000000000000014751415504077600302670ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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' } }, exports(exports) { return exports.fromFoo.then(value => assert.deepStrictEqual(value, { __proto__: null, default: 42 }) ); }, warnings: [ { code: 'INVALID_OPTION', message: 'Invalid value for option "output.dynamicImportFunction" - this option is ignored for formats other than "es".', url: 'https://rollupjs.org/guide/en/#outputdynamicImportFunction' } ] }; rollup-2.61.1/test/function/samples/deprecated/dynamic-import-name-warn/main.js000066400000000000000000000000531415504077600275760ustar00rootroot00000000000000export const fromFoo = import('./foo.js'); rollup-2.61.1/test/function/samples/deprecated/dynamic-import-name/000077500000000000000000000000001415504077600253515ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/dynamic-import-name/_config.js000066400000000000000000000007421415504077600273160ustar00rootroot00000000000000const assert = require('assert'); let imported = false; module.exports = { 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); } }; rollup-2.61.1/test/function/samples/deprecated/dynamic-import-name/main.js000066400000000000000000000000241415504077600266270ustar00rootroot00000000000000import('./foo.js'); rollup-2.61.1/test/function/samples/deprecated/emit-asset/000077500000000000000000000000001415504077600235525ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/emit-asset/asset-source-missing-2/000077500000000000000000000000001415504077600277755ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/emit-asset/asset-source-missing-2/_config.js000066400000000000000000000007561415504077600317470ustar00rootroot00000000000000module.exports = { description: 'throws when not setting the asset source and accessing the asset URL', options: { strictDeprecations: false, plugins: { name: 'test-plugin', load() { return `export default import.meta.ROLLUP_ASSET_URL_${this.emitAsset('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.' } }; rollup-2.61.1/test/function/samples/deprecated/emit-asset/asset-source-missing-2/main.js000066400000000000000000000000451415504077600312560ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/deprecated/emit-asset/asset-source-missing-3/000077500000000000000000000000001415504077600277765ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/emit-asset/asset-source-missing-3/_config.js000066400000000000000000000010001415504077600317270ustar00rootroot00000000000000module.exports = { description: 'throws when setting an empty asset source', options: { strictDeprecations: false, plugins: { name: 'test-plugin', buildStart() { const assetId = this.emitAsset('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-2.61.1/test/function/samples/deprecated/emit-asset/asset-source-missing-3/main.js000066400000000000000000000000451415504077600312570ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/deprecated/emit-asset/asset-source-missing/000077500000000000000000000000001415504077600276365ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/emit-asset/asset-source-missing/_config.js000066400000000000000000000005271415504077600316040ustar00rootroot00000000000000module.exports = { description: 'throws when not setting the asset source', options: { strictDeprecations: false, plugins: { name: 'test-plugin', load() { this.emitAsset('test.ext'); } } }, generateError: { code: 'ASSET_SOURCE_MISSING', message: 'Plugin error creating asset "test.ext" - no asset source set.' } }; rollup-2.61.1/test/function/samples/deprecated/emit-asset/asset-source-missing/main.js000066400000000000000000000000451415504077600311170ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/deprecated/emit-asset/invalid-asset-id/000077500000000000000000000000001415504077600267075ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/emit-asset/invalid-asset-id/_config.js000066400000000000000000000005551415504077600306560ustar00rootroot00000000000000module.exports = { description: 'throws for invalid asset ids', options: { strictDeprecations: false, plugins: { name: 'test-plugin', load() { return `export default import.meta.ROLLUP_ASSET_URL_invalid;`; } } }, generateError: { code: 'FILE_NOT_FOUND', message: 'Plugin error - Unable to get file name for unknown file "invalid".' } }; rollup-2.61.1/test/function/samples/deprecated/emit-asset/invalid-asset-id/main.js000066400000000000000000000000451415504077600301700ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/deprecated/emit-asset/invalid-asset-name/000077500000000000000000000000001415504077600272335ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/emit-asset/invalid-asset-name/_config.js000066400000000000000000000007561415504077600312050ustar00rootroot00000000000000module.exports = { description: 'throws for invalid asset names', options: { strictDeprecations: false, plugins: { name: 'test-plugin', buildStart() { this.emitAsset('/test.ext', 'content'); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'The "fileName" or "name" properties of emitted files must be strings that are neither absolute nor relative paths, received "/test.ext".', plugin: 'test-plugin', pluginCode: 'VALIDATION_ERROR' } }; rollup-2.61.1/test/function/samples/deprecated/emit-asset/invalid-asset-name/main.js000066400000000000000000000000451415504077600305140ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/deprecated/emit-asset/invalid-set-asset-source-id/000077500000000000000000000000001415504077600307765ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/emit-asset/invalid-set-asset-source-id/_config.js000066400000000000000000000006471415504077600327470ustar00rootroot00000000000000module.exports = { description: 'throws for invalid asset ids', options: { strictDeprecations: false, 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-2.61.1/test/function/samples/deprecated/emit-asset/invalid-set-asset-source-id/main.js000066400000000000000000000000451415504077600322570ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/deprecated/emit-asset/set-asset-source-transform/000077500000000000000000000000001415504077600307715ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/emit-asset/set-asset-source-transform/_config.js000066400000000000000000000013051415504077600327320ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'throws when setting the asset source in the transform hook', options: { strictDeprecations: false, plugins: { name: 'test-plugin', transform(code) { const assetId = this.emitAsset('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-2.61.1/test/function/samples/deprecated/emit-asset/set-asset-source-transform/main.js000066400000000000000000000000451415504077600322520ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/deprecated/emit-asset/set-asset-source-twice/000077500000000000000000000000001415504077600300715ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/emit-asset/set-asset-source-twice/_config.js000066400000000000000000000010271415504077600320330ustar00rootroot00000000000000module.exports = { description: 'throws when setting the asset source twice', options: { strictDeprecations: false, plugins: { name: 'test-plugin', buildEnd() { const assetId = this.emitAsset('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-2.61.1/test/function/samples/deprecated/emit-asset/set-asset-source-twice/main.js000066400000000000000000000000451415504077600313520ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/deprecated/emit-chunk/000077500000000000000000000000001415504077600235435ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available-render-start/000077500000000000000000000000001415504077600335555ustar00rootroot00000000000000_config.js000066400000000000000000000011041415504077600354340ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available-render-startlet chunkId; module.exports = { description: 'Throws when accessing the filename in renderStart', options: { strictDeprecations: false, input: 'main.js', plugins: { name: 'test-plugin', buildStart() { chunkId = this.emitChunk('chunk.js'); }, renderStart() { this.getChunkFileName(chunkId); } } }, generateError: { code: 'PLUGIN_ERROR', hook: 'renderStart', message: 'Plugin error - Unable to get file name for chunk "chunk.js". Ensure that generate is called first.', plugin: 'test-plugin', pluginCode: 'CHUNK_NOT_GENERATED' } }; chunk.js000066400000000000000000000000261415504077600351420ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available-render-startconsole.log('chunk'); main.js000066400000000000000000000000251415504077600347550ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available-render-startconsole.log('main'); rollup-2.61.1/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available/000077500000000000000000000000001415504077600311455ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available/_config.js000066400000000000000000000011711415504077600331070ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'Throws when accessing the filename before it has been generated', options: { strictDeprecations: false, input: 'main.js', plugins: { name: 'test-plugin', buildStart() { const chunkId = this.emitChunk('chunk.js'); this.getChunkFileName(chunkId); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'Plugin error - Unable to get file name for chunk "chunk.js". Ensure that generate is called first.', plugin: 'test-plugin', pluginCode: 'CHUNK_NOT_GENERATED', watchFiles: [path.join(__dirname, 'chunk.js')] } }; rollup-2.61.1/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available/chunk.js000066400000000000000000000000261415504077600326110ustar00rootroot00000000000000console.log('chunk'); rollup-2.61.1/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available/main.js000066400000000000000000000000251415504077600324240ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/function/samples/deprecated/emit-chunk/chunk-not-found/000077500000000000000000000000001415504077600265625ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/emit-chunk/chunk-not-found/_config.js000066400000000000000000000006351415504077600305300ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'Throws if an emitted entry chunk cannot be resolved', options: { strictDeprecations: false, input: 'main.js', plugins: { buildStart() { this.emitChunk('not-found.js'); } } }, error: { code: 'UNRESOLVED_ENTRY', message: 'Could not resolve entry module (not-found.js).', watchFiles: [path.join(__dirname, 'main.js')] } }; rollup-2.61.1/test/function/samples/deprecated/emit-chunk/chunk-not-found/main.js000066400000000000000000000000251415504077600300410ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/function/samples/deprecated/emit-chunk/invalid-chunk-id/000077500000000000000000000000001415504077600266715ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/emit-chunk/invalid-chunk-id/_config.js000066400000000000000000000005551415504077600306400ustar00rootroot00000000000000module.exports = { description: 'throws for invalid chunk ids', options: { strictDeprecations: false, plugins: { name: 'test-plugin', load() { return `export default import.meta.ROLLUP_CHUNK_URL_invalid;`; } } }, generateError: { code: 'FILE_NOT_FOUND', message: 'Plugin error - Unable to get file name for unknown file "invalid".' } }; rollup-2.61.1/test/function/samples/deprecated/emit-chunk/invalid-chunk-id/main.js000066400000000000000000000000451415504077600301520ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/deprecated/emit-chunk/modules-loaded/000077500000000000000000000000001415504077600264415ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/emit-chunk/modules-loaded/_config.js000066400000000000000000000007041415504077600304040ustar00rootroot00000000000000module.exports = { description: 'Throws when adding a chunk after the modules have finished loading', options: { strictDeprecations: false, input: 'main.js', plugins: { name: 'test-plugin', buildEnd() { this.emitChunk('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-2.61.1/test/function/samples/deprecated/emit-chunk/modules-loaded/chunk.js000066400000000000000000000000411415504077600301020ustar00rootroot00000000000000throw new Error('Not executed'); rollup-2.61.1/test/function/samples/deprecated/emit-chunk/modules-loaded/main.js000066400000000000000000000000251415504077600277200ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/function/samples/deprecated/emit-chunk/no-input/000077500000000000000000000000001415504077600253145ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/emit-chunk/no-input/_config.js000066400000000000000000000010141415504077600272520ustar00rootroot00000000000000module.exports = { description: 'It is not necessary to provide an input if a dynamic entry is emitted', options: { strictDeprecations: false, input: undefined, plugins: { name: 'test-plugin', buildStart() { this.emitChunk('chunk.js'); } } }, warnings: [ { code: 'DEPRECATED_FEATURE', message: 'The "this.emitChunk" plugin context function used by plugin test-plugin is deprecated. The "this.emitFile" plugin context function should be used instead.', plugin: 'test-plugin' } ] }; rollup-2.61.1/test/function/samples/deprecated/emit-chunk/no-input/chunk.js000066400000000000000000000000261415504077600267600ustar00rootroot00000000000000assert.equal(42, 42); rollup-2.61.1/test/function/samples/deprecated/inline-dynamic-imports-bundle/000077500000000000000000000000001415504077600273415ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/inline-dynamic-imports-bundle/_config.js000066400000000000000000000006761415504077600313140ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { 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') ]); } } } }; rollup-2.61.1/test/function/samples/deprecated/inline-dynamic-imports-bundle/lib.js000066400000000000000000000000271415504077600304440ustar00rootroot00000000000000export const foo = 42; rollup-2.61.1/test/function/samples/deprecated/inline-dynamic-imports-bundle/main.js000066400000000000000000000000441415504077600306210ustar00rootroot00000000000000export { foo } from './reexporter'; rollup-2.61.1/test/function/samples/deprecated/inline-dynamic-imports-bundle/reexporter.js000066400000000000000000000000351415504077600320740ustar00rootroot00000000000000export { foo } from './lib'; rollup-2.61.1/test/function/samples/deprecated/inline-imports-with-manual/000077500000000000000000000000001415504077600266745ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/inline-imports-with-manual/_config.js000066400000000000000000000007331415504077600306410ustar00rootroot00000000000000module.exports = { 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/guide/en/#outputmanualchunks' } }; rollup-2.61.1/test/function/samples/deprecated/inline-imports-with-manual/lib.js000066400000000000000000000000311415504077600277720ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/function/samples/deprecated/inline-imports-with-manual/main.js000066400000000000000000000000741415504077600301570ustar00rootroot00000000000000import('./lib').then(({value}) => assert.equal(value, 42)); rollup-2.61.1/test/function/samples/deprecated/inline-imports-with-multiple-array/000077500000000000000000000000001415504077600303665ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/inline-imports-with-multiple-array/_config.js000066400000000000000000000007551415504077600323370ustar00rootroot00000000000000module.exports = { 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/guide/en/#outputinlinedynamicimports' } }; rollup-2.61.1/test/function/samples/deprecated/inline-imports-with-multiple-array/lib.js000066400000000000000000000000311415504077600314640ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/function/samples/deprecated/inline-imports-with-multiple-array/main.js000066400000000000000000000000741415504077600316510ustar00rootroot00000000000000import('./lib').then(({value}) => assert.equal(value, 42)); rollup-2.61.1/test/function/samples/deprecated/inline-imports-with-multiple-object/000077500000000000000000000000001415504077600305165ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/inline-imports-with-multiple-object/_config.js000066400000000000000000000007731415504077600324670ustar00rootroot00000000000000module.exports = { 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/guide/en/#outputinlinedynamicimports' } }; rollup-2.61.1/test/function/samples/deprecated/inline-imports-with-multiple-object/lib.js000066400000000000000000000000311415504077600316140ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/function/samples/deprecated/inline-imports-with-multiple-object/main.js000066400000000000000000000000741415504077600320010ustar00rootroot00000000000000import('./lib').then(({value}) => assert.equal(value, 42)); rollup-2.61.1/test/function/samples/deprecated/interop-false/000077500000000000000000000000001415504077600242475ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/interop-false/_config.js000066400000000000000000000022421415504077600262110ustar00rootroot00000000000000let fooModule = 'foo'; let barModule = 'bar'; let barCjs = 'bar'; let fooDefault = 'foo'; let barDefault = 'bar'; module.exports = { description: 'handles interop "false" with live-bindings support', options: { strictDeprecations: false, external: id => id.startsWith('external') || id === 'update', output: { interop: false, 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-2.61.1/test/function/samples/deprecated/interop-false/main.js000066400000000000000000000030251415504077600255310ustar00rootroot00000000000000import 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, { barModule: 'bar', default: 'foo' }, 'module'); assert.deepStrictEqual(fooCjs, { barCjs: 'bar' }, 'cjs'); assert.strictEqual(barCjs, 'bar', 'cjs'); assert.deepStrictEqual(bazCjs, { barCjs: 'bar' }, 'cjs'); assert.deepStrictEqual(fooDefault, { barDefault: 'bar', default: 'foo' }, 'default'); assert.strictEqual(barDefault, 'bar', 'default'); assert.deepStrictEqual(bazDefault, { barDefault: 'bar', default: 'foo' }, 'default'); update(); assert.deepStrictEqual(fooModule, { barModule: 'bar2', default: '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, { barCjs: 'bar2' }, 'cjs'); assert.deepStrictEqual(fooDefault, { barDefault: 'bar2', default: 'foo2' }, 'default'); assert.strictEqual(barDefault, 'bar2', 'default'); assert.deepStrictEqual(bazDefault, { barDefault: 'bar2', default: 'foo2' }, 'default'); rollup-2.61.1/test/function/samples/deprecated/interop-true-live-bindings/000077500000000000000000000000001415504077600266645ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/interop-true-live-bindings/_config.js000066400000000000000000000022401415504077600306240ustar00rootroot00000000000000let fooModule = 'foo'; let barModule = 'bar'; let barCjs = 'bar'; let fooDefault = 'foo'; let barDefault = 'bar'; module.exports = { description: 'handles interop "true" with live-bindings support', options: { strictDeprecations: false, external: id => id.startsWith('external') || id === 'update', output: { interop: true, 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-2.61.1/test/function/samples/deprecated/interop-true-live-bindings/main.js000066400000000000000000000031371415504077600301520ustar00rootroot00000000000000import 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, '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, 'foo2', 'default'); assert.strictEqual(barDefault, 'bar2', 'default'); assert.deepStrictEqual( bazDefault, { __proto__: null, barDefault: 'bar2', default: { barDefault: 'bar2', default: 'foo2' } }, 'default' ); rollup-2.61.1/test/function/samples/deprecated/interop-true-no-live-bindings/000077500000000000000000000000001415504077600272765ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/interop-true-no-live-bindings/_config.js000066400000000000000000000016151415504077600312430ustar00rootroot00000000000000module.exports = { description: 'handles interop "true" without live-bindings support', options: { strictDeprecations: false, external: id => id.startsWith('external') || id === 'update', output: { interop: true, 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-2.61.1/test/function/samples/deprecated/interop-true-no-live-bindings/main.js000066400000000000000000000016621415504077600305650ustar00rootroot00000000000000import 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, 'foo', 'default'); assert.strictEqual(barDefault, 'bar', 'default'); assert.deepStrictEqual( bazDefault, { __proto__: null, barDefault: 'bar', default: { barDefault: 'bar', default: 'foo' } }, 'default' ); rollup-2.61.1/test/function/samples/deprecated/keep-used-imports-from-pure-external-modules/000077500000000000000000000000001415504077600322545ustar00rootroot00000000000000_config.js000066400000000000000000000013061415504077600341370ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/keep-used-imports-from-pure-external-modulesconst assert = require('assert'); module.exports = { description: 'imports from pure external modules that are used should not be omitted', options: { strictDeprecations: false, external: ['warning'], treeshake: { pureExternalModules: ['warning'] } }, context: { require: id => { if (id === 'warning') return arg => assert.equal(arg, 'hi'); throw new Error('Unexpected import', id); } }, warnings: [ { code: 'DEPRECATED_FEATURE', message: `The "treeshake.pureExternalModules" option is deprecated. The "treeshake.moduleSideEffects" option should be used instead. "treeshake.pureExternalModules: true" is equivalent to "treeshake.moduleSideEffects: 'no-external'"` } ] }; rollup-2.61.1/test/function/samples/deprecated/keep-used-imports-from-pure-external-modules/main.js000066400000000000000000000000571415504077600335400ustar00rootroot00000000000000import warning from 'warning'; warning('hi'); rollup-2.61.1/test/function/samples/deprecated/manual-chunks-conflict/000077500000000000000000000000001415504077600260445ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/manual-chunks-conflict/_config.js000066400000000000000000000005621415504077600300110ustar00rootroot00000000000000module.exports = { 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.` } }; rollup-2.61.1/test/function/samples/deprecated/manual-chunks-conflict/dep.js000066400000000000000000000000241415504077600271460ustar00rootroot00000000000000console.log('dep'); rollup-2.61.1/test/function/samples/deprecated/manual-chunks-conflict/main.js000066400000000000000000000000231415504077600273210ustar00rootroot00000000000000import './dep.js'; rollup-2.61.1/test/function/samples/deprecated/manual-chunks-info/000077500000000000000000000000001415504077600251765ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/manual-chunks-info/_config.js000066400000000000000000000145671415504077600271550ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); function getId(name) { return path.join(__dirname, `${name}.js`); } module.exports = { description: 'provides additional chunk information to a manualChunks function', options: { strictDeprecations: false, external: 'external', output: { manualChunks(id, { getModuleIds, getModuleInfo }) { assert.deepStrictEqual( [...getModuleIds()], [getId('main'), 'external', getId('lib'), getId('dynamic')] ); assert.deepStrictEqual( JSON.parse(JSON.stringify([...getModuleIds()].map(id => getModuleInfo(id)))), [ { 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", dynamicallyImportedIds: [getId('dynamic')], dynamicImporters: [], hasModuleSideEffects: true, id: getId('main'), implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIds: [getId('lib'), 'external'], importers: [], isEntry: true, isExternal: false, meta: {}, syntheticNamedExports: false }, { ast: null, code: null, dynamicallyImportedIds: [], dynamicImporters: [getId('dynamic')], hasModuleSideEffects: true, id: 'external', implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIds: [], importers: [getId('main')], isEntry: false, isExternal: true, meta: {}, syntheticNamedExports: false }, { 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', dynamicallyImportedIds: [], dynamicImporters: [], hasModuleSideEffects: true, id: getId('lib'), implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIds: [], importers: [getId('dynamic'), getId('main')], isEntry: false, isExternal: false, meta: {}, syntheticNamedExports: false }, { 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", dynamicallyImportedIds: ['external'], dynamicImporters: [getId('main')], hasModuleSideEffects: true, id: getId('dynamic'), implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIds: [getId('lib')], importers: [], isEntry: false, isExternal: false, meta: {}, syntheticNamedExports: false } ] ); } } } }; rollup-2.61.1/test/function/samples/deprecated/manual-chunks-info/dynamic.js000066400000000000000000000001301415504077600271520ustar00rootroot00000000000000export const promise = import('external'); export { default as internal } from './lib'; rollup-2.61.1/test/function/samples/deprecated/manual-chunks-info/lib.js000066400000000000000000000000231415504077600262750ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/deprecated/manual-chunks-info/main.js000066400000000000000000000001731415504077600264610ustar00rootroot00000000000000export const promise = import('./dynamic'); export { default as value } from './lib'; export { external } from 'external'; rollup-2.61.1/test/function/samples/deprecated/manual-chunks-preserve-modules/000077500000000000000000000000001415504077600275445ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/manual-chunks-preserve-modules/_config.js000066400000000000000000000007111415504077600315050ustar00rootroot00000000000000module.exports = { 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/guide/en/#outputmanualchunks' } }; rollup-2.61.1/test/function/samples/deprecated/manual-chunks-preserve-modules/lib.js000066400000000000000000000000311415504077600306420ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/function/samples/deprecated/manual-chunks-preserve-modules/main.js000066400000000000000000000000711415504077600310240ustar00rootroot00000000000000import { value } from './lib'; assert.equal(value, 42); rollup-2.61.1/test/function/samples/deprecated/nested-inlined-dynamic-import-1/000077500000000000000000000000001415504077600274715ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/nested-inlined-dynamic-import-1/_config.js000066400000000000000000000004661415504077600314410ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/deprecated/nested-inlined-dynamic-import-1/foo.js000066400000000000000000000000311415504077600306040ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/function/samples/deprecated/nested-inlined-dynamic-import-1/main.js000066400000000000000000000001411415504077600307470ustar00rootroot00000000000000export default () => { const foo = 1; return import('./foo.js').then(ns => ns.value + foo); }; rollup-2.61.1/test/function/samples/deprecated/plugin-module-ids/000077500000000000000000000000001415504077600250355ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/plugin-module-ids/_config.js000066400000000000000000000007541415504077600270050ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); let rendered = false; module.exports = { description: 'provides all module ids on the plugin context', options: { strictDeprecations: false, external: ['path'], plugins: { renderStart() { rendered = true; assert.deepStrictEqual(Array.from(this.moduleIds), [ path.join(__dirname, 'main.js'), path.join(__dirname, 'foo.js'), 'path' ]); } } }, bundle() { assert.ok(rendered); } }; rollup-2.61.1/test/function/samples/deprecated/plugin-module-ids/foo.js000066400000000000000000000001021415504077600261470ustar00rootroot00000000000000import path from 'path'; export const foo = path.resolve('foo'); rollup-2.61.1/test/function/samples/deprecated/plugin-module-ids/main.js000066400000000000000000000001041415504077600263120ustar00rootroot00000000000000export { foo } from './foo.js'; export const path = import('path'); rollup-2.61.1/test/function/samples/deprecated/preserveModules/000077500000000000000000000000001415504077600246635ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/preserveModules/inline-dynamic-imports/000077500000000000000000000000001415504077600312565ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/preserveModules/inline-dynamic-imports/_config.js000066400000000000000000000007311415504077600332210ustar00rootroot00000000000000module.exports = { 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/guide/en/#outputinlinedynamicimports' } }; rollup-2.61.1/test/function/samples/deprecated/preserveModules/inline-dynamic-imports/lib.js000066400000000000000000000000311415504077600323540ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/function/samples/deprecated/preserveModules/inline-dynamic-imports/main.js000066400000000000000000000000741415504077600325410ustar00rootroot00000000000000import('./lib').then(({value}) => assert.equal(value, 42)); rollup-2.61.1/test/function/samples/deprecated/preserveModules/invalid-default-export-mode/000077500000000000000000000000001415504077600321745ustar00rootroot00000000000000_config.js000066400000000000000000000006211415504077600340560ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/preserveModules/invalid-default-export-modemodule.exports = { 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' } }; rollup-2.61.1/test/function/samples/deprecated/preserveModules/invalid-default-export-mode/lib.js000066400000000000000000000000311415504077600332720ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/function/samples/deprecated/preserveModules/invalid-default-export-mode/main.js000066400000000000000000000001161415504077600334540ustar00rootroot00000000000000import { value } from './lib.js'; assert.equal(value, 42); export default 43; rollup-2.61.1/test/function/samples/deprecated/preserveModules/invalid-no-preserve-entry-signatures/000077500000000000000000000000001415504077600340755ustar00rootroot00000000000000_config.js000066400000000000000000000007321415504077600357620ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/preserveModules/invalid-no-preserve-entry-signaturesmodule.exports = { 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/guide/en/#preserveentrysignatures' } }; main.js000066400000000000000000000000311415504077600352720ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/preserveModules/invalid-no-preserve-entry-signaturesexport const value = 42; rollup-2.61.1/test/function/samples/deprecated/preserveModules/invalid-none-export-mode/000077500000000000000000000000001415504077600315075ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/preserveModules/invalid-none-export-mode/_config.js000066400000000000000000000006101415504077600334460ustar00rootroot00000000000000module.exports = { 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' } }; rollup-2.61.1/test/function/samples/deprecated/preserveModules/invalid-none-export-mode/lib.js000066400000000000000000000000311415504077600326050ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/function/samples/deprecated/preserveModules/invalid-none-export-mode/main.js000066400000000000000000000000741415504077600327720ustar00rootroot00000000000000import { value } from './lib.js'; assert.equal(value, 42); rollup-2.61.1/test/function/samples/deprecated/preserveModules/manual-chunks/000077500000000000000000000000001415504077600274315ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/preserveModules/manual-chunks/_config.js000066400000000000000000000007341415504077600313770ustar00rootroot00000000000000module.exports = { 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/guide/en/#outputmanualchunks' } }; rollup-2.61.1/test/function/samples/deprecated/preserveModules/manual-chunks/lib.js000066400000000000000000000000311415504077600305270ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/function/samples/deprecated/preserveModules/manual-chunks/main.js000066400000000000000000000000711415504077600307110ustar00rootroot00000000000000import { value } from './lib'; assert.equal(value, 42); rollup-2.61.1/test/function/samples/deprecated/preserveModules/mixed-exports/000077500000000000000000000000001415504077600274735ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/preserveModules/mixed-exports/_config.js000066400000000000000000000020021415504077600314270ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'warns for mixed exports in all chunks when preserving modules', options: { strictDeprecations: false, input: ['main.js'], preserveModules: true }, warnings: [ { code: 'MIXED_EXPORTS', id: path.join(__dirname, 'main.js'), 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/guide/en/#outputexports' }, { code: 'MIXED_EXPORTS', id: path.join(__dirname, 'lib1.js'), 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/guide/en/#outputexports' } ] }; rollup-2.61.1/test/function/samples/deprecated/preserveModules/mixed-exports/lib1.js000066400000000000000000000000551415504077600306600ustar00rootroot00000000000000export const value1 = 42; export default 42; rollup-2.61.1/test/function/samples/deprecated/preserveModules/mixed-exports/lib2.js000066400000000000000000000000231415504077600306540ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/deprecated/preserveModules/mixed-exports/lib3.js000066400000000000000000000000321415504077600306550ustar00rootroot00000000000000export const value3 = 42; rollup-2.61.1/test/function/samples/deprecated/preserveModules/mixed-exports/main.js000066400000000000000000000003651415504077600307610ustar00rootroot00000000000000import 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-2.61.1/test/function/samples/deprecated/preserveModules/virtual-modules-conflict/000077500000000000000000000000001415504077600316165ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/preserveModules/virtual-modules-conflict/_config.js000066400000000000000000000015251415504077600335630ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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'] ) ); } }; rollup-2.61.1/test/function/samples/deprecated/preserveModules/virtual-modules-conflict/_virtual/000077500000000000000000000000001415504077600334435ustar00rootroot00000000000000_virtualModule.js000066400000000000000000000001101415504077600367050ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/preserveModules/virtual-modules-conflict/_virtualexport const notSoVirtual = 'real'; assert.equal(virtual, 'Virtual!'); rollup-2.61.1/test/function/samples/deprecated/preserveModules/virtual-modules-conflict/main.js000066400000000000000000000002021415504077600330720ustar00rootroot00000000000000import { notSoVirtual } from './_virtual/_virtualModule'; assert.equal(virtual, 'Virtual!'); assert.equal(notSoVirtual, 'real'); rollup-2.61.1/test/function/samples/deprecated/preserveModules/virtual-modules/000077500000000000000000000000001415504077600300175ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/preserveModules/virtual-modules/_config.js000066400000000000000000000014701415504077600317630ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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'] ) ); } }; rollup-2.61.1/test/function/samples/deprecated/preserveModules/virtual-modules/lib/000077500000000000000000000000001415504077600305655ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecated/preserveModules/virtual-modules/lib/lib.js000066400000000000000000000000431415504077600316660ustar00rootroot00000000000000assert.equal(virtual, 'Virtual!'); rollup-2.61.1/test/function/samples/deprecated/preserveModules/virtual-modules/main.js000066400000000000000000000000731415504077600313010ustar00rootroot00000000000000import './lib/lib.js'; assert.equal(virtual, 'Virtual!'); rollup-2.61.1/test/function/samples/deprecations/000077500000000000000000000000001415504077600220575ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecations/ROLLUP_ASSET_URL/000077500000000000000000000000001415504077600245555ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecations/ROLLUP_ASSET_URL/_config.js000066400000000000000000000007051415504077600265210ustar00rootroot00000000000000module.exports = { description: 'marks ROLLUP_ASSET_URL as deprecated', options: { plugins: { load() { return `export default import.meta.ROLLUP_ASSET_URL_${this.emitFile({ type: 'asset', name: 'asset', source: 'asset' })};`; } } }, generateError: { code: 'DEPRECATED_FEATURE', message: 'Using the "ROLLUP_ASSET_URL_" prefix to reference files is deprecated. Use the "ROLLUP_FILE_URL_" prefix instead.' } }; rollup-2.61.1/test/function/samples/deprecations/ROLLUP_ASSET_URL/main.js000066400000000000000000000002231415504077600260340ustar00rootroot00000000000000const foo = {}; function doIt(x) { if (foo[x]) { return true; } foo[x] = true; } doIt('x'); assert.ok(doIt('x'), 'foo was not reassigned'); rollup-2.61.1/test/function/samples/deprecations/ROLLUP_CHUNK_URL/000077500000000000000000000000001415504077600245465ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecations/ROLLUP_CHUNK_URL/_config.js000066400000000000000000000010741415504077600265120ustar00rootroot00000000000000module.exports = { description: 'marks ROLLUP_CHUNK_URL as deprecated', options: { plugins: { resolveId(id) { if (id === 'chunk') { return id; } }, load(id) { if (id === 'chunk') { return "console.log('chunk')"; } return `export default import.meta.ROLLUP_CHUNK_URL_${this.emitFile({ type: 'chunk', id: 'chunk' })};`; } } }, generateError: { code: 'DEPRECATED_FEATURE', message: 'Using the "ROLLUP_CHUNK_URL_" prefix to reference files is deprecated. Use the "ROLLUP_FILE_URL_" prefix instead.' } }; rollup-2.61.1/test/function/samples/deprecations/ROLLUP_CHUNK_URL/main.js000066400000000000000000000002231415504077600260250ustar00rootroot00000000000000const foo = {}; function doIt(x) { if (foo[x]) { return true; } foo[x] = true; } doIt('x'); assert.ok(doIt('x'), 'foo was not reassigned'); rollup-2.61.1/test/function/samples/deprecations/dynamicImportFunction/000077500000000000000000000000001415504077600264045ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecations/dynamicImportFunction/_config.js000066400000000000000000000005241415504077600303470ustar00rootroot00000000000000module.exports = { 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.' } }; rollup-2.61.1/test/function/samples/deprecations/dynamicImportFunction/main.js000066400000000000000000000002231415504077600276630ustar00rootroot00000000000000const foo = {}; function doIt(x) { if (foo[x]) { return true; } foo[x] = true; } doIt('x'); assert.ok(doIt('x'), 'foo was not reassigned'); rollup-2.61.1/test/function/samples/deprecations/inlineDynamicImports/000077500000000000000000000000001415504077600262205ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecations/inlineDynamicImports/_config.js000066400000000000000000000004621415504077600301640ustar00rootroot00000000000000module.exports = { 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.' } }; rollup-2.61.1/test/function/samples/deprecations/inlineDynamicImports/main.js000066400000000000000000000000231415504077600274750ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/deprecations/interop-false-function/000077500000000000000000000000001415504077600264525ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecations/interop-false-function/_config.js000066400000000000000000000007451415504077600304220ustar00rootroot00000000000000module.exports = { description: 'marks "false" for the "output.interop" option as deprecated when using the function form', options: { strictDeprecations: true, external: 'external', output: { interop: () => false } }, generateError: { code: 'DEPRECATED_FEATURE', message: 'The boolean value "false" for the "output.interop" option is deprecated. Use "esModule", "default" or "defaultOnly" instead.', url: 'https://rollupjs.org/guide/en/#outputinterop' } }; rollup-2.61.1/test/function/samples/deprecations/interop-false-function/main.js000066400000000000000000000000441415504077600277320ustar00rootroot00000000000000export { default } from 'external'; rollup-2.61.1/test/function/samples/deprecations/interop-false/000077500000000000000000000000001415504077600246275ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecations/interop-false/_config.js000066400000000000000000000007001415504077600265660ustar00rootroot00000000000000module.exports = { description: 'marks "false" for the "output.interop" option as deprecated', options: { strictDeprecations: true, external: 'external', output: { interop: false } }, generateError: { code: 'DEPRECATED_FEATURE', message: 'The boolean value "false" for the "output.interop" option is deprecated. Use "esModule", "default" or "defaultOnly" instead.', url: 'https://rollupjs.org/guide/en/#outputinterop' } }; rollup-2.61.1/test/function/samples/deprecations/interop-false/main.js000066400000000000000000000000441415504077600261070ustar00rootroot00000000000000export { default } from 'external'; rollup-2.61.1/test/function/samples/deprecations/interop-true-function/000077500000000000000000000000001415504077600263375ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecations/interop-true-function/_config.js000066400000000000000000000007021415504077600303000ustar00rootroot00000000000000module.exports = { description: 'marks "true" for the "output.interop" option as deprecated when using the function form', options: { strictDeprecations: true, external: 'external', output: { interop: () => true } }, generateError: { code: 'DEPRECATED_FEATURE', message: 'The boolean value "true" for the "output.interop" option is deprecated. Use "auto" instead.', url: 'https://rollupjs.org/guide/en/#outputinterop' } }; rollup-2.61.1/test/function/samples/deprecations/interop-true-function/main.js000066400000000000000000000000441415504077600276170ustar00rootroot00000000000000export { default } from 'external'; rollup-2.61.1/test/function/samples/deprecations/interop-true/000077500000000000000000000000001415504077600245145ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecations/interop-true/_config.js000066400000000000000000000006351415504077600264620ustar00rootroot00000000000000module.exports = { description: 'marks "true" for the "output.interop" option as deprecated', options: { strictDeprecations: true, external: 'external', output: { interop: true } }, generateError: { code: 'DEPRECATED_FEATURE', message: 'The boolean value "true" for the "output.interop" option is deprecated. Use "auto" instead.', url: 'https://rollupjs.org/guide/en/#outputinterop' } }; rollup-2.61.1/test/function/samples/deprecations/interop-true/main.js000066400000000000000000000000441415504077600257740ustar00rootroot00000000000000export { default } from 'external'; rollup-2.61.1/test/function/samples/deprecations/manualChunks/000077500000000000000000000000001415504077600245105ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecations/manualChunks/_config.js000066400000000000000000000004501415504077600264510ustar00rootroot00000000000000module.exports = { 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.' } }; rollup-2.61.1/test/function/samples/deprecations/manualChunks/main.js000066400000000000000000000000231415504077600257650ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/deprecations/plugin-module-ids/000077500000000000000000000000001415504077600254155ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecations/plugin-module-ids/_config.js000066400000000000000000000007741415504077600273670ustar00rootroot00000000000000module.exports = { 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' } }; rollup-2.61.1/test/function/samples/deprecations/plugin-module-ids/foo.js000066400000000000000000000001021415504077600265270ustar00rootroot00000000000000import path from 'path'; export const foo = path.resolve('foo'); rollup-2.61.1/test/function/samples/deprecations/plugin-module-ids/main.js000066400000000000000000000000401415504077600266710ustar00rootroot00000000000000export { foo } from './foo.js'; rollup-2.61.1/test/function/samples/deprecations/prefer-const/000077500000000000000000000000001415504077600244665ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecations/prefer-const/_config.js000066400000000000000000000004771415504077600264400ustar00rootroot00000000000000module.exports = { 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.' } }; rollup-2.61.1/test/function/samples/deprecations/prefer-const/main.js000066400000000000000000000000231415504077600257430ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/deprecations/preserveModules/000077500000000000000000000000001415504077600252435ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecations/preserveModules/_config.js000066400000000000000000000004361415504077600272100ustar00rootroot00000000000000module.exports = { 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.' } }; rollup-2.61.1/test/function/samples/deprecations/preserveModules/main.js000066400000000000000000000000231415504077600265200ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/deprecations/resolveAssetUrl/000077500000000000000000000000001415504077600252215ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecations/resolveAssetUrl/_config.js000066400000000000000000000005341415504077600271650ustar00rootroot00000000000000module.exports = { description: 'marks the resolveAssetUrl hook as deprecated', options: { plugins: { resolveAssetUrl() {} } }, error: { code: 'DEPRECATED_FEATURE', message: 'The "resolveAssetUrl" hook used by plugin at position 1 is deprecated. The "resolveFileUrl" hook should be used instead.', plugin: 'at position 1' } }; rollup-2.61.1/test/function/samples/deprecations/resolveAssetUrl/main.js000066400000000000000000000002231415504077600265000ustar00rootroot00000000000000const foo = {}; function doIt(x) { if (foo[x]) { return true; } foo[x] = true; } doIt('x'); assert.ok(doIt('x'), 'foo was not reassigned'); rollup-2.61.1/test/function/samples/deprecations/this-emitAsset/000077500000000000000000000000001415504077600247625ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecations/this-emitAsset/_config.js000066400000000000000000000007141415504077600267260ustar00rootroot00000000000000module.exports = { description: 'marks this.emitAsset as deprecated', options: { plugins: { buildStart() { this.emitAsset('asset', 'asset'); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: `The "this.emitAsset" plugin context function used by plugin at position 1 is deprecated. The "this.emitFile" plugin context function should be used instead.`, plugin: 'at position 1', pluginCode: 'DEPRECATED_FEATURE' } }; rollup-2.61.1/test/function/samples/deprecations/this-emitAsset/main.js000066400000000000000000000002231415504077600262410ustar00rootroot00000000000000const foo = {}; function doIt(x) { if (foo[x]) { return true; } foo[x] = true; } doIt('x'); assert.ok(doIt('x'), 'foo was not reassigned'); rollup-2.61.1/test/function/samples/deprecations/this-emitChunk/000077500000000000000000000000001415504077600247535ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecations/this-emitChunk/_config.js000066400000000000000000000007031415504077600267150ustar00rootroot00000000000000module.exports = { description: 'marks this.emitChunk as deprecated', options: { plugins: { buildStart() { this.emitChunk('chunk'); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: `The "this.emitChunk" plugin context function used by plugin at position 1 is deprecated. The "this.emitFile" plugin context function should be used instead.`, plugin: 'at position 1', pluginCode: 'DEPRECATED_FEATURE' } }; rollup-2.61.1/test/function/samples/deprecations/this-emitChunk/main.js000066400000000000000000000002231415504077600262320ustar00rootroot00000000000000const foo = {}; function doIt(x) { if (foo[x]) { return true; } foo[x] = true; } doIt('x'); assert.ok(doIt('x'), 'foo was not reassigned'); rollup-2.61.1/test/function/samples/deprecations/this-getAssetFileName/000077500000000000000000000000001415504077600262045ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecations/this-getAssetFileName/_config.js000066400000000000000000000010411415504077600301420ustar00rootroot00000000000000module.exports = { description: 'marks this.getAssetFileName as deprecated', options: { plugins: { renderChunk() { this.getAssetFileName(this.emitFile({ type: 'asset', name: 'asset', source: 'asset' })); } } }, generateError: { code: 'PLUGIN_ERROR', hook: 'renderChunk', message: 'The "this.getAssetFileName" plugin context function used by plugin at position 1 is deprecated. The "this.getFileName" plugin context function should be used instead.', plugin: 'at position 1', pluginCode: 'DEPRECATED_FEATURE' } }; rollup-2.61.1/test/function/samples/deprecations/this-getAssetFileName/main.js000066400000000000000000000002231415504077600274630ustar00rootroot00000000000000const foo = {}; function doIt(x) { if (foo[x]) { return true; } foo[x] = true; } doIt('x'); assert.ok(doIt('x'), 'foo was not reassigned'); rollup-2.61.1/test/function/samples/deprecations/this-getChunkFileName/000077500000000000000000000000001415504077600261755ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecations/this-getChunkFileName/_config.js000066400000000000000000000011461415504077600301410ustar00rootroot00000000000000let chunkReferenceId; module.exports = { description: 'marks this.getChunkFileName as deprecated', options: { plugins: { buildStart() { chunkReferenceId = this.emitFile({ type: 'chunk', id: 'chunk' }); }, renderChunk() { this.getChunkFileName(chunkReferenceId); } } }, generateError: { code: 'PLUGIN_ERROR', hook: 'renderChunk', message: 'The "this.getChunkFileName" plugin context function used by plugin at position 1 is deprecated. The "this.getFileName" plugin context function should be used instead.', plugin: 'at position 1', pluginCode: 'DEPRECATED_FEATURE' } }; rollup-2.61.1/test/function/samples/deprecations/this-getChunkFileName/chunk.js000066400000000000000000000000241415504077600276370ustar00rootroot00000000000000assert.equal(1, 1); rollup-2.61.1/test/function/samples/deprecations/this-getChunkFileName/main.js000066400000000000000000000002231415504077600274540ustar00rootroot00000000000000const foo = {}; function doIt(x) { if (foo[x]) { return true; } foo[x] = true; } doIt('x'); assert.ok(doIt('x'), 'foo was not reassigned'); rollup-2.61.1/test/function/samples/deprecations/this-isExternal/000077500000000000000000000000001415504077600251425ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecations/this-isExternal/_config.js000066400000000000000000000007131415504077600271050ustar00rootroot00000000000000module.exports = { description: 'marks this.isExternal as deprecated', options: { plugins: { buildStart() { this.isExternal('external'); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'The "this.isExternal" plugin context function used by plugin at position 1 is deprecated. The "this.resolve" plugin context function should be used instead.', plugin: 'at position 1', pluginCode: 'DEPRECATED_FEATURE' } }; rollup-2.61.1/test/function/samples/deprecations/this-isExternal/main.js000066400000000000000000000002231415504077600264210ustar00rootroot00000000000000const foo = {}; function doIt(x) { if (foo[x]) { return true; } foo[x] = true; } doIt('x'); assert.ok(doIt('x'), 'foo was not reassigned'); rollup-2.61.1/test/function/samples/deprecations/this-resolveId/000077500000000000000000000000001415504077600247605ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecations/this-resolveId/_config.js000066400000000000000000000007101415504077600267200ustar00rootroot00000000000000module.exports = { description: 'marks this.resolveId as deprecated', options: { plugins: { buildStart() { this.resolveId('external'); } } }, error: { code: 'PLUGIN_ERROR', hook: 'buildStart', message: 'The "this.resolveId" plugin context function used by plugin at position 1 is deprecated. The "this.resolve" plugin context function should be used instead.', plugin: 'at position 1', pluginCode: 'DEPRECATED_FEATURE' } }; rollup-2.61.1/test/function/samples/deprecations/this-resolveId/main.js000066400000000000000000000002231415504077600262370ustar00rootroot00000000000000const foo = {}; function doIt(x) { if (foo[x]) { return true; } foo[x] = true; } doIt('x'); assert.ok(doIt('x'), 'foo was not reassigned'); rollup-2.61.1/test/function/samples/deprecations/treeshake-pureExternalModules/000077500000000000000000000000001415504077600300375ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deprecations/treeshake-pureExternalModules/_config.js000066400000000000000000000006661415504077600320110ustar00rootroot00000000000000module.exports = { description: 'marks the treeshake.pureExternalModules option as deprecated', options: { treeshake: { pureExternalModules: true } }, error: { code: 'DEPRECATED_FEATURE', message: `The "treeshake.pureExternalModules" option is deprecated. The "treeshake.moduleSideEffects" option should be used instead. "treeshake.pureExternalModules: true" is equivalent to "treeshake.moduleSideEffects: 'no-external'"` } }; rollup-2.61.1/test/function/samples/deprecations/treeshake-pureExternalModules/main.js000066400000000000000000000002231415504077600313160ustar00rootroot00000000000000const foo = {}; function doIt(x) { if (foo[x]) { return true; } foo[x] = true; } doIt('x'); assert.ok(doIt('x'), 'foo was not reassigned'); rollup-2.61.1/test/function/samples/deshadow-respect-existing/000077500000000000000000000000001415504077600244705ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deshadow-respect-existing/_config.js000066400000000000000000000003151415504077600264310ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'respect existing variable names when deshadowing', exports(exports) { assert.equal(exports.getValue(), 'mainmainmainmaindep'); } }; rollup-2.61.1/test/function/samples/deshadow-respect-existing/dep.js000066400000000000000000000000371415504077600255760ustar00rootroot00000000000000export const conflict = 'dep'; rollup-2.61.1/test/function/samples/deshadow-respect-existing/main.js000066400000000000000000000003671415504077600257600ustar00rootroot00000000000000import * 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-2.61.1/test/function/samples/deshadow-top-level-declaration/000077500000000000000000000000001415504077600253655ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deshadow-top-level-declaration/_config.js000066400000000000000000000001071415504077600273250ustar00rootroot00000000000000module.exports = { description: 'deshadows top-level declarations' }; rollup-2.61.1/test/function/samples/deshadow-top-level-declaration/a.js000066400000000000000000000000161415504077600261400ustar00rootroot00000000000000import './x'; rollup-2.61.1/test/function/samples/deshadow-top-level-declaration/b.js000066400000000000000000000001221415504077600261370ustar00rootroot00000000000000import { foo as _foo } from './foo'; export default function foo () { _foo(); } rollup-2.61.1/test/function/samples/deshadow-top-level-declaration/foo.js000066400000000000000000000000441415504077600265040ustar00rootroot00000000000000function foo () {} export { foo }; rollup-2.61.1/test/function/samples/deshadow-top-level-declaration/main.js000066400000000000000000000001321415504077600266430ustar00rootroot00000000000000import './foo'; import './a'; import b from './b'; assert.equal( typeof b, 'function' ); rollup-2.61.1/test/function/samples/deshadow-top-level-declaration/x.js000066400000000000000000000000701415504077600261670ustar00rootroot00000000000000import { foo } from './foo'; function x () { foo(); } rollup-2.61.1/test/function/samples/deshadowed-destructured-parameter/000077500000000000000000000000001415504077600261775ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deshadowed-destructured-parameter/_config.js000066400000000000000000000001431415504077600301370ustar00rootroot00000000000000module.exports = { description: 'correctly deshadows destructured function parameters (#1008)' }; rollup-2.61.1/test/function/samples/deshadowed-destructured-parameter/main.js000066400000000000000000000001541415504077600274610ustar00rootroot00000000000000import { x } from './x.js'; let y; function foo ({ x = 42 }) { y = x; } foo({}); assert.equal( y, 42 ); rollup-2.61.1/test/function/samples/deshadowed-destructured-parameter/x.js000066400000000000000000000000331415504077600270000ustar00rootroot00000000000000export var x = 'whatever'; rollup-2.61.1/test/function/samples/deshadowed-namespaced-external-import-ignored/000077500000000000000000000000001415504077600303615ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deshadowed-namespaced-external-import-ignored/_config.js000066400000000000000000000003141415504077600323210ustar00rootroot00000000000000module.exports = { description: '#1547', options: { external: ['external'] }, context: { require: id => { if (id === 'external') return { foo: () => 42 }; throw new Error('huh?'); } } }; rollup-2.61.1/test/function/samples/deshadowed-namespaced-external-import-ignored/foo.js000066400000000000000000000000561415504077600315030ustar00rootroot00000000000000import * as ns from 'external'; export { ns };rollup-2.61.1/test/function/samples/deshadowed-namespaced-external-import-ignored/main.js000066400000000000000000000001721415504077600316430ustar00rootroot00000000000000import { ns } from './foo.js'; assert.equal((() => { function foo() { return ns.foo(); } return foo(); })(), 42); rollup-2.61.1/test/function/samples/deshadowed-namespaced-external-import-ignored/ns.js000066400000000000000000000000451415504077600313360ustar00rootroot00000000000000export function foo() { return 42; }rollup-2.61.1/test/function/samples/deshadowed-namespaced-import-renamed/000077500000000000000000000000001415504077600265255ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deshadowed-namespaced-import-renamed/_config.js000066400000000000000000000000541415504077600304660ustar00rootroot00000000000000module.exports = { description: '#1550' }; rollup-2.61.1/test/function/samples/deshadowed-namespaced-import-renamed/foo.js000066400000000000000000000000301415504077600276370ustar00rootroot00000000000000export * from './ns.js';rollup-2.61.1/test/function/samples/deshadowed-namespaced-import-renamed/main.js000066400000000000000000000002031415504077600300020ustar00rootroot00000000000000import { foo as doFoo } from './foo.js'; assert.equal((() => { function foo() { return doFoo(); } return foo(); })(), 42); rollup-2.61.1/test/function/samples/deshadowed-namespaced-import-renamed/ns.js000066400000000000000000000000451415504077600275020ustar00rootroot00000000000000export function foo() { return 42; }rollup-2.61.1/test/function/samples/deshadowed-namespaced-import/000077500000000000000000000000001415504077600251145ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deshadowed-namespaced-import/_config.js000066400000000000000000000000541415504077600270550ustar00rootroot00000000000000module.exports = { description: '#1488' }; rollup-2.61.1/test/function/samples/deshadowed-namespaced-import/foo.js000066400000000000000000000000551415504077600262350ustar00rootroot00000000000000import * as ns from './ns.js'; export { ns };rollup-2.61.1/test/function/samples/deshadowed-namespaced-import/main.js000066400000000000000000000001721415504077600263760ustar00rootroot00000000000000import { ns } from './foo.js'; assert.equal((() => { function foo() { return ns.foo(); } return foo(); })(), 42); rollup-2.61.1/test/function/samples/deshadowed-namespaced-import/ns.js000066400000000000000000000000451415504077600260710ustar00rootroot00000000000000export function foo() { return 42; }rollup-2.61.1/test/function/samples/deshadowed-shorthand-property/000077500000000000000000000000001415504077600253605ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deshadowed-shorthand-property/_config.js000066400000000000000000000001511415504077600273170ustar00rootroot00000000000000module.exports = { description: 'shorthand properties referencing deshadowed variables are expanded' }; rollup-2.61.1/test/function/samples/deshadowed-shorthand-property/foo.js000066400000000000000000000000621415504077600264770ustar00rootroot00000000000000export default function answer () { return 42; } rollup-2.61.1/test/function/samples/deshadowed-shorthand-property/main.js000066400000000000000000000001711415504077600266410ustar00rootroot00000000000000import foo from './foo.js'; function x () { var answer = foo(); return { answer }; } assert.equal( x().answer, 42 ); rollup-2.61.1/test/function/samples/deshadows-function-expression-id/000077500000000000000000000000001415504077600257725ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/deshadows-function-expression-id/_config.js000066400000000000000000000001171415504077600277330ustar00rootroot00000000000000module.exports = { description: 'deshadows function expression ID (#1176)' }; rollup-2.61.1/test/function/samples/deshadows-function-expression-id/foo.js000066400000000000000000000000541415504077600271120ustar00rootroot00000000000000export function foo () { return 'works'; } rollup-2.61.1/test/function/samples/deshadows-function-expression-id/main.js000066400000000000000000000002501415504077600272510ustar00rootroot00000000000000import { foo as _foo } from './foo.js'; function Thing () {}; Thing.prototype.foo = function foo () { return _foo(); }; assert.equal( new Thing().foo(), 'works' ); rollup-2.61.1/test/function/samples/destructuring-loop/000077500000000000000000000000001415504077600232505ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/destructuring-loop/_config.js000066400000000000000000000001241415504077600252070ustar00rootroot00000000000000module.exports = { description: 'handles loops with destructuring declarations' }; rollup-2.61.1/test/function/samples/destructuring-loop/main.js000066400000000000000000000003011415504077600245240ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/disappearing-exported-value/000077500000000000000000000000001415504077600250075ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/disappearing-exported-value/_config.js000066400000000000000000000003451415504077600267530ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'exported values do not mysteriously disappear (#484)', exports(exports) { assert.equal(exports.exportedAnswer, 42); assert.equal(exports.foo(), 42); } }; rollup-2.61.1/test/function/samples/disappearing-exported-value/answer.js000066400000000000000000000000441415504077600266420ustar00rootroot00000000000000var answer = 42; export { answer }; rollup-2.61.1/test/function/samples/disappearing-exported-value/main.js000066400000000000000000000003001415504077600262620ustar00rootroot00000000000000import { answer as importedAnswer } from './answer.js'; export { answer as exportedAnswer } from './answer.js'; export function foo () { var value; value = importedAnswer; return value; } rollup-2.61.1/test/function/samples/do-while-conditional-break/000077500000000000000000000000001415504077600244725ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/do-while-conditional-break/_config.js000066400000000000000000000001551415504077600264350ustar00rootroot00000000000000module.exports = { description: 'handles conditional breaks in do-while loops with unconditional return' }; rollup-2.61.1/test/function/samples/do-while-conditional-break/main.js000066400000000000000000000002661415504077600257600ustar00rootroot00000000000000function test(condition) { do { if (condition) { break; } return false; } while (true); return true; } assert.equal(test(false), false); assert.equal(test(true), true); rollup-2.61.1/test/function/samples/does-not-deconflict-undefined/000077500000000000000000000000001415504077600251765ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/does-not-deconflict-undefined/_config.js000066400000000000000000000001001415504077600271270ustar00rootroot00000000000000module.exports = { description: 'does not rename undefined' }; rollup-2.61.1/test/function/samples/does-not-deconflict-undefined/foo.js000066400000000000000000000000361415504077600263160ustar00rootroot00000000000000export const foo = undefined; rollup-2.61.1/test/function/samples/does-not-deconflict-undefined/main.js000066400000000000000000000000771415504077600264640ustar00rootroot00000000000000import { foo } from './foo.js'; assert.equal(foo, undefined); rollup-2.61.1/test/function/samples/does-not-fail-for-arguments-test/000077500000000000000000000000001415504077600256045ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/does-not-fail-for-arguments-test/_config.js000066400000000000000000000001471415504077600275500ustar00rootroot00000000000000module.exports = { description: 'does not fail when non-integer arguments properties are accessed' }; rollup-2.61.1/test/function/samples/does-not-fail-for-arguments-test/main.js000066400000000000000000000001331415504077600270630ustar00rootroot00000000000000var hasArgsEnumBug = (function() { return arguments.propertyIsEnumerable('length'); }()); rollup-2.61.1/test/function/samples/does-not-hang-on-missing-module/000077500000000000000000000000001415504077600254065ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/does-not-hang-on-missing-module/_config.js000066400000000000000000000011561415504077600273530ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'does not hang on missing module (#53)', warnings: [ { code: 'UNRESOLVED_IMPORT', importer: 'main.js', source: 'unlessYouCreatedThisFileForSomeReason', message: `'unlessYouCreatedThisFileForSomeReason' is imported by main.js, but could not be resolved – treating it as an external dependency`, url: `https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency` } ], runtimeError(error) { assert.equal( error.message.split('\n')[0], "Cannot find module 'unlessYouCreatedThisFileForSomeReason'" ); } }; rollup-2.61.1/test/function/samples/does-not-hang-on-missing-module/main.js000066400000000000000000000001221415504077600266630ustar00rootroot00000000000000import doesNotExist from 'unlessYouCreatedThisFileForSomeReason'; doesNotExist(); rollup-2.61.1/test/function/samples/does-not-mangle-entry-point/000077500000000000000000000000001415504077600246565ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/does-not-mangle-entry-point/_config.js000066400000000000000000000006231415504077600266210ustar00rootroot00000000000000const assert = require('assert'); const modules = { 'x\\y': 'export default 42;', 'x/y': 'export default 24;' }; module.exports = { 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-2.61.1/test/function/samples/double-default-export/000077500000000000000000000000001415504077600236125ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/double-default-export/_config.js000066400000000000000000000011411415504077600255510ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'throws on double default exports', error: { code: 'PARSE_ERROR', message: `Duplicate export 'default'`, id: path.join(__dirname, 'foo.js'), parserError: { loc: { column: 7, line: 2 }, message: "Duplicate export 'default' (2:7)", pos: 25, raisedAt: 34 }, pos: 25, watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'foo.js')], loc: { file: path.join(__dirname, 'foo.js'), line: 2, column: 7 }, frame: ` 1: export default 1; 2: export default 2; ^ ` } }; rollup-2.61.1/test/function/samples/double-default-export/foo.js000066400000000000000000000000441415504077600247310ustar00rootroot00000000000000export default 1; export default 2; rollup-2.61.1/test/function/samples/double-default-export/main.js000066400000000000000000000000601415504077600250700ustar00rootroot00000000000000import foo from './foo.js'; console.log( foo ); rollup-2.61.1/test/function/samples/double-named-export/000077500000000000000000000000001415504077600232525ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/double-named-export/_config.js000066400000000000000000000011531415504077600252140ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'throws on duplicate named exports', error: { code: 'PARSE_ERROR', message: `Duplicate export 'foo'`, id: path.join(__dirname, 'foo.js'), parserError: { loc: { column: 9, line: 3 }, message: "Duplicate export 'foo' (3:9)", pos: 38, raisedAt: 43 }, pos: 38, watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'foo.js')], loc: { file: path.join(__dirname, 'foo.js'), line: 3, column: 9 }, frame: ` 1: var foo = 1; 2: export { foo }; 3: export { foo }; ^ ` } }; rollup-2.61.1/test/function/samples/double-named-export/foo.js000066400000000000000000000000551415504077600243730ustar00rootroot00000000000000var foo = 1; export { foo }; export { foo }; rollup-2.61.1/test/function/samples/double-named-export/main.js000066400000000000000000000000641415504077600245340ustar00rootroot00000000000000import { foo } from './foo.js'; console.log( foo ); rollup-2.61.1/test/function/samples/double-named-reexport/000077500000000000000000000000001415504077600236015ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/double-named-reexport/_config.js000066400000000000000000000011731415504077600255450ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'throws on duplicate named exports', error: { code: 'PARSE_ERROR', message: `Duplicate export 'foo'`, id: path.join(__dirname, 'foo.js'), parserError: { loc: { column: 9, line: 3 }, message: "Duplicate export 'foo' (3:9)", pos: 38, raisedAt: 43 }, pos: 38, watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'foo.js')], loc: { file: path.join(__dirname, 'foo.js'), line: 3, column: 9 }, frame: ` 1: var foo = 1; 2: export { foo }; 3: export { foo } from './bar.js'; ^ ` } }; rollup-2.61.1/test/function/samples/double-named-reexport/bar.js000066400000000000000000000000241415504077600246770ustar00rootroot00000000000000export var foo = 2; rollup-2.61.1/test/function/samples/double-named-reexport/foo.js000066400000000000000000000000751415504077600247240ustar00rootroot00000000000000var foo = 1; export { foo }; export { foo } from './bar.js'; rollup-2.61.1/test/function/samples/double-named-reexport/main.js000066400000000000000000000000641415504077600250630ustar00rootroot00000000000000import { foo } from './foo.js'; console.log( foo ); rollup-2.61.1/test/function/samples/double-namespace-reexport/000077500000000000000000000000001415504077600244515ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/double-namespace-reexport/_config.js000066400000000000000000000004741415504077600264200ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/double-namespace-reexport/first.js000066400000000000000000000000351415504077600261340ustar00rootroot00000000000000export * from './second.js'; rollup-2.61.1/test/function/samples/double-namespace-reexport/main.js000066400000000000000000000000421415504077600257270ustar00rootroot00000000000000export { foo } from './first.js'; rollup-2.61.1/test/function/samples/double-namespace-reexport/second.js000066400000000000000000000000321415504077600262550ustar00rootroot00000000000000export * from 'external'; rollup-2.61.1/test/function/samples/duplicate-import-fails/000077500000000000000000000000001415504077600237555ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/duplicate-import-fails/_config.js000066400000000000000000000014041415504077600257160ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'disallows duplicate imports', error: { code: 'PARSE_ERROR', message: `Identifier 'a' has already been declared`, id: path.join(__dirname, 'main.js'), parserError: { loc: { column: 9, line: 2 }, message: "Identifier 'a' has already been declared (2:9)", pos: 36, raisedAt: 39 }, pos: 36, watchFiles: [path.join(__dirname, 'main.js')], loc: { file: path.join(__dirname, 'main.js'), 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-2.61.1/test/function/samples/duplicate-import-fails/foo.js000066400000000000000000000000221415504077600250700ustar00rootroot00000000000000export var a = 1; rollup-2.61.1/test/function/samples/duplicate-import-fails/main.js000066400000000000000000000001131415504077600252320ustar00rootroot00000000000000import { a } from './foo'; import { a } from './foo'; assert.equal(a, 1); rollup-2.61.1/test/function/samples/duplicate-import-specifier-fails/000077500000000000000000000000001415504077600257245ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/duplicate-import-specifier-fails/_config.js000066400000000000000000000013721415504077600276710ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'disallows duplicate import specifiers', error: { code: 'PARSE_ERROR', message: `Identifier 'a' has already been declared`, id: path.join(__dirname, 'main.js'), parserError: { loc: { column: 12, line: 1 }, message: "Identifier 'a' has already been declared (1:12)", pos: 12, raisedAt: 15 }, pos: 12, watchFiles: [path.join(__dirname, 'main.js')], loc: { file: path.join(__dirname, 'main.js'), 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-2.61.1/test/function/samples/duplicate-import-specifier-fails/foo.js000066400000000000000000000000221415504077600270370ustar00rootroot00000000000000export var a = 1; rollup-2.61.1/test/function/samples/duplicate-import-specifier-fails/main.js000066400000000000000000000000621415504077600272040ustar00rootroot00000000000000import { a, a } from './foo'; assert.equal(a, 1); rollup-2.61.1/test/function/samples/duplicate-input-entry/000077500000000000000000000000001415504077600236455ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/duplicate-input-entry/_config.js000066400000000000000000000004011415504077600256020ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'handles duplicate entry modules when using the object form', options: { input: ['entry', 'entry.js'] }, exports(exports) { assert.deepStrictEqual(exports, { entry: 'main' }); } }; rollup-2.61.1/test/function/samples/duplicate-input-entry/entry.js000066400000000000000000000000331415504077600253400ustar00rootroot00000000000000export var entry = 'main'; rollup-2.61.1/test/function/samples/dynamic-import-default-mode-facade/000077500000000000000000000000001415504077600261005ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/dynamic-import-default-mode-facade/_config.js000066400000000000000000000004741415504077600300470ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/dynamic-import-default-mode-facade/bar.js000066400000000000000000000001361415504077600272020ustar00rootroot00000000000000import foo from './foo.js'; import square from './square.js'; export default square(3) + foo; rollup-2.61.1/test/function/samples/dynamic-import-default-mode-facade/foo.js000066400000000000000000000000741415504077600272220ustar00rootroot00000000000000import square from './square.js'; export default square(2); rollup-2.61.1/test/function/samples/dynamic-import-default-mode-facade/main.js000066400000000000000000000000431415504077600273570ustar00rootroot00000000000000export default import('./foo.js'); rollup-2.61.1/test/function/samples/dynamic-import-default-mode-facade/square.js000066400000000000000000000000331415504077600277320ustar00rootroot00000000000000export default x => x * x; rollup-2.61.1/test/function/samples/dynamic-import-duplicates/000077500000000000000000000000001415504077600244665ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/dynamic-import-duplicates/_config.js000066400000000000000000000004241415504077600264300ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/dynamic-import-duplicates/foo.js000066400000000000000000000000221415504077600256010ustar00rootroot00000000000000export var x = 42;rollup-2.61.1/test/function/samples/dynamic-import-duplicates/main.js000066400000000000000000000002001415504077600257400ustar00rootroot00000000000000export var x = 41; export var promise = Promise.all([import('./foo'), import('./foo')]).then(foos => { return foos[0].x; }); rollup-2.61.1/test/function/samples/dynamic-import-existing/000077500000000000000000000000001415504077600241635ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/dynamic-import-existing/_config.js000066400000000000000000000004351415504077600261270ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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(val => { assert.equal(val, 84); }); } }; rollup-2.61.1/test/function/samples/dynamic-import-existing/foo.js000066400000000000000000000001331415504077600253010ustar00rootroot00000000000000export var x = 42; export var promise = import('./main').then(m => { return m.y * 2; }); rollup-2.61.1/test/function/samples/dynamic-import-existing/main.js000066400000000000000000000000511415504077600254410ustar00rootroot00000000000000export { x as y, promise } from './foo'; rollup-2.61.1/test/function/samples/dynamic-import-expression/000077500000000000000000000000001415504077600245305ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/dynamic-import-expression/_config.js000066400000000000000000000015241415504077600264740ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Dynamic import expression replacement', options: { plugins: [ { resolveDynamicImport(specifier) { if (typeof specifier !== 'string') { // string literal concatenation if ( 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 + '"'; } } } } ] }, exports(exports) { const expectedError = "Cannot find module 'x/y'"; return exports.catch(err => assert.strictEqual(err.message.slice(0, expectedError.length), expectedError) ); } }; rollup-2.61.1/test/function/samples/dynamic-import-expression/main.js000066400000000000000000000000431415504077600260070ustar00rootroot00000000000000export default import('x/' + 'y'); rollup-2.61.1/test/function/samples/dynamic-import-inlining/000077500000000000000000000000001415504077600241405ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/dynamic-import-inlining/_config.js000066400000000000000000000004241415504077600261020ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/dynamic-import-inlining/foo.js000066400000000000000000000000221415504077600252530ustar00rootroot00000000000000export var x = 42;rollup-2.61.1/test/function/samples/dynamic-import-inlining/main.js000066400000000000000000000001331415504077600254170ustar00rootroot00000000000000export var x = 41; export var promise = import('./foo').then(foo => { return foo.x; }); rollup-2.61.1/test/function/samples/dynamic-import-not-found/000077500000000000000000000000001415504077600242425ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/dynamic-import-not-found/_config.js000066400000000000000000000007121415504077600262040ustar00rootroot00000000000000module.exports = { description: 'warns if a dynamic import is not found', context: { require(id) { if (id === 'mod') { return {}; } } }, warnings: [ { code: 'UNRESOLVED_IMPORT', importer: 'main.js', message: "'mod' is imported by main.js, but could not be resolved – treating it as an external dependency", source: 'mod', url: 'https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency' } ] }; rollup-2.61.1/test/function/samples/dynamic-import-not-found/main.js000066400000000000000000000000171415504077600255220ustar00rootroot00000000000000import('mod'); rollup-2.61.1/test/function/samples/dynamic-import-only-default/000077500000000000000000000000001415504077600247345ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/dynamic-import-only-default/_config.js000066400000000000000000000005611415504077600267000ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/dynamic-import-only-default/entry.js000066400000000000000000000000231415504077600264260ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/dynamic-import-only-default/main.js000066400000000000000000000001121415504077600262100ustar00rootroot00000000000000export default Promise.all([import('./entry.js'), import('./other.js')]); rollup-2.61.1/test/function/samples/dynamic-import-only-default/other.js000066400000000000000000000000231415504077600264060ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/dynamic-import-relative-not-found/000077500000000000000000000000001415504077600260535ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/dynamic-import-relative-not-found/_config.js000066400000000000000000000004061415504077600300150ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'throws if a dynamic relative import is not found', error: { code: 'UNRESOLVED_IMPORT', message: `Could not resolve './mod' from main.js`, watchFiles: [path.join(__dirname, 'main.js')] } }; rollup-2.61.1/test/function/samples/dynamic-import-relative-not-found/main.js000066400000000000000000000000211415504077600273260ustar00rootroot00000000000000import('./mod'); rollup-2.61.1/test/function/samples/dynamic-import-rewriting/000077500000000000000000000000001415504077600243435ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/dynamic-import-rewriting/_config.js000066400000000000000000000006641415504077600263130ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Dynamic import string specifier resolving', options: { external: ['asdf'], plugins: [ { resolveDynamicImport() { return 'asdf'; } } ] }, exports(exports) { const expectedError = "Cannot find module 'asdf'"; return exports.promise.catch(err => assert.strictEqual(err.message.slice(0, expectedError.length), expectedError) ); } }; rollup-2.61.1/test/function/samples/dynamic-import-rewriting/foo.js000066400000000000000000000000721415504077600254630ustar00rootroot00000000000000export var x = 42; export var promise = import('./asdf'); rollup-2.61.1/test/function/samples/dynamic-import-rewriting/main.js000066400000000000000000000000511415504077600256210ustar00rootroot00000000000000export { x as y, promise } from './foo'; rollup-2.61.1/test/function/samples/dynamic-import-this-arrow/000077500000000000000000000000001415504077600244305ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/dynamic-import-this-arrow/_config.js000066400000000000000000000010631415504077600263720ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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 } } } }; rollup-2.61.1/test/function/samples/dynamic-import-this-arrow/main.js000066400000000000000000000003251415504077600257120ustar00rootroot00000000000000import { outputPath } from 'input'; class Importer { constructor() { this.outputPath = outputPath; } getImport() { return import(this.outputPath); } } export const promise = new Importer().getImport(); rollup-2.61.1/test/function/samples/dynamic-import-this-function/000077500000000000000000000000001415504077600251235ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/dynamic-import-this-function/_config.js000066400000000000000000000010701415504077600270630ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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 } } } }; rollup-2.61.1/test/function/samples/dynamic-import-this-function/main.js000066400000000000000000000003251415504077600264050ustar00rootroot00000000000000import { outputPath } from 'input'; class Importer { constructor() { this.outputPath = outputPath; } getImport() { return import(this.outputPath); } } export const promise = new Importer().getImport(); rollup-2.61.1/test/function/samples/dynamic-namespace-lookup/000077500000000000000000000000001415504077600242645ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/dynamic-namespace-lookup/_config.js000066400000000000000000000001551415504077600262270ustar00rootroot00000000000000module.exports = { description: 'does namespace optimization when possible, but not for dynamic lookups' }; rollup-2.61.1/test/function/samples/dynamic-namespace-lookup/foo.js000066400000000000000000000000601415504077600254010ustar00rootroot00000000000000export var bar = 'bar'; export var baz = 'baz'; rollup-2.61.1/test/function/samples/dynamic-namespace-lookup/main.js000066400000000000000000000002251415504077600255450ustar00rootroot00000000000000import * as foo from './foo'; var bar = 'baz'; assert.equal( foo.bar, 'bar' ); assert.equal( foo.baz, 'baz' ); assert.equal( foo[ bar ], 'baz' ); rollup-2.61.1/test/function/samples/emit-file/000077500000000000000000000000001415504077600212525ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/asset-source-invalid/000077500000000000000000000000001415504077600253135ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/asset-source-invalid/_config.js000066400000000000000000000007731415504077600272640ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/emit-file/asset-source-invalid/main.js000066400000000000000000000000451415504077600265740ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/emit-file/asset-source-invalid2/000077500000000000000000000000001415504077600253755ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/asset-source-invalid2/_config.js000066400000000000000000000007771415504077600273520ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/emit-file/asset-source-invalid2/main.js000066400000000000000000000000451415504077600266560ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/emit-file/asset-source-invalid3/000077500000000000000000000000001415504077600253765ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/asset-source-invalid3/_config.js000066400000000000000000000007511415504077600273430ustar00rootroot00000000000000module.exports = { 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 "d59386e0", asset source needs to be a string, Uint8Array or Buffer.', plugin: 'test-plugin', pluginCode: 'VALIDATION_ERROR' } }; rollup-2.61.1/test/function/samples/emit-file/asset-source-invalid3/main.js000066400000000000000000000000451415504077600266570ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/emit-file/asset-source-invalid4/000077500000000000000000000000001415504077600253775ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/asset-source-invalid4/_config.js000066400000000000000000000006741415504077600273500ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/emit-file/asset-source-invalid4/main.js000066400000000000000000000000451415504077600266600ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/emit-file/asset-source-missing/000077500000000000000000000000001415504077600253365ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/asset-source-missing/_config.js000066400000000000000000000005221415504077600272770ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/emit-file/asset-source-missing/main.js000066400000000000000000000000451415504077600266170ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/emit-file/asset-source-missing2/000077500000000000000000000000001415504077600254205ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/asset-source-missing2/_config.js000066400000000000000000000005001415504077600273550ustar00rootroot00000000000000module.exports = { 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 "d59386e0" - no asset source set.' } }; rollup-2.61.1/test/function/samples/emit-file/asset-source-missing2/main.js000066400000000000000000000000451415504077600267010ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/emit-file/asset-source-missing3/000077500000000000000000000000001415504077600254215ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/asset-source-missing3/_config.js000066400000000000000000000010501415504077600273570ustar00rootroot00000000000000module.exports = { 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.', plugin: 'test-plugin', pluginCode: 'ASSET_NOT_FINALISED' } }; rollup-2.61.1/test/function/samples/emit-file/asset-source-missing3/main.js000066400000000000000000000000451415504077600267020ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/emit-file/asset-source-missing4/000077500000000000000000000000001415504077600254225ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/asset-source-missing4/_config.js000066400000000000000000000010261415504077600273630ustar00rootroot00000000000000module.exports = { 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 "d59386e0". Ensure that the source is set and that generate is called first.', plugin: 'test-plugin', pluginCode: 'ASSET_NOT_FINALISED' } }; rollup-2.61.1/test/function/samples/emit-file/asset-source-missing4/main.js000066400000000000000000000000451415504077600267030ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/emit-file/asset-source-missing5/000077500000000000000000000000001415504077600254235ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/asset-source-missing5/_config.js000066400000000000000000000007661415504077600273760ustar00rootroot00000000000000module.exports = { 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.' } }; rollup-2.61.1/test/function/samples/emit-file/asset-source-missing5/main.js000066400000000000000000000000451415504077600267040ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/emit-file/chunk-filename-not-available-buildEnd/000077500000000000000000000000001415504077600304005ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/chunk-filename-not-available-buildEnd/_config.js000066400000000000000000000011041415504077600323360ustar00rootroot00000000000000let chunkId; module.exports = { 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 chunk "chunk.js". Ensure that generate is called first.', plugin: 'test-plugin', pluginCode: 'CHUNK_NOT_GENERATED' } }; rollup-2.61.1/test/function/samples/emit-file/chunk-filename-not-available-buildEnd/chunk.js000066400000000000000000000000261415504077600320440ustar00rootroot00000000000000console.log('chunk'); rollup-2.61.1/test/function/samples/emit-file/chunk-filename-not-available-buildEnd/main.js000066400000000000000000000000251415504077600316570ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/function/samples/emit-file/chunk-filename-not-available-renderStart/000077500000000000000000000000001415504077600311475ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/chunk-filename-not-available-renderStart/_config.js000066400000000000000000000011251415504077600331100ustar00rootroot00000000000000let chunkId; module.exports = { 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 chunk "chunk.js". Ensure that generate is called first.', plugin: 'test-plugin', pluginCode: 'CHUNK_NOT_GENERATED' } }; rollup-2.61.1/test/function/samples/emit-file/chunk-filename-not-available-renderStart/chunk.js000066400000000000000000000000261415504077600326130ustar00rootroot00000000000000console.log('chunk'); rollup-2.61.1/test/function/samples/emit-file/chunk-filename-not-available-renderStart/main.js000066400000000000000000000000251415504077600324260ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/function/samples/emit-file/chunk-filename-not-available/000077500000000000000000000000001415504077600266545ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/chunk-filename-not-available/_config.js000066400000000000000000000011551415504077600306200ustar00rootroot00000000000000const path = require('path'); module.exports = { 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 chunk "chunk.js". Ensure that generate is called first.', plugin: 'test-plugin', pluginCode: 'CHUNK_NOT_GENERATED', watchFiles: [path.join(__dirname, 'chunk.js')] } }; rollup-2.61.1/test/function/samples/emit-file/chunk-filename-not-available/chunk.js000066400000000000000000000000261415504077600303200ustar00rootroot00000000000000console.log('chunk'); rollup-2.61.1/test/function/samples/emit-file/chunk-filename-not-available/main.js000066400000000000000000000000251415504077600301330ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/function/samples/emit-file/chunk-not-found/000077500000000000000000000000001415504077600242715ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/chunk-not-found/_config.js000066400000000000000000000006261415504077600262370ustar00rootroot00000000000000const path = require('path'); module.exports = { 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', message: 'Could not resolve entry module (not-found.js).', watchFiles: [path.join(__dirname, 'main.js')] } }; rollup-2.61.1/test/function/samples/emit-file/chunk-not-found/main.js000066400000000000000000000000251415504077600255500ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/function/samples/emit-file/emit-from-output-options/000077500000000000000000000000001415504077600262005ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/emit-from-output-options/_config.js000066400000000000000000000007751415504077600301530ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/emit-file/emit-from-output-options/main.js000066400000000000000000000000251415504077600274570ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/function/samples/emit-file/emit-same-file/000077500000000000000000000000001415504077600240505ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/emit-same-file/_config.js000066400000000000000000000015051415504077600260130ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/emit-file/emit-same-file/_expected/000077500000000000000000000000001415504077600260105ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/emit-same-file/_expected/amd/000077500000000000000000000000001415504077600265515ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/emit-same-file/_expected/amd/main.js000066400000000000000000000002551415504077600300350ustar00rootroot00000000000000define(['exports'], function (exports) { 'use strict'; function hi() { return 2 } exports.hi = hi; Object.defineProperty(exports, '__esModule', { value: true }); }); rollup-2.61.1/test/function/samples/emit-file/emit-same-file/_expected/amd/myfile000066400000000000000000000000031415504077600277520ustar00rootroot00000000000000abcrollup-2.61.1/test/function/samples/emit-file/emit-same-file/_expected/cjs/000077500000000000000000000000001415504077600265675ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/emit-same-file/_expected/cjs/main.js000066400000000000000000000001741415504077600300530ustar00rootroot00000000000000'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function hi() { return 2 } exports.hi = hi; rollup-2.61.1/test/function/samples/emit-file/emit-same-file/_expected/cjs/myfile000066400000000000000000000000031415504077600277700ustar00rootroot00000000000000abcrollup-2.61.1/test/function/samples/emit-file/emit-same-file/_expected/es/000077500000000000000000000000001415504077600264175ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/emit-same-file/_expected/es/main.js000066400000000000000000000000531415504077600276770ustar00rootroot00000000000000function hi() { return 2 } export { hi }; rollup-2.61.1/test/function/samples/emit-file/emit-same-file/_expected/es/myfile000066400000000000000000000000031415504077600276200ustar00rootroot00000000000000abcrollup-2.61.1/test/function/samples/emit-file/emit-same-file/_expected/system/000077500000000000000000000000001415504077600273345ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/emit-same-file/_expected/system/main.js000066400000000000000000000002361415504077600306170ustar00rootroot00000000000000System.register([], function (exports) { 'use strict'; return { execute: function () { exports('hi', hi); function hi() { return 2 } } }; }); rollup-2.61.1/test/function/samples/emit-file/emit-same-file/_expected/system/myfile000066400000000000000000000000031415504077600305350ustar00rootroot00000000000000abcrollup-2.61.1/test/function/samples/emit-file/emit-same-file/main.js000066400000000000000000000000421415504077600253260ustar00rootroot00000000000000export function hi() { return 2 } rollup-2.61.1/test/function/samples/emit-file/file-references-in-bundle/000077500000000000000000000000001415504077600261635ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/file-references-in-bundle/_config.js000066400000000000000000000015751415504077600301350ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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' })}`; }, generateBundle(options, bundle) { assert.deepStrictEqual(bundle['main.js'].referencedFiles, [ 'assets/asset.txt', 'chunks/ref.js' ]); } }, output: { assetFileNames: 'assets/[name][extname]', chunkFileNames: 'chunks/[name].js' } }, context: { __dirname: 'dir' }, exports(exports) { assert.deepStrictEqual(exports, { asset: 'file:///dir/assets/asset.txt', chunk: 'file:///dir/chunks/ref.js' }); } }; rollup-2.61.1/test/function/samples/emit-file/file-references-in-bundle/main.js000066400000000000000000000000411415504077600274400ustar00rootroot00000000000000throw new Error('not executed'); rollup-2.61.1/test/function/samples/emit-file/file-references-in-bundle/ref.js000066400000000000000000000000261415504077600272730ustar00rootroot00000000000000console.log('Hello'); rollup-2.61.1/test/function/samples/emit-file/invalid-asset-name/000077500000000000000000000000001415504077600247335ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/invalid-asset-name/_config.js000066400000000000000000000007611415504077600267010ustar00rootroot00000000000000module.exports = { 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 files must be strings that are neither absolute nor relative paths, received "/test.ext".', plugin: 'test-plugin', pluginCode: 'VALIDATION_ERROR' } }; rollup-2.61.1/test/function/samples/emit-file/invalid-asset-name/main.js000066400000000000000000000000451415504077600262140ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/emit-file/invalid-asset-name3/000077500000000000000000000000001415504077600250165ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/invalid-asset-name3/_config.js000066400000000000000000000010301415504077600267520ustar00rootroot00000000000000module.exports = { 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 files must be strings that are neither absolute nor relative paths, received "F:\\test.ext".', plugin: 'test-plugin', pluginCode: 'VALIDATION_ERROR' } }; rollup-2.61.1/test/function/samples/emit-file/invalid-asset-name3/main.js000066400000000000000000000000451415504077600262770ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/emit-file/invalid-chunk-id/000077500000000000000000000000001415504077600244005ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/invalid-chunk-id/_config.js000066400000000000000000000006061415504077600263440ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/emit-file/invalid-chunk-id/main.js000066400000000000000000000000451415504077600256610ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/emit-file/invalid-file-type/000077500000000000000000000000001415504077600245745ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/invalid-file-type/_config.js000066400000000000000000000006061415504077600265400ustar00rootroot00000000000000module.exports = { 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" or "chunk", received "unknown".', plugin: 'test-plugin', pluginCode: 'VALIDATION_ERROR' } }; rollup-2.61.1/test/function/samples/emit-file/invalid-file-type/main.js000066400000000000000000000000451415504077600260550ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/emit-file/invalid-reference-id/000077500000000000000000000000001415504077600252265ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/invalid-reference-id/_config.js000066400000000000000000000005231415504077600271700ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/emit-file/invalid-reference-id/main.js000066400000000000000000000000451415504077600265070ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/emit-file/invalid-set-asset-source-id/000077500000000000000000000000001415504077600264765ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/invalid-set-asset-source-id/_config.js000066400000000000000000000006121415504077600304370ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/emit-file/invalid-set-asset-source-id/main.js000066400000000000000000000000451415504077600277570ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/emit-file/modules-loaded/000077500000000000000000000000001415504077600241505ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/modules-loaded/_config.js000066400000000000000000000006751415504077600261220ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/emit-file/modules-loaded/chunk.js000066400000000000000000000000411415504077600256110ustar00rootroot00000000000000throw new Error('Not executed'); rollup-2.61.1/test/function/samples/emit-file/modules-loaded/main.js000066400000000000000000000000251415504077600254270ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/function/samples/emit-file/no-input/000077500000000000000000000000001415504077600230235ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/no-input/_config.js000066400000000000000000000004061415504077600247650ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/emit-file/no-input/chunk.js000066400000000000000000000000261415504077600244670ustar00rootroot00000000000000assert.equal(42, 42); rollup-2.61.1/test/function/samples/emit-file/set-asset-source-chunk/000077500000000000000000000000001415504077600255665ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/set-asset-source-chunk/_config.js000066400000000000000000000011221415504077600275240ustar00rootroot00000000000000const path = require('path'); module.exports = { 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', watchFiles: [path.join(__dirname, 'chunk.js')] } }; rollup-2.61.1/test/function/samples/emit-file/set-asset-source-chunk/chunk.js000066400000000000000000000000451415504077600272330ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/emit-file/set-asset-source-chunk/main.js000066400000000000000000000000451415504077600270470ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/emit-file/set-asset-source-transform/000077500000000000000000000000001415504077600264715ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/set-asset-source-transform/_config.js000066400000000000000000000013001415504077600304250ustar00rootroot00000000000000const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/emit-file/set-asset-source-transform/main.js000066400000000000000000000000451415504077600277520ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/emit-file/set-asset-source-twice/000077500000000000000000000000001415504077600255715ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/set-asset-source-twice/_config.js000066400000000000000000000010221415504077600275260ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/emit-file/set-asset-source-twice/main.js000066400000000000000000000000451415504077600270520ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/emit-file/set-asset-source-twice2/000077500000000000000000000000001415504077600256535ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/set-asset-source-twice2/_config.js000066400000000000000000000010001415504077600276040ustar00rootroot00000000000000module.exports = { 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 "d59386e0", source already set.', plugin: 'test-plugin', pluginCode: 'ASSET_SOURCE_ALREADY_SET' } }; rollup-2.61.1/test/function/samples/emit-file/set-asset-source-twice2/main.js000066400000000000000000000000451415504077600271340ustar00rootroot00000000000000throw new Error('should not build'); rollup-2.61.1/test/function/samples/emit-file/set-source-in-output-options/000077500000000000000000000000001415504077600267765ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/emit-file/set-source-in-output-options/_config.js000066400000000000000000000011201415504077600307320ustar00rootroot00000000000000let referenceId; module.exports = { 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-2.61.1/test/function/samples/emit-file/set-source-in-output-options/buildStart1.js000066400000000000000000000000341415504077600315270ustar00rootroot00000000000000console.log('buildStart1'); rollup-2.61.1/test/function/samples/emit-file/set-source-in-output-options/buildStart2.js000066400000000000000000000000341415504077600315300ustar00rootroot00000000000000console.log('buildStart2'); rollup-2.61.1/test/function/samples/emit-file/set-source-in-output-options/main.js000066400000000000000000000000251415504077600302550ustar00rootroot00000000000000console.log('main'); rollup-2.61.1/test/function/samples/empty-imports-have-side-effects/000077500000000000000000000000001415504077600255105ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/empty-imports-have-side-effects/_config.js000066400000000000000000000001301415504077600274440ustar00rootroot00000000000000module.exports = { description: 'empty imports are assumed to contain side-effects' }; rollup-2.61.1/test/function/samples/empty-imports-have-side-effects/foo.js000066400000000000000000000000241415504077600266250ustar00rootroot00000000000000global.answer = 42; rollup-2.61.1/test/function/samples/empty-imports-have-side-effects/main.js000066400000000000000000000000641415504077600267720ustar00rootroot00000000000000import './foo'; assert.equal( global.answer, 42 ); rollup-2.61.1/test/function/samples/empty-string-as-module-name/000077500000000000000000000000001415504077600246435ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/empty-string-as-module-name/_config.js000066400000000000000000000004101415504077600266000ustar00rootroot00000000000000module.exports = { description: 'allows using empty string as a valid module name', options: { external: () => false, plugins: [ { resolveId(importee, importer) { if (importee === '') { return importer + '#.js'; } } } ] } }; rollup-2.61.1/test/function/samples/empty-string-as-module-name/main.js000066400000000000000000000001021415504077600261160ustar00rootroot00000000000000import { importee } from ''; assert.strictEqual(importee, 'xxx'); rollup-2.61.1/test/function/samples/empty-string-as-module-name/main.js#.js000066400000000000000000000000351415504077600266010ustar00rootroot00000000000000export var importee = 'xxx'; rollup-2.61.1/test/function/samples/error-after-transform-should-throw-correct-location/000077500000000000000000000000001415504077600315425ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/error-after-transform-should-throw-correct-location/_config.js000066400000000000000000000016601415504077600335070ustar00rootroot00000000000000const path = require('path'); const MagicString = require('magic-string'); module.exports = { 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: { code: 'MISSING_EXPORT', message: `'default' is not exported by empty.js, imported by main.js`, id: path.join(__dirname, 'main.js'), pos: 44, watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'empty.js')], loc: { file: path.join(__dirname, 'main.js'), line: 1, column: 7 }, frame: ` 1: import a from './empty.js'; ^ 2: 3: Object.assign({}, a); `, url: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module` } }; rollup-2.61.1/test/function/samples/error-after-transform-should-throw-correct-location/empty.js000066400000000000000000000000001415504077600332240ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/error-after-transform-should-throw-correct-location/main.js000066400000000000000000000000631415504077600330230ustar00rootroot00000000000000import a from './empty.js'; Object.assign({}, a); rollup-2.61.1/test/function/samples/error-missing-umd-name/000077500000000000000000000000001415504077600237005ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/error-missing-umd-name/_config.js000066400000000000000000000005501415504077600256420ustar00rootroot00000000000000module.exports = { 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.' } }; rollup-2.61.1/test/function/samples/error-missing-umd-name/main.js000066400000000000000000000000251415504077600251570ustar00rootroot00000000000000export const x = 42; rollup-2.61.1/test/function/samples/error-parse-json/000077500000000000000000000000001415504077600226075ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/error-parse-json/_config.js000066400000000000000000000013331415504077600245510ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'throws with an extended error message when failing to parse a file with ".json" extension', error: { code: 'PARSE_ERROR', message: 'Unexpected token (Note that you need @rollup/plugin-json to import JSON files)', id: path.join(__dirname, 'file.json'), parserError: { loc: { column: 8, line: 2 }, message: 'Unexpected token (2:8)', pos: 10, raisedAt: 11 }, pos: 10, watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'file.json')], loc: { file: path.join(__dirname, 'file.json'), line: 2, column: 8 }, frame: ` 1: { 2: "JSON": "is not really JavaScript" ^ 3: } ` } }; rollup-2.61.1/test/function/samples/error-parse-json/file.json000066400000000000000000000000511415504077600244150ustar00rootroot00000000000000{ "JSON": "is not really JavaScript" } rollup-2.61.1/test/function/samples/error-parse-json/main.js000066400000000000000000000000641415504077600240710ustar00rootroot00000000000000import json from './file.json'; console.log(json); rollup-2.61.1/test/function/samples/error-parse-unknown-extension/000077500000000000000000000000001415504077600253475ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/error-parse-unknown-extension/_config.js000066400000000000000000000013251415504077600273120ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'throws with an extended error message when failing to parse a file without .(m)js extension', error: { code: 'PARSE_ERROR', message: 'Unexpected token (Note that you need plugins to import files that are not JavaScript)', id: path.join(__dirname, 'file.css'), parserError: { loc: { column: 0, line: 1 }, message: 'Unexpected token (1:0)', pos: 0, raisedAt: 1 }, pos: 0, watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'file.css')], loc: { file: path.join(__dirname, 'file.css'), line: 1, column: 0 }, frame: ` 1: .special-class { ^ 2: color: black; 3: } ` } }; rollup-2.61.1/test/function/samples/error-parse-unknown-extension/file.css000066400000000000000000000000451415504077600267770ustar00rootroot00000000000000.special-class { color: black; } rollup-2.61.1/test/function/samples/error-parse-unknown-extension/main.js000066400000000000000000000000611415504077600266260ustar00rootroot00000000000000import css from './file.css'; console.log(css); rollup-2.61.1/test/function/samples/es5-class-called-without-new/000077500000000000000000000000001415504077600247105ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/es5-class-called-without-new/_config.js000066400000000000000000000001641415504077600266530ustar00rootroot00000000000000module.exports = { description: 'does not swallow type errors when running constructor functions without "new"' }; rollup-2.61.1/test/function/samples/es5-class-called-without-new/foo.js000066400000000000000000000001371415504077600260320ustar00rootroot00000000000000export function Foo ( x ) { this.value = x; } export function Bar ( x ) { this.value = x; } rollup-2.61.1/test/function/samples/es5-class-called-without-new/main.js000066400000000000000000000002251415504077600261710ustar00rootroot00000000000000import { Foo, Bar } from './foo'; assert.equal( new Foo(5).value, 5 ); assert.throws(() => Bar(5), /^TypeError: Cannot set propert.*'value'.*$/ ); rollup-2.61.1/test/function/samples/export-all-from-external/000077500000000000000000000000001415504077600242475ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-all-from-external/_config.js000066400000000000000000000001761415504077600262150ustar00rootroot00000000000000module.exports = { description: 'allows `export *` from external module, internally', options: { external: ['path'] } }; rollup-2.61.1/test/function/samples/export-all-from-external/main.js000066400000000000000000000002101415504077600255220ustar00rootroot00000000000000import { dirname, isRelative } from './path-plus.js'; assert.equal( dirname( 'foo/bar' ), 'foo' ); assert.ok( isRelative( './foo' ) ); rollup-2.61.1/test/function/samples/export-all-from-external/path-plus.js000066400000000000000000000001301415504077600265140ustar00rootroot00000000000000export * from 'path'; export function isRelative ( path ) { return path[0] === '.'; } rollup-2.61.1/test/function/samples/export-all-multiple/000077500000000000000000000000001415504077600233175ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-all-multiple/_config.js000066400000000000000000000001121415504077600252530ustar00rootroot00000000000000module.exports = { description: 'allows multiple export * statements' }; rollup-2.61.1/test/function/samples/export-all-multiple/bar.js000066400000000000000000000000241415504077600244150ustar00rootroot00000000000000export var BAR = 2; rollup-2.61.1/test/function/samples/export-all-multiple/foo.js000066400000000000000000000000241415504077600244340ustar00rootroot00000000000000export var FOO = 1; rollup-2.61.1/test/function/samples/export-all-multiple/main.js000066400000000000000000000000641415504077600246010ustar00rootroot00000000000000export * from './foo.js'; export * from './bar.js'; rollup-2.61.1/test/function/samples/export-all/000077500000000000000000000000001415504077600214665ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-all/_config.js000066400000000000000000000000661415504077600234320ustar00rootroot00000000000000module.exports = { description: 'allows export *' }; rollup-2.61.1/test/function/samples/export-all/main.js000066400000000000000000000000721415504077600227470ustar00rootroot00000000000000import { wat } from './wat'; assert.equal( wat(), 4711 ); rollup-2.61.1/test/function/samples/export-all/wat-impl.js000066400000000000000000000000501415504077600235510ustar00rootroot00000000000000export function wat () { return 4711; } rollup-2.61.1/test/function/samples/export-all/wat.js000066400000000000000000000000341415504077600226140ustar00rootroot00000000000000export * from './wat-impl'; rollup-2.61.1/test/function/samples/export-and-import-reference-share-var/000077500000000000000000000000001415504077600266125ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-and-import-reference-share-var/_config.js000066400000000000000000000003271415504077600305560ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'allows export and import reference to share name', exports(exports) { assert.equal(exports.b, 9); } }; // adapted from es6-module-transpiler rollup-2.61.1/test/function/samples/export-and-import-reference-share-var/foo.js000066400000000000000000000000461415504077600277330ustar00rootroot00000000000000export var a = 1; assert.equal(a, 1); rollup-2.61.1/test/function/samples/export-and-import-reference-share-var/main.js000066400000000000000000000005641415504077600301010ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/export-as/000077500000000000000000000000001415504077600213215ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-as/_config.js000066400000000000000000000000771415504077600232670ustar00rootroot00000000000000module.exports = { description: 'allows export { x as y }' }; rollup-2.61.1/test/function/samples/export-as/foo.js000066400000000000000000000000371415504077600224420ustar00rootroot00000000000000var x = 42; export { x as y }; rollup-2.61.1/test/function/samples/export-as/main.js000066400000000000000000000000621415504077600226010ustar00rootroot00000000000000import { y } from './foo'; assert.equal( y, 42 ); rollup-2.61.1/test/function/samples/export-deconflicted-names/000077500000000000000000000000001415504077600244425ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-deconflicted-names/_config.js000066400000000000000000000002541415504077600264050ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'correctly exports deconflicted names', exports(exports) { assert.equal(exports.bar(), 'bar'); } }; rollup-2.61.1/test/function/samples/export-deconflicted-names/bar.js000066400000000000000000000000611415504077600255410ustar00rootroot00000000000000export default function bar () { return 'bar'; }rollup-2.61.1/test/function/samples/export-deconflicted-names/baz.js000066400000000000000000000001011415504077600255440ustar00rootroot00000000000000var bar = 'baz'; export default function baz () { return bar; }rollup-2.61.1/test/function/samples/export-deconflicted-names/foo.js000066400000000000000000000001011415504077600255530ustar00rootroot00000000000000var bar = 'foo'; export default function foo () { return bar; }rollup-2.61.1/test/function/samples/export-deconflicted-names/main.js000066400000000000000000000001331415504077600257210ustar00rootroot00000000000000import foo from './foo'; import bar from './bar'; import baz from './baz'; export { bar };rollup-2.61.1/test/function/samples/export-default-anonymous-function/000077500000000000000000000000001415504077600262135ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-default-anonymous-function/_config.js000066400000000000000000000006311415504077600301550ustar00rootroot00000000000000const fs = require('fs'); const path = require('path'); module.exports = { 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 fs.readFileSync(path.join(__dirname, id + '.js'), 'utf-8'); } } ] } }; rollup-2.61.1/test/function/samples/export-default-anonymous-function/answer.js000066400000000000000000000000231415504077600300430ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/export-default-anonymous-function/main.js000066400000000000000000000001521415504077600274730ustar00rootroot00000000000000import answer from './answer'; export default function () { console.log( 'the answer is ' + answer ); } rollup-2.61.1/test/function/samples/export-default-as-b/000077500000000000000000000000001415504077600231625ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-default-as-b/_config.js000066400000000000000000000001271415504077600251240ustar00rootroot00000000000000module.exports = { description: 'exports default-as-named from sibling module (b)' }; rollup-2.61.1/test/function/samples/export-default-as-b/bar.js000066400000000000000000000000501415504077600242570ustar00rootroot00000000000000export { default as baz } from './baz'; rollup-2.61.1/test/function/samples/export-default-as-b/baz.js000066400000000000000000000000261415504077600242720ustar00rootroot00000000000000export default 'BAZ'; rollup-2.61.1/test/function/samples/export-default-as-b/main.js000066400000000000000000000000721415504077600244430ustar00rootroot00000000000000import { baz } from './bar'; assert.equal( baz, 'BAZ' ); rollup-2.61.1/test/function/samples/export-default-as-c/000077500000000000000000000000001415504077600231635ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-default-as-c/_config.js000066400000000000000000000003001415504077600251160ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'exports default-as-named from sibling module (c)', exports(exports) { assert.equal(exports.namespace.baz, 'BAZ'); } }; rollup-2.61.1/test/function/samples/export-default-as-c/baz.js000066400000000000000000000000261415504077600242730ustar00rootroot00000000000000export default 'BAZ'; rollup-2.61.1/test/function/samples/export-default-as-c/main.js000066400000000000000000000001501415504077600244410ustar00rootroot00000000000000import * as namespace from './namespace'; assert.equal( namespace.baz, 'BAZ' ); export { namespace }; rollup-2.61.1/test/function/samples/export-default-as-c/namespace.js000066400000000000000000000000501415504077600254500ustar00rootroot00000000000000export { default as baz } from './baz'; rollup-2.61.1/test/function/samples/export-default-as/000077500000000000000000000000001415504077600227435ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-default-as/_config.js000066400000000000000000000002621415504077600247050ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'exports default-as-named from sibling module', exports(exports) { assert.equal(exports.foo, 'FOO'); } }; rollup-2.61.1/test/function/samples/export-default-as/foo.js000066400000000000000000000000261415504077600240620ustar00rootroot00000000000000export default 'FOO'; rollup-2.61.1/test/function/samples/export-default-as/main.js000066400000000000000000000000501415504077600242200ustar00rootroot00000000000000export { default as foo } from './foo'; rollup-2.61.1/test/function/samples/export-default-exported-id/000077500000000000000000000000001415504077600245645ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-default-exported-id/_config.js000066400000000000000000000004101415504077600265210ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/export-default-exported-id/main.js000066400000000000000000000001271415504077600260460ustar00rootroot00000000000000export default class Image { constructor() { this.ok = true; } } export { Image } rollup-2.61.1/test/function/samples/export-default-expression/000077500000000000000000000000001415504077600245375ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-default-expression/_config.js000066400000000000000000000002501415504077600264760ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'exports a default value as module.exports', exports(exports) { assert.equal(exports, 42); } }; rollup-2.61.1/test/function/samples/export-default-expression/main.js000066400000000000000000000000231415504077600260140ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/export-default-from-external/000077500000000000000000000000001415504077600251235ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-default-from-external/_config.js000066400000000000000000000003631415504077600270670ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { description: 'ensures external modules have correct names', options: { external: ['path'] }, exports(exports) { assert.equal(exports, path.sep); } }; rollup-2.61.1/test/function/samples/export-default-from-external/main.js000066400000000000000000000000601415504077600264010ustar00rootroot00000000000000import { sep } from 'path'; export default sep; rollup-2.61.1/test/function/samples/export-default-named-function/000077500000000000000000000000001415504077600252475ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-default-named-function/_config.js000066400000000000000000000002411415504077600272060ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'exports a default named function', exports(exports) { assert.equal(exports(), 42); } }; rollup-2.61.1/test/function/samples/export-default-named-function/main.js000066400000000000000000000000601415504077600265250ustar00rootroot00000000000000export default function foo () { return 42; }; rollup-2.61.1/test/function/samples/export-default-no-space/000077500000000000000000000000001415504077600240455ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-default-no-space/_config.js000066400000000000000000000002761415504077600260140ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'handles default exports with no space before declaration', exports: exports => { assert.deepEqual(exports, {}); } }; rollup-2.61.1/test/function/samples/export-default-no-space/main.js000066400000000000000000000000221415504077600253210ustar00rootroot00000000000000export default{}; rollup-2.61.1/test/function/samples/export-destruction/000077500000000000000000000000001415504077600232615ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-destruction/_config.js000066400000000000000000000004221415504077600252210ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/export-destruction/main.js000066400000000000000000000002351415504077600245430ustar00rootroot00000000000000var foo = { bar: { baz: 5 } }; var arr = [ { quux: 'wrong' }, { quux: 17 } ]; export var { bar: { baz } } = foo; export var [ /* skip */, { quux } ] = arr; rollup-2.61.1/test/function/samples/export-from-default-renamed/000077500000000000000000000000001415504077600247145ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-from-default-renamed/_config.js000066400000000000000000000001361415504077600266560ustar00rootroot00000000000000module.exports = { description: 'export from works with multiple renamed default exports' }; rollup-2.61.1/test/function/samples/export-from-default-renamed/a.js000066400000000000000000000000241415504077600254660ustar00rootroot00000000000000export default 'a'; rollup-2.61.1/test/function/samples/export-from-default-renamed/b.js000066400000000000000000000000241415504077600254670ustar00rootroot00000000000000export default 'b'; rollup-2.61.1/test/function/samples/export-from-default-renamed/foo.js000066400000000000000000000001101415504077600260250ustar00rootroot00000000000000export { default as a } from './a'; export { default as b } from './b'; rollup-2.61.1/test/function/samples/export-from-default-renamed/main.js000066400000000000000000000001161415504077600261740ustar00rootroot00000000000000import { a, b } from './foo'; assert.equal( a, 'a' ); assert.equal( b, 'b' ); rollup-2.61.1/test/function/samples/export-from-default/000077500000000000000000000000001415504077600233035ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-from-default/_config.js000066400000000000000000000003001415504077600252360ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/export-from-default/first.js000066400000000000000000000000221415504077600247620ustar00rootroot00000000000000export default 1; rollup-2.61.1/test/function/samples/export-from-default/main.js000066400000000000000000000000561415504077600245660ustar00rootroot00000000000000import a from './second'; assert.equal(a, 1); rollup-2.61.1/test/function/samples/export-from-default/second.js000066400000000000000000000000431415504077600251110ustar00rootroot00000000000000export { default } from './first'; rollup-2.61.1/test/function/samples/export-from-external/000077500000000000000000000000001415504077600235015ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-from-external/_config.js000066400000000000000000000004541415504077600254460ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/export-from-external/main.js000066400000000000000000000000341415504077600247600ustar00rootroot00000000000000export { sep } from 'path'; rollup-2.61.1/test/function/samples/export-from-internal-module/000077500000000000000000000000001415504077600247565ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-from-internal-module/_config.js000066400000000000000000000002421415504077600267160ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'exports from an internal module', exports(exports) { assert.equal(exports.foo, 42); } }; rollup-2.61.1/test/function/samples/export-from-internal-module/foo.js000066400000000000000000000000241415504077600260730ustar00rootroot00000000000000export var foo = 42;rollup-2.61.1/test/function/samples/export-from-internal-module/main.js000066400000000000000000000000341415504077600262350ustar00rootroot00000000000000export { foo } from './foo';rollup-2.61.1/test/function/samples/export-from-multiple-no-default-conflict/000077500000000000000000000000001415504077600273455ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-from-multiple-no-default-conflict/_config.js000066400000000000000000000004041415504077600313050ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'export from does not cause erroneous warning if multiple modules export default', warnings: [], exports: exports => { assert.deepEqual(exports, { foo: 'foo', bar: 'bar' }); } }; rollup-2.61.1/test/function/samples/export-from-multiple-no-default-conflict/a.js000066400000000000000000000000531415504077600301210ustar00rootroot00000000000000export default 1; export const foo = 'foo';rollup-2.61.1/test/function/samples/export-from-multiple-no-default-conflict/b.js000066400000000000000000000000531415504077600301220ustar00rootroot00000000000000export default 2; export const bar = 'bar';rollup-2.61.1/test/function/samples/export-from-multiple-no-default-conflict/main.js000066400000000000000000000000601415504077600306230ustar00rootroot00000000000000export * from './a.js'; export * from './b.js'; rollup-2.61.1/test/function/samples/export-from-no-local-binding-var/000077500000000000000000000000001415504077600255615ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-from-no-local-binding-var/_config.js000066400000000000000000000003031415504077600275170ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'export from does not create a local binding', runtimeError(err) { assert.ok(/foo is not defined/.test(err.message)); } }; rollup-2.61.1/test/function/samples/export-from-no-local-binding-var/foo.js000066400000000000000000000000351415504077600267000ustar00rootroot00000000000000export default function() {} rollup-2.61.1/test/function/samples/export-from-no-local-binding-var/main.js000066400000000000000000000001621415504077600270420ustar00rootroot00000000000000export {default as foo} from './foo'; export var foo1 = foo(); // This should fail as foo lacks a local binding. rollup-2.61.1/test/function/samples/export-from-no-local-binding/000077500000000000000000000000001415504077600247735ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-from-no-local-binding/_config.js000066400000000000000000000002751415504077600267410ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/export-from-no-local-binding/first.js000066400000000000000000000000221415504077600264520ustar00rootroot00000000000000export var a = 1; rollup-2.61.1/test/function/samples/export-from-no-local-binding/main.js000066400000000000000000000000621415504077600262530ustar00rootroot00000000000000import { a } from './second'; assert.equal(a, 1); rollup-2.61.1/test/function/samples/export-from-no-local-binding/second.js000066400000000000000000000002521415504077600266030ustar00rootroot00000000000000export { 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-2.61.1/test/function/samples/export-from-renamed/000077500000000000000000000000001415504077600232725ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-from-renamed/_config.js000066400000000000000000000003021415504077600252270ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'allows export { x as y } from ...', exports(exports) { assert.equal(exports.y, 42); assert.ok(!('x' in exports)); } }; rollup-2.61.1/test/function/samples/export-from-renamed/foo.js000066400000000000000000000000231415504077600244060ustar00rootroot00000000000000export var x = 42; rollup-2.61.1/test/function/samples/export-from-renamed/main.js000066400000000000000000000000401415504077600245460ustar00rootroot00000000000000export { x as y } from './foo'; rollup-2.61.1/test/function/samples/export-from-with-definition-conflict/000077500000000000000000000000001415504077600265575ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-from-with-definition-conflict/_config.js000066400000000000000000000005111415504077600305160ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/export-from-with-definition-conflict/a.js000066400000000000000000000001161415504077600273330ustar00rootroot00000000000000export var foo = 'a-foo'; export var bar = 'a-bar'; export var baz = 'a-baz'; rollup-2.61.1/test/function/samples/export-from-with-definition-conflict/main.js000066400000000000000000000003231415504077600300370ustar00rootroot00000000000000var 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-2.61.1/test/function/samples/export-from-with-import-conflict/000077500000000000000000000000001415504077600257415ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-from-with-import-conflict/_config.js000066400000000000000000000005121415504077600277010ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/export-from-with-import-conflict/a.js000066400000000000000000000001161415504077600265150ustar00rootroot00000000000000export var foo = 'a-foo'; export var bar = 'a-bar'; export var baz = 'a-baz'; rollup-2.61.1/test/function/samples/export-from-with-import-conflict/b.js000066400000000000000000000000641415504077600265200ustar00rootroot00000000000000export var foo = 'b-foo'; export var baz = 'b-baz'; rollup-2.61.1/test/function/samples/export-from-with-import-conflict/main.js000066400000000000000000000002751415504077600272270ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/export-global/000077500000000000000000000000001415504077600221565ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-global/_config.js000066400000000000000000000006771415504077600241320ustar00rootroot00000000000000const assert = require('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 = { description: '"variables corresponding to globals can be exported"', exports(exports) { assert.equal(exports.Buffer, Buffer); } }; rollup-2.61.1/test/function/samples/export-global/main.js000066400000000000000000000000711415504077600234360ustar00rootroot00000000000000const MyBuffer = Buffer; export { MyBuffer as Buffer }; rollup-2.61.1/test/function/samples/export-not-at-top-level-fails/000077500000000000000000000000001415504077600251215ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-not-at-top-level-fails/_config.js000066400000000000000000000011741415504077600270660ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'disallows non-top-level exports', error: { code: 'PARSE_ERROR', message: `'import' and 'export' may only appear at the top level`, id: path.join(__dirname, 'main.js'), parserError: { loc: { column: 2, line: 2 }, message: "'import' and 'export' may only appear at the top level (2:2)", pos: 19, raisedAt: 25 }, pos: 19, watchFiles: [path.join(__dirname, 'main.js')], loc: { file: path.join(__dirname, 'main.js'), line: 2, column: 2 }, frame: ` 1: function foo() { 2: export { foo }; ^ 3: } ` } }; rollup-2.61.1/test/function/samples/export-not-at-top-level-fails/main.js000066400000000000000000000000451415504077600264020ustar00rootroot00000000000000function foo() { export { foo }; } rollup-2.61.1/test/function/samples/export-two-ways-default-b/000077500000000000000000000000001415504077600243515ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-two-ways-default-b/_config.js000066400000000000000000000002511415504077600263110ustar00rootroot00000000000000module.exports = { description: 'side-effects are preserved if subject is exported in multiple ways, even if default export has no direct link to original (#733)' }; rollup-2.61.1/test/function/samples/export-two-ways-default-b/bar.js000066400000000000000000000001431415504077600254510ustar00rootroot00000000000000import { X } from './x.js'; X.prototype.bar = function () { this.didBar = true; return this; }; rollup-2.61.1/test/function/samples/export-two-ways-default-b/foo.js000066400000000000000000000001771415504077600254770ustar00rootroot00000000000000export function X () {} X.prototype.foo = function () { this.didFoo = true; return this; }; export default ( false || X ); rollup-2.61.1/test/function/samples/export-two-ways-default-b/main.js000066400000000000000000000002061415504077600256310ustar00rootroot00000000000000import { x } from './x.js'; import './bar.js'; var result = x().foo().bar(); assert.ok( result.didFoo ); assert.ok( result.didBar ); rollup-2.61.1/test/function/samples/export-two-ways-default-b/x.js000066400000000000000000000001621415504077600251550ustar00rootroot00000000000000export { default as X } from './foo.js'; import { X } from './foo.js'; export function x () { return new X(); } rollup-2.61.1/test/function/samples/export-two-ways-default/000077500000000000000000000000001415504077600241325ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-two-ways-default/_config.js000066400000000000000000000001601415504077600260710ustar00rootroot00000000000000module.exports = { description: 'side-effects are preserved if subject is exported in multiple ways (#733)' }; rollup-2.61.1/test/function/samples/export-two-ways-default/bar.js000066400000000000000000000001431415504077600252320ustar00rootroot00000000000000import { X } from './x.js'; X.prototype.bar = function () { this.didBar = true; return this; }; rollup-2.61.1/test/function/samples/export-two-ways-default/foo.js000066400000000000000000000001621415504077600252520ustar00rootroot00000000000000export function X () {} X.prototype.foo = function () { this.didFoo = true; return this; }; export default X; rollup-2.61.1/test/function/samples/export-two-ways-default/main.js000066400000000000000000000002061415504077600254120ustar00rootroot00000000000000import { x } from './x.js'; import './bar.js'; var result = x().foo().bar(); assert.ok( result.didFoo ); assert.ok( result.didBar ); rollup-2.61.1/test/function/samples/export-two-ways-default/x.js000066400000000000000000000001621415504077600247360ustar00rootroot00000000000000export { default as X } from './foo.js'; import { X } from './foo.js'; export function x () { return new X(); } rollup-2.61.1/test/function/samples/export-two-ways-function/000077500000000000000000000000001415504077600243335ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-two-ways-function/_config.js000066400000000000000000000003411415504077600262730ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'exports the same function more than one way (#648)', exports(exports) { assert.equal(exports.foo, exports.bar); assert.equal(exports.foo(), 42); } }; rollup-2.61.1/test/function/samples/export-two-ways-function/main.js000066400000000000000000000001131415504077600256100ustar00rootroot00000000000000var bar; bar = foo; function foo () { return 42; } export { foo, bar }; rollup-2.61.1/test/function/samples/export-two-ways/000077500000000000000000000000001415504077600225105ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-two-ways/_config.js000066400000000000000000000003461415504077600244550ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/export-two-ways/foo.js000066400000000000000000000000351415504077600236270ustar00rootroot00000000000000export var foo = 1; foo = 2; rollup-2.61.1/test/function/samples/export-two-ways/main.js000066400000000000000000000001351415504077600237710ustar00rootroot00000000000000import { foo } from './foo'; export { foo as a }; export { foo as b }; export { foo as c }; rollup-2.61.1/test/function/samples/export-type-mismatch-b/000077500000000000000000000000001415504077600237215ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-type-mismatch-b/_config.js000066400000000000000000000005671415504077600256730ustar00rootroot00000000000000module.exports = { description: 'export type must be auto, default, named or none', options: { output: { exports: 'blah' } }, generateError: { code: 'INVALID_EXPORT_OPTION', message: '"output.exports" must be "default", "named", "none", "auto", or left unspecified (defaults to "auto"), received "blah"', url: 'https://rollupjs.org/guide/en/#outputexports' } }; rollup-2.61.1/test/function/samples/export-type-mismatch-b/main.js000066400000000000000000000000231415504077600251760ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/export-type-mismatch-c/000077500000000000000000000000001415504077600237225ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-type-mismatch-c/_config.js000066400000000000000000000004761415504077600256730ustar00rootroot00000000000000module.exports = { 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' } }; rollup-2.61.1/test/function/samples/export-type-mismatch-c/main.js000066400000000000000000000000231415504077600251770ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/export-type-mismatch/000077500000000000000000000000001415504077600235025ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/export-type-mismatch/_config.js000066400000000000000000000005001415504077600254370ustar00rootroot00000000000000module.exports = { 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' } }; rollup-2.61.1/test/function/samples/export-type-mismatch/main.js000066400000000000000000000000251415504077600247610ustar00rootroot00000000000000export var foo = 42; rollup-2.61.1/test/function/samples/exports-flag-allowed-in-options/000077500000000000000000000000001415504077600255345ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/exports-flag-allowed-in-options/_config.js000066400000000000000000000004001415504077600274700ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/exports-flag-allowed-in-options/foo.js000066400000000000000000000000231415504077600266500ustar00rootroot00000000000000export var x = 42; rollup-2.61.1/test/function/samples/exports-flag-allowed-in-options/main.js000066400000000000000000000000401415504077600270100ustar00rootroot00000000000000export { x as y } from './foo'; rollup-2.61.1/test/function/samples/exports-named-values/000077500000000000000000000000001415504077600234625ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/exports-named-values/_config.js000066400000000000000000000002671415504077600254310ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'exports named values from the bundle entry module', exports(exports) { assert.equal(exports.answer, 42); } }; rollup-2.61.1/test/function/samples/exports-named-values/main.js000066400000000000000000000000271415504077600247430ustar00rootroot00000000000000export var answer = 42;rollup-2.61.1/test/function/samples/external-alias-parent/000077500000000000000000000000001415504077600235775ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/external-alias-parent/_config.js000066400000000000000000000014211415504077600255370ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { 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; if (parentId.endsWith('main.js')) { return id === 'lodash'; } else { return 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-2.61.1/test/function/samples/external-alias-parent/first/000077500000000000000000000000001415504077600247265ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/external-alias-parent/first/main.js000066400000000000000000000002671415504077600262150ustar00rootroot00000000000000import _ from 'underscore'; import first from './module'; export default function ( inputs ) { if ( !_.isArray( inputs ) ) { return inputs; } return first.square( inputs ); }; rollup-2.61.1/test/function/samples/external-alias-parent/first/module.js000066400000000000000000000002111415504077600265430ustar00rootroot00000000000000import _ from 'underscore'; export default function square ( inputs ) { return _.map( inputs, function ( x ) { return x * x; }); }; rollup-2.61.1/test/function/samples/external-alias/000077500000000000000000000000001415504077600223105ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/external-alias/_config.js000066400000000000000000000010011415504077600242420ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/external-alias/first/000077500000000000000000000000001415504077600234375ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/external-alias/first/main.js000066400000000000000000000002671415504077600247260ustar00rootroot00000000000000import _ from 'underscore'; import first from './module'; export default function ( inputs ) { if ( !_.isArray( inputs ) ) { return inputs; } return first.square( inputs ); }; rollup-2.61.1/test/function/samples/external-alias/first/module.js000066400000000000000000000002111415504077600252540ustar00rootroot00000000000000import _ from 'underscore'; export default function square ( inputs ) { return _.map( inputs, function ( x ) { return x * x; }); }; rollup-2.61.1/test/function/samples/external-conflict/000077500000000000000000000000001415504077600230205ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/external-conflict/_config.js000066400000000000000000000010531415504077600247610ustar00rootroot00000000000000const path = require('path'); module.exports = { 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', message: "'dep' is imported as an external by dep, but is already an existing non-external module id.", watchFiles: [path.join(__dirname, 'main.js'), 'dep'] } }; rollup-2.61.1/test/function/samples/external-conflict/main.js000066400000000000000000000000151415504077600242760ustar00rootroot00000000000000import 'dep';rollup-2.61.1/test/function/samples/external-dynamic-import-live-binding-compact/000077500000000000000000000000001415504077600301445ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/external-dynamic-import-live-binding-compact/_config.js000066400000000000000000000032731415504077600321130ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'supports external dynamic imports with live bindings in compact mode', options: { external() { return true; }, output: { compact: true } }, context: { require(id) { switch (id) { case 'dep-0': return undefined; 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-2.61.1/test/function/samples/external-dynamic-import-live-binding-compact/main.js000066400000000000000000000001511415504077600314230ustar00rootroot00000000000000export default Promise.all([ import('dep-0'), import('dep-1'), import('dep-2'), import('dep-3'), ]); rollup-2.61.1/test/function/samples/external-dynamic-import-live-binding/000077500000000000000000000000001415504077600265205ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/external-dynamic-import-live-binding/_config.js000066400000000000000000000032111415504077600304570ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'supports external dynamic imports with live bindings', options: { external() { return true; } }, context: { require(id) { switch (id) { case 'dep-0': return undefined; 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-2.61.1/test/function/samples/external-dynamic-import-live-binding/main.js000066400000000000000000000001511415504077600277770ustar00rootroot00000000000000export default Promise.all([ import('dep-0'), import('dep-1'), import('dep-2'), import('dep-3'), ]); rollup-2.61.1/test/function/samples/external-entry-point-object/000077500000000000000000000000001415504077600247535ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/external-entry-point-object/_config.js000066400000000000000000000004571415504077600267230ustar00rootroot00000000000000module.exports = { 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 cannot be external (main.js).` } }; rollup-2.61.1/test/function/samples/external-entry-point-object/foo.js000066400000000000000000000000551415504077600260740ustar00rootroot00000000000000export var foo = function () { return 42; } rollup-2.61.1/test/function/samples/external-entry-point-object/main.js000066400000000000000000000001511415504077600262320ustar00rootroot00000000000000import { foo } from './foo.js'; (function bar() { assert.ok( true ); })(); assert.equal( foo(), 42 ); rollup-2.61.1/test/function/samples/external-entry-point/000077500000000000000000000000001415504077600235075ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/external-entry-point/_config.js000066400000000000000000000004171415504077600254530ustar00rootroot00000000000000module.exports = { description: 'throws for entry points that are resolved as false by plugins', options: { plugins: { resolveId() { return false; } } }, error: { code: 'UNRESOLVED_ENTRY', message: `Entry module cannot be external (main.js).` } }; rollup-2.61.1/test/function/samples/external-entry-point/foo.js000066400000000000000000000000551415504077600246300ustar00rootroot00000000000000export var foo = function () { return 42; } rollup-2.61.1/test/function/samples/external-entry-point/main.js000066400000000000000000000001511415504077600247660ustar00rootroot00000000000000import { foo } from './foo.js'; (function bar() { assert.ok( true ); })(); assert.equal( foo(), 42 ); rollup-2.61.1/test/function/samples/external-function-always-true/000077500000000000000000000000001415504077600253175ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/external-function-always-true/_config.js000066400000000000000000000003341415504077600272610ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/external-function-always-true/main.js000066400000000000000000000001001415504077600265700ustar00rootroot00000000000000import ext from 'external'; assert.equal( ext.external, true ); rollup-2.61.1/test/function/samples/external-function/000077500000000000000000000000001415504077600230445ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/external-function/_config.js000066400000000000000000000003751415504077600250130ustar00rootroot00000000000000module.exports = { description: 'allows external option to be a function (#522)', options: { external: id => { return id === 'external'; } }, context: { require: id => { if (id === 'external') return 42; return require(id); } } }; rollup-2.61.1/test/function/samples/external-function/main.js000066400000000000000000000000651415504077600243270ustar00rootroot00000000000000import ext from 'external'; assert.equal( ext, 42 ); rollup-2.61.1/test/function/samples/external-ids-not-resolved/000077500000000000000000000000001415504077600244155ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/external-ids-not-resolved/_config.js000066400000000000000000000004411415504077600263560ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/external-ids-not-resolved/main.js000066400000000000000000000000671415504077600257020ustar00rootroot00000000000000import foo from 'external'; assert.ok( foo.external ); rollup-2.61.1/test/function/samples/external-ignore-reserved-null-marker/000077500000000000000000000000001415504077600265465ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/external-ignore-reserved-null-marker/_config.js000066400000000000000000000012011415504077600305020ustar00rootroot00000000000000module.exports = { description: 'external function ignores \\0 started ids', options: { external(id) { if (id.startsWith('\0')) { throw 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-2.61.1/test/function/samples/external-ignore-reserved-null-marker/main.js000066400000000000000000000000771415504077600300340ustar00rootroot00000000000000import external from '\0external'; assert.equal(external, 1); rollup-2.61.1/test/function/samples/external-live-binding-compact/000077500000000000000000000000001415504077600252125ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/external-live-binding-compact/_config.js000066400000000000000000000015211415504077600271530ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/external-live-binding-compact/main.js000066400000000000000000000001051415504077600264700ustar00rootroot00000000000000export { named, incrementNamed } from 'named'; export * from 'star'; rollup-2.61.1/test/function/samples/external-live-binding/000077500000000000000000000000001415504077600235665ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/external-live-binding/_config.js000066400000000000000000000023351415504077600255330ustar00rootroot00000000000000const assert = require('assert'); let named; let star; let defaulted; module.exports = { description: 'handles external live-bindings', options: { external: ['named', 'star', 'defaulted'] }, 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-2.61.1/test/function/samples/external-live-binding/main.js000066400000000000000000000001471415504077600250520ustar00rootroot00000000000000export { named } from 'named'; export { default as defaulted } from 'defaulted'; export * from 'star'; rollup-2.61.1/test/function/samples/external-normalization/000077500000000000000000000000001415504077600241055ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/external-normalization/_config.js000066400000000000000000000005741415504077600260550ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/external-normalization/main.js000066400000000000000000000000741415504077600253700ustar00rootroot00000000000000import { resolve } from './dep.js'; export default resolve; rollup-2.61.1/test/function/samples/external-regex-array/000077500000000000000000000000001415504077600234455ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/external-regex-array/_config.js000066400000000000000000000004301415504077600254040ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/external-regex-array/main.js000066400000000000000000000001531415504077600247260ustar00rootroot00000000000000import ext from 'external'; import other from 'other'; assert.equal( ext, 42 ); assert.equal( other, 17 ); rollup-2.61.1/test/function/samples/external-regex/000077500000000000000000000000001415504077600223315ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/external-regex/_config.js000066400000000000000000000003251415504077600242730ustar00rootroot00000000000000module.exports = { description: 'allows external option to be a regex', options: { external: /external/ }, context: { require: id => { if (id === 'external') return 42; return require(id); } } }; rollup-2.61.1/test/function/samples/external-regex/main.js000066400000000000000000000000651415504077600236140ustar00rootroot00000000000000import ext from 'external'; assert.equal( ext, 42 ); rollup-2.61.1/test/function/samples/external-resolve-false/000077500000000000000000000000001415504077600237665ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/external-resolve-false/_config.js000066400000000000000000000005461415504077600257350ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/external-resolve-false/main.js000066400000000000000000000000241415504077600252440ustar00rootroot00000000000000import './external';rollup-2.61.1/test/function/samples/external-resolved/000077500000000000000000000000001415504077600230425ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/external-resolved/_config.js000066400000000000000000000021031415504077600250000ustar00rootroot00000000000000const assert = require('assert'); const testedIds = []; module.exports = { 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-2.61.1/test/function/samples/external-resolved/main.js000066400000000000000000000003751415504077600243310ustar00rootroot00000000000000export {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-2.61.1/test/function/samples/externally-reassigned-default-exports/000077500000000000000000000000001415504077600270345ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/externally-reassigned-default-exports/_config.js000066400000000000000000000004561415504077600310030ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/externally-reassigned-default-exports/main.js000066400000000000000000000001311415504077600303110ustar00rootroot00000000000000const obj = { reassigned() {}, test() { obj.reassigned(); } }; export default obj; rollup-2.61.1/test/function/samples/externally-reassigned-globals/000077500000000000000000000000001415504077600253315ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/externally-reassigned-globals/_config.js000066400000000000000000000007171415504077600273000ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/externally-reassigned-globals/main.js000066400000000000000000000002501415504077600266100ustar00rootroot00000000000000const obj1 = { reassigned() {} }; global.obj1 = obj1; global.obj2 = { reassigned() {} }; export function test() { obj1.reassigned(); global.obj2.reassigned(); } rollup-2.61.1/test/function/samples/externally-reassigned-named-exports/000077500000000000000000000000001415504077600264745ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/externally-reassigned-named-exports/_config.js000066400000000000000000000006551415504077600304440ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/externally-reassigned-named-exports/main.js000066400000000000000000000002431415504077600277550ustar00rootroot00000000000000export const obj1 = { reassigned() {} }; const obj2 = { reassigned() {} }; export { obj2 }; export function test() { obj1.reassigned(); obj2.reassigned(); } rollup-2.61.1/test/function/samples/externally-reassigned-named-reexports/000077500000000000000000000000001415504077600270235ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/externally-reassigned-named-reexports/_config.js000066400000000000000000000004621415504077600307670ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/externally-reassigned-named-reexports/foo.js000066400000000000000000000000511415504077600301400ustar00rootroot00000000000000export const obj = { reassigned() {} }; rollup-2.61.1/test/function/samples/externally-reassigned-named-reexports/main.js000066400000000000000000000001601415504077600303020ustar00rootroot00000000000000export { obj } from './foo.js'; import { obj } from './foo.js'; export function test() { obj.reassigned(); } rollup-2.61.1/test/function/samples/externally-reassigned-star-reexports/000077500000000000000000000000001415504077600267105ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/externally-reassigned-star-reexports/_config.js000066400000000000000000000004661415504077600306600ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/externally-reassigned-star-reexports/foo.js000066400000000000000000000000511415504077600300250ustar00rootroot00000000000000export const obj = { reassigned() {} }; rollup-2.61.1/test/function/samples/externally-reassigned-star-reexports/main.js000066400000000000000000000001521415504077600301700ustar00rootroot00000000000000export * from './foo.js'; import { obj } from './foo.js'; export function test() { obj.reassigned(); } rollup-2.61.1/test/function/samples/facade-reexports/000077500000000000000000000000001415504077600226335ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/facade-reexports/_config.js000066400000000000000000000007111415504077600245740ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/facade-reexports/dynamic.js000066400000000000000000000000701415504077600246120ustar00rootroot00000000000000import { lib } from './lib'; export const dynamic = lib;rollup-2.61.1/test/function/samples/facade-reexports/lib.js000066400000000000000000000000321415504077600237320ustar00rootroot00000000000000export const lib = 'lib'; rollup-2.61.1/test/function/samples/facade-reexports/main.js000066400000000000000000000002721415504077600241160ustar00rootroot00000000000000import { lib } from './lib'; export const dynamic = () => import('./dynamic').then(({ dynamic }) => dynamic + lib); export { other } from './other'; export { external } from 'external'; rollup-2.61.1/test/function/samples/facade-reexports/other.js000066400000000000000000000000341415504077600243070ustar00rootroot00000000000000export const other = 'other'rollup-2.61.1/test/function/samples/fallback-on-warn/000077500000000000000000000000001415504077600225155ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/fallback-on-warn/_config.js000066400000000000000000000007511415504077600244620ustar00rootroot00000000000000const assert = require('assert'); let oldConsoleWarn; const warnings = []; module.exports = { description: 'logs as a fallback if no onwarn handler is provided', options: { onwarn: null }, before() { oldConsoleWarn = console.warn; console.warn = msg => warnings.push(msg); }, after() { console.warn = oldConsoleWarn; assert.deepStrictEqual(warnings, [ 'Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification' ]); } }; rollup-2.61.1/test/function/samples/fallback-on-warn/main.js000066400000000000000000000000351415504077600237750ustar00rootroot00000000000000export const x = eval('42'); rollup-2.61.1/test/function/samples/file-and-dir/000077500000000000000000000000001415504077600216325ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/file-and-dir/_config.js000066400000000000000000000006341415504077600235770ustar00rootroot00000000000000module.exports = { 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/guide/en/#outputdir' } }; rollup-2.61.1/test/function/samples/file-and-dir/foo.js000066400000000000000000000000231415504077600227460ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/file-and-dir/main.js000066400000000000000000000000511415504077600231100ustar00rootroot00000000000000export default () => import('./foo.js'); rollup-2.61.1/test/function/samples/for-in-loop-head-dependencies/000077500000000000000000000000001415504077600250635ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/for-in-loop-head-dependencies/_config.js000066400000000000000000000001501415504077600270210ustar00rootroot00000000000000module.exports = { description: 'uses parent scope for right-hand-side in for-in statement (#1480)' }; rollup-2.61.1/test/function/samples/for-in-loop-head-dependencies/main.js000066400000000000000000000002221415504077600263410ustar00rootroot00000000000000function foo() { return ['x']; } const result = []; for (let i in foo()) { const foo = i; result.push(foo); } assert.deepEqual(result, [0]);rollup-2.61.1/test/function/samples/for-loop-head-dependencies/000077500000000000000000000000001415504077600244575ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/for-loop-head-dependencies/_config.js000066400000000000000000000001221415504077600264140ustar00rootroot00000000000000module.exports = { description: 'uses correct scope in for statement (#1538)' }; rollup-2.61.1/test/function/samples/for-loop-head-dependencies/main.js000066400000000000000000000002721415504077600257420ustar00rootroot00000000000000function 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-2.61.1/test/function/samples/for-loops-as-assignments/000077500000000000000000000000001415504077600242515ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/for-loops-as-assignments/_config.js000066400000000000000000000001461415504077600262140ustar00rootroot00000000000000module.exports = { description: 'make sure for loops are counted as variable assignments (#2199)' }; rollup-2.61.1/test/function/samples/for-loops-as-assignments/main.js000066400000000000000000000004351415504077600255350ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/for-of-loop-head-dependencies/000077500000000000000000000000001415504077600250615ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/for-of-loop-head-dependencies/_config.js000066400000000000000000000001501415504077600270170ustar00rootroot00000000000000module.exports = { description: 'uses parent scope for right-hand-side in for-of statement (#1539)' }; rollup-2.61.1/test/function/samples/for-of-loop-head-dependencies/main.js000066400000000000000000000002361415504077600263440ustar00rootroot00000000000000function foo() { return ['x', 'y']; } const result = []; for (const i of foo()) { const foo = i; result.push(i); } assert.deepEqual(result, ['x', 'y']);rollup-2.61.1/test/function/samples/for-of-with-in-operator/000077500000000000000000000000001415504077600237755ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/for-of-with-in-operator/_config.js000066400000000000000000000001551415504077600257400ustar00rootroot00000000000000module.exports = { description: 'handles using the in operator in the iterator of a for-of loop (#2337)' }; rollup-2.61.1/test/function/samples/for-of-with-in-operator/main.js000066400000000000000000000001351415504077600252560ustar00rootroot00000000000000for (const foo of [{}]) { if ('x' in foo) { throw new Error('There should be no x'); } } rollup-2.61.1/test/function/samples/function-asm-directive/000077500000000000000000000000001415504077600237565ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/function-asm-directive/_config.js000066400000000000000000000003061415504077600257170ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: "shouldn't delete use asm from the start of a function body", code(code) { assert.notEqual(code.indexOf('use asm'), -1); } }; rollup-2.61.1/test/function/samples/function-asm-directive/main.js000066400000000000000000000000651415504077600252410ustar00rootroot00000000000000export function a() { "use asm"; return 1; }rollup-2.61.1/test/function/samples/function-directive-not-first/000077500000000000000000000000001415504077600251235ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/function-directive-not-first/_config.js000066400000000000000000000003231415504077600270630ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'should delete use asm from function body if it is not the first expression', code(code) { assert.equal(code.indexOf('use asm'), -1); } }; rollup-2.61.1/test/function/samples/function-directive-not-first/main.js000066400000000000000000000001051415504077600264010ustar00rootroot00000000000000export function a() { const x = 1; "use asm"; return x; }rollup-2.61.1/test/function/samples/function-expressions-simplified-to-statement/000077500000000000000000000000001415504077600303515ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/function-expressions-simplified-to-statement/_config.js000066400000000000000000000001601415504077600323100ustar00rootroot00000000000000module.exports = { description: 'correctly handles function expressions which are simplified to statements' }; rollup-2.61.1/test/function/samples/function-expressions-simplified-to-statement/main.js000066400000000000000000000014341415504077600316350ustar00rootroot00000000000000var 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-2.61.1/test/function/samples/function-side-effects/000077500000000000000000000000001415504077600235635ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/function-side-effects/_config.js000066400000000000000000000001251415504077600255230ustar00rootroot00000000000000module.exports = { description: 'assumes functions may mutate objects passed in' }; rollup-2.61.1/test/function/samples/function-side-effects/main.js000066400000000000000000000000751415504077600250470ustar00rootroot00000000000000import object from './object'; assert.ok( object.mutated ); rollup-2.61.1/test/function/samples/function-side-effects/mutate.js000066400000000000000000000001051415504077600254140ustar00rootroot00000000000000export default function mutate ( object ) { object.mutated = true; }rollup-2.61.1/test/function/samples/function-side-effects/object.js000066400000000000000000000001321415504077600253630ustar00rootroot00000000000000import mutate from './mutate'; var object = {}; mutate( object ); export default object;rollup-2.61.1/test/function/samples/function-use-strict-directive-removed/000077500000000000000000000000001415504077600267375ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/function-use-strict-directive-removed/_config.js000066400000000000000000000002721415504077600307020ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'should delete use strict from function body', code(code) { assert.equal(code.lastIndexOf('use strict'), 1); } }; rollup-2.61.1/test/function/samples/function-use-strict-directive-removed/main.js000066400000000000000000000001101415504077600302110ustar00rootroot00000000000000export function a() { "use strict"; const x = 1; return x; }rollup-2.61.1/test/function/samples/functions-renamed-correctly/000077500000000000000000000000001415504077600250245ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/functions-renamed-correctly/_config.js000066400000000000000000000001201415504077600267570ustar00rootroot00000000000000module.exports = { description: 'renames function expression IDs correctly' }; rollup-2.61.1/test/function/samples/functions-renamed-correctly/after.js000066400000000000000000000000731415504077600264630ustar00rootroot00000000000000function x () { return 'after'; } export { x as after }; rollup-2.61.1/test/function/samples/functions-renamed-correctly/before.js000066400000000000000000000000751415504077600266260ustar00rootroot00000000000000function x () { return 'before'; } export { x as before }; rollup-2.61.1/test/function/samples/functions-renamed-correctly/factorial.js000066400000000000000000000001731415504077600273270ustar00rootroot00000000000000var x = (function () { return function x ( num ) { return num <= 2 ? num : num * x( num - 1 ); }; })(); export { x }; rollup-2.61.1/test/function/samples/functions-renamed-correctly/main.js000066400000000000000000000002761415504077600263130ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/globally-called-modifying-function/000077500000000000000000000000001415504077600262345ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/globally-called-modifying-function/_config.js000066400000000000000000000001721415504077600301760ustar00rootroot00000000000000module.exports = { description: 'globally called function should be included if it modifies an exported value (#112)' }; rollup-2.61.1/test/function/samples/globally-called-modifying-function/main.js000066400000000000000000000000741415504077600275170ustar00rootroot00000000000000import value from './module.js'; assert.equal( value, 3 ); rollup-2.61.1/test/function/samples/globally-called-modifying-function/module.js000066400000000000000000000002401415504077600300530ustar00rootroot00000000000000var value = 1; function change () { value = 2; } function changeAgain () { value += 1; } change(); if ( true ) { changeAgain(); } export default value; rollup-2.61.1/test/function/samples/handle-calling-uncallable/000077500000000000000000000000001415504077600243415ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/handle-calling-uncallable/_config.js000066400000000000000000000001511415504077600263000ustar00rootroot00000000000000module.exports = { description: 'does not give cryptic error when calling uncallable things (#1257)' }; rollup-2.61.1/test/function/samples/handle-calling-uncallable/foo.js000066400000000000000000000000531415504077600254600ustar00rootroot00000000000000function foo() {} export default { foo }; rollup-2.61.1/test/function/samples/handle-calling-uncallable/main.js000066400000000000000000000001341415504077600256210ustar00rootroot00000000000000import foo from './foo.js'; assert.throws( function () { foo(); }, /is not a function/ ); rollup-2.61.1/test/function/samples/handle-labels-inside-functions/000077500000000000000000000000001415504077600253515ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/handle-labels-inside-functions/_config.js000066400000000000000000000001351415504077600273120ustar00rootroot00000000000000module.exports = { description: 'do not fail when using labels inside functions (#1706)' }; rollup-2.61.1/test/function/samples/handle-labels-inside-functions/main.js000066400000000000000000000002451415504077600266340ustar00rootroot00000000000000function loopWithLabel () { label2: { while ( true ) { if ( Math.random() < 0.5 ) { break label2; } assert.equal(42, 42); } } } loopWithLabel(); rollup-2.61.1/test/function/samples/handle-missing-export-source/000077500000000000000000000000001415504077600251165ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/handle-missing-export-source/_config.js000066400000000000000000000006051415504077600270610ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/handle-missing-export-source/foo.js000066400000000000000000000000321415504077600262320ustar00rootroot00000000000000export const unused = 42; rollup-2.61.1/test/function/samples/handle-missing-export-source/main.js000066400000000000000000000000531415504077600263760ustar00rootroot00000000000000import './foo.js'; export const foo = 42; rollup-2.61.1/test/function/samples/handle-object-rest-spread-patterns/000077500000000000000000000000001415504077600261635ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/handle-object-rest-spread-patterns/_config.js000066400000000000000000000001431415504077600301230ustar00rootroot00000000000000module.exports = { description: 'handles properties created by an object rest spread operator' }; rollup-2.61.1/test/function/samples/handle-object-rest-spread-patterns/main.js000066400000000000000000000005631415504077600274510ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/handle-object-rest-spread-properties/000077500000000000000000000000001415504077600265175ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/handle-object-rest-spread-properties/_config.js000066400000000000000000000001431415504077600304570ustar00rootroot00000000000000module.exports = { description: 'handles properties created by an object rest spread operator' }; rollup-2.61.1/test/function/samples/handle-object-rest-spread-properties/main.js000066400000000000000000000002021415504077600277730ustar00rootroot00000000000000const a = { result: true }; const b = { ...a }; if (!b.result) { throw new Error('Spread properties were not recognized'); } rollup-2.61.1/test/function/samples/handle-object-rest-spread-reassigments/000077500000000000000000000000001415504077600270275ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/handle-object-rest-spread-reassigments/_config.js000066400000000000000000000001431415504077600307670ustar00rootroot00000000000000module.exports = { description: 'handles properties created by an object rest spread operator' }; rollup-2.61.1/test/function/samples/handle-object-rest-spread-reassigments/main.js000066400000000000000000000004341415504077600303120ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/handle-statically-resolvable-if-statements/000077500000000000000000000000001415504077600277165ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/handle-statically-resolvable-if-statements/_config.js000066400000000000000000000003061415504077600316570ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'handles statically resolvable "if" statements (#2134)', context: { value: 1 }, exports({ x }) { assert.equal(x, 1); } }; rollup-2.61.1/test/function/samples/handle-statically-resolvable-if-statements/main.js000066400000000000000000000001201415504077600311710ustar00rootroot00000000000000export let x = 0; if (value === 1) { x = 1; } else if (12 !== 12) { x = 2; } rollup-2.61.1/test/function/samples/handles-double-declarations/000077500000000000000000000000001415504077600247335ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/handles-double-declarations/_config.js000066400000000000000000000001611415504077600266730ustar00rootroot00000000000000module.exports = { description: 'does not fail for double declarations with initializers from other modules' }; rollup-2.61.1/test/function/samples/handles-double-declarations/foobar.js000066400000000000000000000001001415504077600265300ustar00rootroot00000000000000export var foo = { foo: true }; export var bar = { bar: true }; rollup-2.61.1/test/function/samples/handles-double-declarations/main.js000066400000000000000000000001341415504077600262130ustar00rootroot00000000000000import { foo, bar } from './foobar.js'; var baz = foo; var baz = bar; assert.ok(baz.bar); rollup-2.61.1/test/function/samples/handles-empty-string-sourcemap-mappings/000077500000000000000000000000001415504077600272655ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/handles-empty-string-sourcemap-mappings/_config.js000066400000000000000000000004561415504077600312340ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/handles-empty-string-sourcemap-mappings/main.js000066400000000000000000000000231415504077600305420ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/handles-stringified-sourcemaps/000077500000000000000000000000001415504077600255015ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/handles-stringified-sourcemaps/_config.js000066400000000000000000000005721415504077600274470ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/handles-stringified-sourcemaps/main.js000066400000000000000000000000231415504077600267560ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/has-modules-array/000077500000000000000000000000001415504077600227345ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/has-modules-array/_config.js000066400000000000000000000006641415504077600247040ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/has-modules-array/foo.js000066400000000000000000000000231415504077600240500ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/has-modules-array/main.js000066400000000000000000000000621415504077600242140ustar00rootroot00000000000000import foo from './foo'; assert.equal( foo, 42 ); rollup-2.61.1/test/function/samples/hidden-directories/000077500000000000000000000000001415504077600231445ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/hidden-directories/.foo/000077500000000000000000000000001415504077600240055ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/hidden-directories/.foo/bar.js000066400000000000000000000000231415504077600251020ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/hidden-directories/_config.js000066400000000000000000000001411415504077600251020ustar00rootroot00000000000000module.exports = { description: 'allows imports from directories with leading "." character' }; rollup-2.61.1/test/function/samples/hidden-directories/main.js000066400000000000000000000000701415504077600244230ustar00rootroot00000000000000import bar from './.foo/bar'; assert.equal( bar, 42 ); rollup-2.61.1/test/function/samples/hoisted-variable-if-else/000077500000000000000000000000001415504077600241435ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/hoisted-variable-if-else/_config.js000066400000000000000000000005471415504077600261130ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/hoisted-variable-if-else/main.js000066400000000000000000000004631415504077600254300ustar00rootroot00000000000000export 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-2.61.1/test/function/samples/identifiers-in-template-literals/000077500000000000000000000000001415504077600257365ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/identifiers-in-template-literals/_config.js000066400000000000000000000001361415504077600277000ustar00rootroot00000000000000module.exports = { description: 'identifiers in template literals are rendered correctly' }; rollup-2.61.1/test/function/samples/identifiers-in-template-literals/a.js000066400000000000000000000001271415504077600265140ustar00rootroot00000000000000function x ( keypath ) { return 'a'; } export default function a () { return x(); } rollup-2.61.1/test/function/samples/identifiers-in-template-literals/b.js000066400000000000000000000001311415504077600265100ustar00rootroot00000000000000function x ( name ) { return 'b'; } export default function b () { return `${x()}`; } rollup-2.61.1/test/function/samples/identifiers-in-template-literals/main.js000066400000000000000000000001451415504077600272200ustar00rootroot00000000000000import a from './a.js'; import b from './b.js'; assert.equal( a(), 'a' ); assert.equal( b(), 'b' ); rollup-2.61.1/test/function/samples/if-statement-insert-whitespace/000077500000000000000000000000001415504077600254335ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/if-statement-insert-whitespace/_config.js000066400000000000000000000003051415504077600273730ustar00rootroot00000000000000module.exports = { description: 'inserts necessary white-space when simplifying if-statements (#3419)', options: { external: 'external' }, context: { require() { return false; } } }; rollup-2.61.1/test/function/samples/if-statement-insert-whitespace/main.js000066400000000000000000000002531415504077600267150ustar00rootroot00000000000000let works = false; const makeItWork = () => works = true; import value from 'external'; if (value) {} else"production"!=="local"?makeItWork():void 0; assert.ok(works); rollup-2.61.1/test/function/samples/if-statement-with-assignment/000077500000000000000000000000001415504077600251165ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/if-statement-with-assignment/_config.js000066400000000000000000000001271415504077600270600ustar00rootroot00000000000000module.exports = { description: 'update assignments to names are preserved (#930)' }; rollup-2.61.1/test/function/samples/if-statement-with-assignment/main.js000066400000000000000000000001621415504077600263770ustar00rootroot00000000000000var result = 0; if ( Math.random() <= 1 ) { if ( Math.random() <= 1 ) result += 1; } assert.equal( result, 1 ); rollup-2.61.1/test/function/samples/if-statement-with-false-condition/000077500000000000000000000000001415504077600260245ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/if-statement-with-false-condition/_config.js000066400000000000000000000001441415504077600277650ustar00rootroot00000000000000module.exports = { description: 'if statements with false condition do not break render (#973)' }; rollup-2.61.1/test/function/samples/if-statement-with-false-condition/main.js000066400000000000000000000010711415504077600273050ustar00rootroot00000000000000export 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-2.61.1/test/function/samples/if-statement-with-update/000077500000000000000000000000001415504077600242305ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/if-statement-with-update/_config.js000066400000000000000000000001141415504077600261660ustar00rootroot00000000000000module.exports = { description: 'updates to names are preserved (#930)' }; rollup-2.61.1/test/function/samples/if-statement-with-update/main.js000066400000000000000000000001571415504077600255150ustar00rootroot00000000000000var result = 0; if ( Math.random() <= 1 ) { if ( Math.random() <= 1 ) ++result; } assert.equal( result, 1 ); rollup-2.61.1/test/function/samples/iife-code-splitting/000077500000000000000000000000001415504077600232365ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/iife-code-splitting/_config.js000066400000000000000000000005751415504077600252070ustar00rootroot00000000000000module.exports = { 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/guide/en/#outputformat' } }; rollup-2.61.1/test/function/samples/iife-code-splitting/foo.js000066400000000000000000000000231415504077600243520ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/iife-code-splitting/main.js000066400000000000000000000000511415504077600245140ustar00rootroot00000000000000export default () => import('./foo.js'); rollup-2.61.1/test/function/samples/iife-comments/000077500000000000000000000000001415504077600221365ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/iife-comments/_config.js000066400000000000000000000002371415504077600241020ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'does not wrongly append comments', exports(exports) { assert.equal(exports, 42); } }; rollup-2.61.1/test/function/samples/iife-comments/main.js000066400000000000000000000002521415504077600234170ustar00rootroot00000000000000function noop () {} (function () { noop( '1' ) // line comment after statement /* BLOCK COMMENT */ noop( '2' ); // standalone comment })(); export default 42; rollup-2.61.1/test/function/samples/implicit-dependencies/000077500000000000000000000000001415504077600236355ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/implicit-dependencies/dependant-dynamic-import-no-effects/000077500000000000000000000000001415504077600325605ustar00rootroot00000000000000_config.js000066400000000000000000000014571415504077600344520ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/implicit-dependencies/dependant-dynamic-import-no-effectsconst path = require('path'); module.exports = { 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, 'main.js'), path.join(__dirname, 'dependant.js') ] } }; rollup-2.61.1/test/function/samples/implicit-dependencies/dependant-dynamic-import-no-effects/dep.js000066400000000000000000000000261415504077600336640ustar00rootroot00000000000000export default 'dep'; dependant.js000066400000000000000000000000651415504077600350020ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/implicit-dependencies/dependant-dynamic-import-no-effectsconst unused = 'unused'; export default 'dependant'; main.js000066400000000000000000000000551415504077600337630ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/implicit-dependencies/dependant-dynamic-import-no-effectsimport './dependant'; export default 'main'; rollup-2.61.1/test/function/samples/implicit-dependencies/dependant-dynamic-import-not-included/000077500000000000000000000000001415504077600331145ustar00rootroot00000000000000_config.js000066400000000000000000000020101415504077600347700ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/implicit-dependencies/dependant-dynamic-import-not-includedconst path = require('path'); module.exports = { 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, 'main.js'), path.join(__dirname, 'dependant.js') ] } }; dep1.js000066400000000000000000000000261415504077600342220ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/implicit-dependencies/dependant-dynamic-import-not-includedexport default 'dep'; dep2.js000066400000000000000000000000261415504077600342230ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/implicit-dependencies/dependant-dynamic-import-not-includedexport default 'dep'; dependant.js000066400000000000000000000000341415504077600353320ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/implicit-dependencies/dependant-dynamic-import-not-includedexport default 'dependant'; main.js000066400000000000000000000001021415504077600343100ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/implicit-dependencies/dependant-dynamic-import-not-includedexport default 'main'; if (false) { import('./dependant.js'); } rollup-2.61.1/test/function/samples/implicit-dependencies/dependant-not-part-of-graph/000077500000000000000000000000001415504077600310425ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/implicit-dependencies/dependant-not-part-of-graph/_config.js000066400000000000000000000022061415504077600330040ustar00rootroot00000000000000const path = require('path'); module.exports = { 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, 'main.js'), path.join(__dirname, 'dependant.js') ] } }; rollup-2.61.1/test/function/samples/implicit-dependencies/dependant-not-part-of-graph/dep1.js000066400000000000000000000000261415504077600322270ustar00rootroot00000000000000export default 'dep'; rollup-2.61.1/test/function/samples/implicit-dependencies/dependant-not-part-of-graph/dep2.js000066400000000000000000000000261415504077600322300ustar00rootroot00000000000000export default 'dep'; rollup-2.61.1/test/function/samples/implicit-dependencies/dependant-not-part-of-graph/dep3.js000066400000000000000000000000261415504077600322310ustar00rootroot00000000000000export default 'dep'; rollup-2.61.1/test/function/samples/implicit-dependencies/dependant-not-part-of-graph/dependant.js000066400000000000000000000000341415504077600333370ustar00rootroot00000000000000export default 'dependant'; rollup-2.61.1/test/function/samples/implicit-dependencies/dependant-not-part-of-graph/main.js000066400000000000000000000000271415504077600323230ustar00rootroot00000000000000export default 'main'; rollup-2.61.1/test/function/samples/implicit-dependencies/external-dependant/000077500000000000000000000000001415504077600274175ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/implicit-dependencies/external-dependant/_config.js000066400000000000000000000011141415504077600313560ustar00rootroot00000000000000const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/implicit-dependencies/external-dependant/dep.js000066400000000000000000000000261415504077600305230ustar00rootroot00000000000000export default 'dep'; rollup-2.61.1/test/function/samples/implicit-dependencies/external-dependant/main.js000066400000000000000000000000271415504077600307000ustar00rootroot00000000000000export default 'main'; rollup-2.61.1/test/function/samples/implicit-dependencies/missing-dependant/000077500000000000000000000000001415504077600272465ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/implicit-dependencies/missing-dependant/_config.js000066400000000000000000000012111415504077600312030ustar00rootroot00000000000000const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/implicit-dependencies/missing-dependant/dep.js000066400000000000000000000000261415504077600303520ustar00rootroot00000000000000export default 'dep'; rollup-2.61.1/test/function/samples/implicit-dependencies/missing-dependant/main.js000066400000000000000000000000271415504077600305270ustar00rootroot00000000000000export default 'main'; rollup-2.61.1/test/function/samples/import-as/000077500000000000000000000000001415504077600213125ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-as/_config.js000066400000000000000000000002611415504077600232530ustar00rootroot00000000000000module.exports = { description: 'renames named and default imports' }; // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/import-as rollup-2.61.1/test/function/samples/import-as/foo.js000066400000000000000000000001301415504077600224250ustar00rootroot00000000000000/* jshint esnext:true */ export var a = 'a'; export var b = 'b'; export default 'DEF'; rollup-2.61.1/test/function/samples/import-as/main.js000066400000000000000000000001771415504077600226010ustar00rootroot00000000000000import { a as b, b as a, default as def } from './foo'; assert.equal(b, 'a'); assert.equal(a, 'b'); assert.equal(def, 'DEF'); rollup-2.61.1/test/function/samples/import-binding/000077500000000000000000000000001415504077600223215ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-binding/_config.js000066400000000000000000000000651415504077600242640ustar00rootroot00000000000000module.exports = { description: 'import binding' }; rollup-2.61.1/test/function/samples/import-binding/foo.js000066400000000000000000000000351415504077600234400ustar00rootroot00000000000000var foo = 42; export { foo };rollup-2.61.1/test/function/samples/import-binding/main.js000066400000000000000000000000651415504077600236040ustar00rootroot00000000000000import { foo } from './foo'; assert.equal( foo, 42 );rollup-2.61.1/test/function/samples/import-chain-as/000077500000000000000000000000001415504077600223725ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-chain-as/_config.js000066400000000000000000000001021415504077600243250ustar00rootroot00000000000000module.exports = { description: 'imports as- chained exports' }; rollup-2.61.1/test/function/samples/import-chain-as/first.js000066400000000000000000000000271415504077600240560ustar00rootroot00000000000000export var value = 42; rollup-2.61.1/test/function/samples/import-chain-as/main.js000066400000000000000000000002021415504077600236460ustar00rootroot00000000000000import * as second from './second'; assert.equal( second.first.value, 42 ); assert.deepEqual( second, { first: { value: 42 } }); rollup-2.61.1/test/function/samples/import-chain-as/second.js000066400000000000000000000000641415504077600242030ustar00rootroot00000000000000import * as first from './first'; export { first }; rollup-2.61.1/test/function/samples/import-chain/000077500000000000000000000000001415504077600217715ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-chain/_config.js000066400000000000000000000002521415504077600237320ustar00rootroot00000000000000module.exports = { description: 'imports chained exports' }; // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/import-chain rollup-2.61.1/test/function/samples/import-chain/first.js000066400000000000000000000000271415504077600234550ustar00rootroot00000000000000export var value = 42; rollup-2.61.1/test/function/samples/import-chain/main.js000066400000000000000000000000731415504077600232530ustar00rootroot00000000000000import { value } from './second'; assert.equal(value, 42); rollup-2.61.1/test/function/samples/import-chain/second.js000066400000000000000000000000631415504077600236010ustar00rootroot00000000000000import { value } from './first'; export { value }; rollup-2.61.1/test/function/samples/import-default-and-named-function/000077500000000000000000000000001415504077600260005ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-default-and-named-function/_config.js000066400000000000000000000003311415504077600277370ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/import-default-and-named-function/foo.js000066400000000000000000000001351415504077600271200ustar00rootroot00000000000000export default function foo() { return 1; } export function callsFoo() { return foo(); }rollup-2.61.1/test/function/samples/import-default-and-named-function/main.js000066400000000000000000000001511415504077600272570ustar00rootroot00000000000000import foo, { callsFoo } from './foo'; assert.strictEqual(foo(), 1); assert.strictEqual(callsFoo(), 1); rollup-2.61.1/test/function/samples/import-default-as-named/000077500000000000000000000000001415504077600240165ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-default-as-named/_config.js000066400000000000000000000003001415504077600257510ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/import-default-as-named/foo.js000066400000000000000000000000531415504077600251350ustar00rootroot00000000000000export default function () { return 1; } rollup-2.61.1/test/function/samples/import-default-as-named/main.js000066400000000000000000000001631415504077600253000ustar00rootroot00000000000000import fn1 from './foo'; import { default as fn2 } from './foo'; assert.equal(fn1(), 1); assert.equal(fn2(), 1); rollup-2.61.1/test/function/samples/import-default-as-other/000077500000000000000000000000001415504077600240535ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-default-as-other/_config.js000066400000000000000000000001171415504077600260140ustar00rootroot00000000000000module.exports = { description: 'imports a default import by another name' }; rollup-2.61.1/test/function/samples/import-default-as-other/foo.js000066400000000000000000000000561415504077600251750ustar00rootroot00000000000000export default function foo () { return 42; }rollup-2.61.1/test/function/samples/import-default-as-other/main.js000066400000000000000000000000631415504077600253340ustar00rootroot00000000000000import bar from './foo'; assert.equal( bar(), 42 );rollup-2.61.1/test/function/samples/import-default-class/000077500000000000000000000000001415504077600234365ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-default-class/_config.js000066400000000000000000000002621415504077600254000ustar00rootroot00000000000000module.exports = { description: 'imports a default class' }; // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/export-default-class rollup-2.61.1/test/function/samples/import-default-class/main.js000066400000000000000000000001621415504077600247170ustar00rootroot00000000000000import Point from './point'; assert.strictEqual(new Point(1, 2).x, 1); assert.strictEqual(new Point(1, 2).y, 2); rollup-2.61.1/test/function/samples/import-default-class/point.js000066400000000000000000000001311415504077600251200ustar00rootroot00000000000000export default class Point { constructor(x, y) { this.x = x; this.y = y; } } rollup-2.61.1/test/function/samples/import-default-expression/000077500000000000000000000000001415504077600245305ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-default-expression/_config.js000066400000000000000000000001031415504077600264640ustar00rootroot00000000000000module.exports = { description: 'imports a default expression' }; rollup-2.61.1/test/function/samples/import-default-expression/foo.js000066400000000000000000000000261415504077600256470ustar00rootroot00000000000000export default 40 + 2;rollup-2.61.1/test/function/samples/import-default-expression/main.js000066400000000000000000000000611415504077600260070ustar00rootroot00000000000000import foo from './foo'; assert.equal( foo, 42 );rollup-2.61.1/test/function/samples/import-default-from-external/000077500000000000000000000000001415504077600251145ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-default-from-external/_config.js000066400000000000000000000001601415504077600270530ustar00rootroot00000000000000module.exports = { description: 'imports default from external module', options: { external: ['path'] } }; rollup-2.61.1/test/function/samples/import-default-from-external/main.js000066400000000000000000000003221415504077600263730ustar00rootroot00000000000000// 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-2.61.1/test/function/samples/import-default-function/000077500000000000000000000000001415504077600241565ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-default-function/_config.js000066400000000000000000000001011415504077600261100ustar00rootroot00000000000000module.exports = { description: 'imports a default function' }; rollup-2.61.1/test/function/samples/import-default-function/foo.js000066400000000000000000000000561415504077600253000ustar00rootroot00000000000000export default function foo () { return 42; }rollup-2.61.1/test/function/samples/import-default-function/main.js000066400000000000000000000000631415504077600254370ustar00rootroot00000000000000import foo from './foo'; assert.equal( foo(), 42 );rollup-2.61.1/test/function/samples/import-dependency-in-other-module/000077500000000000000000000000001415504077600260335ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-dependency-in-other-module/_config.js000066400000000000000000000001221415504077600277700ustar00rootroot00000000000000module.exports = { description: 'imports a dependency from a separate module' }; rollup-2.61.1/test/function/samples/import-dependency-in-other-module/bar.js000066400000000000000000000000221415504077600271270ustar00rootroot00000000000000export default 40;rollup-2.61.1/test/function/samples/import-dependency-in-other-module/foo.js000066400000000000000000000001051415504077600271500ustar00rootroot00000000000000import bar from './bar'; export function foo () { return bar + 2; }rollup-2.61.1/test/function/samples/import-dependency-in-other-module/main.js000066400000000000000000000000671415504077600273200ustar00rootroot00000000000000import { foo } from './foo'; assert.equal( foo(), 42 );rollup-2.61.1/test/function/samples/import-dependency-in-same-module/000077500000000000000000000000001415504077600256375ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-dependency-in-same-module/_config.js000066400000000000000000000001201415504077600275720ustar00rootroot00000000000000module.exports = { description: 'imports a dependency from the same module' }; rollup-2.61.1/test/function/samples/import-dependency-in-same-module/foo.js000066400000000000000000000000721415504077600267570ustar00rootroot00000000000000var bar = 40; export function foo () { return bar + 2; }rollup-2.61.1/test/function/samples/import-dependency-in-same-module/main.js000066400000000000000000000000671415504077600271240ustar00rootroot00000000000000import { foo } from './foo'; assert.equal( foo(), 42 );rollup-2.61.1/test/function/samples/import-empty-from-external/000077500000000000000000000000001415504077600246265ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-empty-from-external/_config.js000066400000000000000000000004601415504077600265700ustar00rootroot00000000000000module.exports = { description: 'imports external module for side effects', context: { // override require here, making "foo" appear as a global module require(name) { if (name === 'foo') { return require('./foo'); } return require(name); } }, options: { external: ['foo'] } }; rollup-2.61.1/test/function/samples/import-empty-from-external/foo.js000066400000000000000000000000241415504077600257430ustar00rootroot00000000000000global.answer = 42; rollup-2.61.1/test/function/samples/import-empty-from-external/main.js000066400000000000000000000000621415504077600261060ustar00rootroot00000000000000import 'foo'; assert.equal( global.answer, 42 ); rollup-2.61.1/test/function/samples/import-meta-url/000077500000000000000000000000001415504077600224355ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-meta-url/_config.js000066400000000000000000000005161415504077600244010ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const URL = require('url').URL; module.exports = { 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-2.61.1/test/function/samples/import-meta-url/main.js000066400000000000000000000000401415504077600237110ustar00rootroot00000000000000export default import.meta.url; rollup-2.61.1/test/function/samples/import-named-class/000077500000000000000000000000001415504077600230765ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-named-class/_config.js000066400000000000000000000002561415504077600250430ustar00rootroot00000000000000module.exports = { description: 'imports a named class' }; // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/export-named-class rollup-2.61.1/test/function/samples/import-named-class/foo.js000066400000000000000000000000351415504077600242150ustar00rootroot00000000000000class Foo {} export { Foo }; rollup-2.61.1/test/function/samples/import-named-class/main.js000066400000000000000000000001161415504077600243560ustar00rootroot00000000000000import { Foo } from './foo'; assert.strictEqual(new Foo().constructor, Foo); rollup-2.61.1/test/function/samples/import-named-from-external/000077500000000000000000000000001415504077600245545ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-named-from-external/_config.js000066400000000000000000000001611415504077600265140ustar00rootroot00000000000000module.exports = { description: 'imports names from an external module', options: { external: ['path'] } }; rollup-2.61.1/test/function/samples/import-named-from-external/main.js000066400000000000000000000002471415504077600260410ustar00rootroot00000000000000import { relative, normalize } from 'path'; var path = 'foo/bar/baz'; var path2 = 'foo/baz/bar'; assert.equal( relative( path, path2 ), normalize('../../baz/bar') );rollup-2.61.1/test/function/samples/import-named-function-as-other/000077500000000000000000000000001415504077600253365ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-named-function-as-other/_config.js000066400000000000000000000001171415504077600272770ustar00rootroot00000000000000module.exports = { description: 'imports a named function by another name' }; rollup-2.61.1/test/function/samples/import-named-function-as-other/foo.js000066400000000000000000000000461415504077600264570ustar00rootroot00000000000000export function foo () { return 42; }rollup-2.61.1/test/function/samples/import-named-function-as-other/main.js000066400000000000000000000000761415504077600266230ustar00rootroot00000000000000import { foo as bar } from './foo'; assert.equal( bar(), 42 );rollup-2.61.1/test/function/samples/import-named-function/000077500000000000000000000000001415504077600236165ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-named-function/_config.js000066400000000000000000000000771415504077600255640ustar00rootroot00000000000000module.exports = { description: 'imports a named function' }; rollup-2.61.1/test/function/samples/import-named-function/foo.js000066400000000000000000000000461415504077600247370ustar00rootroot00000000000000export function foo () { return 42; }rollup-2.61.1/test/function/samples/import-named-function/main.js000066400000000000000000000000671415504077600251030ustar00rootroot00000000000000import { foo } from './foo'; assert.equal( foo(), 42 );rollup-2.61.1/test/function/samples/import-nameless-class-expression/000077500000000000000000000000001415504077600260165ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-nameless-class-expression/_config.js000066400000000000000000000003011415504077600277520ustar00rootroot00000000000000module.exports = { description: 'imports a nameless class expression' }; // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/export-class-expression rollup-2.61.1/test/function/samples/import-nameless-class-expression/foo.js000066400000000000000000000000311415504077600271310ustar00rootroot00000000000000export default class {}; rollup-2.61.1/test/function/samples/import-nameless-class-expression/main.js000066400000000000000000000001121415504077600272720ustar00rootroot00000000000000import Foo from './foo'; assert.strictEqual(new Foo().constructor, Foo); rollup-2.61.1/test/function/samples/import-namespace-from-external-module-renamed/000077500000000000000000000000001415504077600303205ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-namespace-from-external-module-renamed/_config.js000066400000000000000000000002061415504077600322600ustar00rootroot00000000000000module.exports = { description: 'imports a namespace from an external module and renames it', options: { external: ['path'] } }; rollup-2.61.1/test/function/samples/import-namespace-from-external-module-renamed/main.js000066400000000000000000000002651415504077600316050ustar00rootroot00000000000000import * 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-2.61.1/test/function/samples/import-namespace-from-external-module/000077500000000000000000000000001415504077600267075ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-namespace-from-external-module/_config.js000066400000000000000000000001671415504077600306550ustar00rootroot00000000000000module.exports = { description: 'imports a namespace from an external module', options: { external: ['path'] } }; rollup-2.61.1/test/function/samples/import-namespace-from-external-module/main.js000066400000000000000000000002451415504077600301720ustar00rootroot00000000000000import * 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-2.61.1/test/function/samples/import-namespace-from-internal-module-renamed/000077500000000000000000000000001415504077600303125ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-namespace-from-internal-module-renamed/_config.js000066400000000000000000000001171415504077600322530ustar00rootroot00000000000000module.exports = { description: 'correctly exports x as y inside a bundle' }; rollup-2.61.1/test/function/samples/import-namespace-from-internal-module-renamed/foo.js000066400000000000000000000000401415504077600314250ustar00rootroot00000000000000var x = 42; export { x as y }; rollup-2.61.1/test/function/samples/import-namespace-from-internal-module-renamed/main.js000066400000000000000000000000721415504077600315730ustar00rootroot00000000000000import * as foo from './foo'; assert.equal( foo.y, 42 ); rollup-2.61.1/test/function/samples/import-namespace-from-internal-module/000077500000000000000000000000001415504077600267015ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-namespace-from-internal-module/_config.js000066400000000000000000000002741415504077600306460ustar00rootroot00000000000000module.exports = { description: 'imports a namespace from an internal module' }; // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/namespaces rollup-2.61.1/test/function/samples/import-namespace-from-internal-module/foo.js000066400000000000000000000000761415504077600300250ustar00rootroot00000000000000export var a = 'a'; export var b = 'b'; export default 'DEF'; rollup-2.61.1/test/function/samples/import-namespace-from-internal-module/main.js000066400000000000000000000003511415504077600301620ustar00rootroot00000000000000import * 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-2.61.1/test/function/samples/import-not-at-top-level-fails/000077500000000000000000000000001415504077600251125ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-not-at-top-level-fails/_config.js000066400000000000000000000012101415504077600270460ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'disallows non-top-level imports', error: { code: 'PARSE_ERROR', message: `'import' and 'export' may only appear at the top level`, id: path.join(__dirname, 'main.js'), parserError: { loc: { column: 2, line: 2 }, message: "'import' and 'export' may only appear at the top level (2:2)", pos: 19, raisedAt: 25 }, pos: 19, watchFiles: [path.join(__dirname, 'main.js')], loc: { file: path.join(__dirname, 'main.js'), line: 2, column: 2 }, frame: ` 1: function foo() { 2: import foo from './foo.js'; ^ 3: } ` } }; rollup-2.61.1/test/function/samples/import-not-at-top-level-fails/main.js000066400000000000000000000000611415504077600263710ustar00rootroot00000000000000function foo() { import foo from './foo.js'; } rollup-2.61.1/test/function/samples/import-of-unexported-fails/000077500000000000000000000000001415504077600246025ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-of-unexported-fails/_config.js000066400000000000000000000011471415504077600265470ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'marking an imported, but unexported, identifier should throw', error: { code: 'MISSING_EXPORT', message: `'default' is not exported by empty.js, imported by main.js`, id: path.join(__dirname, 'main.js'), pos: 7, watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'empty.js')], loc: { file: path.join(__dirname, 'main.js'), line: 1, column: 7 }, frame: ` 1: import a from './empty.js'; ^ 2: 3: a(); `, url: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module` } }; rollup-2.61.1/test/function/samples/import-of-unexported-fails/empty.js000066400000000000000000000000001415504077600262640ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-of-unexported-fails/main.js000066400000000000000000000000421415504077600260600ustar00rootroot00000000000000import a from './empty.js'; a(); rollup-2.61.1/test/function/samples/import-var-declaration/000077500000000000000000000000001415504077600237625ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/import-var-declaration/_config.js000066400000000000000000000001051415504077600257200ustar00rootroot00000000000000module.exports = { description: 'imports a variable declaration' }; rollup-2.61.1/test/function/samples/import-var-declaration/foo.js000066400000000000000000000000241415504077600250770ustar00rootroot00000000000000export var foo = 42;rollup-2.61.1/test/function/samples/import-var-declaration/main.js000066400000000000000000000000651415504077600252450ustar00rootroot00000000000000import { foo } from './foo'; assert.equal( foo, 42 );rollup-2.61.1/test/function/samples/imports-are-deconflicted-b/000077500000000000000000000000001415504077600245015ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/imports-are-deconflicted-b/_config.js000066400000000000000000000001471415504077600264450ustar00rootroot00000000000000module.exports = { description: 'deconflicts imports (redux)', options: { external: ['path'] } }; rollup-2.61.1/test/function/samples/imports-are-deconflicted-b/bar.js000066400000000000000000000001571415504077600256060ustar00rootroot00000000000000import foo from 'path'; export default function () { return foo.relative( 'foo/bar/baz', 'foo/baz/bar' ); }; rollup-2.61.1/test/function/samples/imports-are-deconflicted-b/foo.js000066400000000000000000000000411415504077600256150ustar00rootroot00000000000000var z = 'foo'; export default z; rollup-2.61.1/test/function/samples/imports-are-deconflicted-b/main.js000066400000000000000000000002441415504077600257630ustar00rootroot00000000000000import foo from './foo'; import bar from './bar'; import { normalize } from 'path'; assert.equal( foo, 'foo' ); assert.equal( bar(), normalize('../../baz/bar') ); rollup-2.61.1/test/function/samples/imports-are-deconflicted-c/000077500000000000000000000000001415504077600245025ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/imports-are-deconflicted-c/_config.js000066400000000000000000000001011415504077600264340ustar00rootroot00000000000000module.exports = { description: 'deconflicts imports, again' }; rollup-2.61.1/test/function/samples/imports-are-deconflicted-c/bar.js000066400000000000000000000000401415504077600255760ustar00rootroot00000000000000export default { isBar: true }; rollup-2.61.1/test/function/samples/imports-are-deconflicted-c/foo.js000066400000000000000000000000641415504077600256230ustar00rootroot00000000000000import foo from './bar'; export default foo.isBar; rollup-2.61.1/test/function/samples/imports-are-deconflicted-c/main.js000066400000000000000000000000541415504077600257630ustar00rootroot00000000000000import foo from './foo'; assert.ok( foo ); rollup-2.61.1/test/function/samples/imports-are-deconflicted/000077500000000000000000000000001415504077600242625ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/imports-are-deconflicted/_config.js000066400000000000000000000001371415504077600262250ustar00rootroot00000000000000module.exports = { description: 'deconflicts imports', options: { external: ['path'] } }; rollup-2.61.1/test/function/samples/imports-are-deconflicted/bar.js000066400000000000000000000001571415504077600253670ustar00rootroot00000000000000import foo from 'path'; export default function () { return foo.relative( 'foo/bar/baz', 'foo/baz/bar' ); }; rollup-2.61.1/test/function/samples/imports-are-deconflicted/foo.js000066400000000000000000000000261415504077600254010ustar00rootroot00000000000000export default 'foo'; rollup-2.61.1/test/function/samples/imports-are-deconflicted/main.js000066400000000000000000000002441415504077600255440ustar00rootroot00000000000000import foo from './foo'; import bar from './bar'; import { normalize } from 'path'; assert.equal( foo, 'foo' ); assert.equal( bar(), normalize('../../baz/bar') ); rollup-2.61.1/test/function/samples/includes-internally-used-default-export/000077500000000000000000000000001415504077600272635ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/includes-internally-used-default-export/_config.js000066400000000000000000000001351415504077600312240ustar00rootroot00000000000000module.exports = { description: 'includes default exports that are only used internally' }; rollup-2.61.1/test/function/samples/includes-internally-used-default-export/main.js000066400000000000000000000000711415504077600305430ustar00rootroot00000000000000import { b } from './module.js'; assert.equal(b(), 15); rollup-2.61.1/test/function/samples/includes-internally-used-default-export/module.js000066400000000000000000000001261415504077600311050ustar00rootroot00000000000000export default function a() { return 5; } export function b() { return a() + 10; } rollup-2.61.1/test/function/samples/includes-reassignments/000077500000000000000000000000001415504077600240655ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/includes-reassignments/_config.js000066400000000000000000000001411415504077600260230ustar00rootroot00000000000000module.exports = { description: 'includes reassignments that are ignored on an initial pass' }; rollup-2.61.1/test/function/samples/includes-reassignments/foo.js000066400000000000000000000001601415504077600252030ustar00rootroot00000000000000var answer, getAnswer; getAnswer = function () { return 42; }; answer = getAnswer(); export default answer; rollup-2.61.1/test/function/samples/includes-reassignments/main.js000066400000000000000000000000741415504077600253500ustar00rootroot00000000000000import answer from './foo.js'; assert.equal( answer, 42 ); rollup-2.61.1/test/function/samples/includes-superclass/000077500000000000000000000000001415504077600233675ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/includes-superclass/_config.js000066400000000000000000000001011415504077600253210ustar00rootroot00000000000000module.exports = { description: 'includes superclass (#932)' }; rollup-2.61.1/test/function/samples/includes-superclass/base.js000066400000000000000000000000621415504077600246350ustar00rootroot00000000000000export class Base { foo () { return true; } } rollup-2.61.1/test/function/samples/includes-superclass/main.js000066400000000000000000000001621415504077600246500ustar00rootroot00000000000000import { Thing } from './thing'; const thing = new Thing(); assert.ok( thing.foo() ); assert.ok( thing.bar() ); rollup-2.61.1/test/function/samples/includes-superclass/thing.js000066400000000000000000000001431415504077600250340ustar00rootroot00000000000000import { Base } from './base.js'; export class Thing extends Base { bar () { return true; } } rollup-2.61.1/test/function/samples/inline-dynamic-imports-bundle/000077500000000000000000000000001415504077600252415ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/inline-dynamic-imports-bundle/_config.js000066400000000000000000000006551415504077600272110ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/inline-dynamic-imports-bundle/lib.js000066400000000000000000000000271415504077600263440ustar00rootroot00000000000000export const foo = 42; rollup-2.61.1/test/function/samples/inline-dynamic-imports-bundle/main.js000066400000000000000000000000441415504077600265210ustar00rootroot00000000000000export { foo } from './reexporter'; rollup-2.61.1/test/function/samples/inline-dynamic-imports-bundle/reexporter.js000066400000000000000000000000351415504077600277740ustar00rootroot00000000000000export { foo } from './lib'; rollup-2.61.1/test/function/samples/inline-dynamic-no-treeshake/000077500000000000000000000000001415504077600246625ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/inline-dynamic-no-treeshake/_config.js000066400000000000000000000012441415504077600266250ustar00rootroot00000000000000const MAGIC_ENTRY = 'main'; module.exports = { 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-2.61.1/test/function/samples/inline-dynamic-no-treeshake/dep.js000066400000000000000000000000261415504077600257660ustar00rootroot00000000000000export const foo = 1; rollup-2.61.1/test/function/samples/inline-dynamic-no-treeshake/reexport.js000066400000000000000000000000321415504077600270630ustar00rootroot00000000000000export * from './dep.js'; rollup-2.61.1/test/function/samples/inline-imports-with-manual/000077500000000000000000000000001415504077600245745ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/inline-imports-with-manual/_config.js000066400000000000000000000007221415504077600265370ustar00rootroot00000000000000module.exports = { 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/guide/en/#outputmanualchunks' } }; rollup-2.61.1/test/function/samples/inline-imports-with-manual/lib.js000066400000000000000000000000311415504077600256720ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/function/samples/inline-imports-with-manual/main.js000066400000000000000000000000741415504077600260570ustar00rootroot00000000000000import('./lib').then(({value}) => assert.equal(value, 42)); rollup-2.61.1/test/function/samples/inline-imports-with-multiple-array/000077500000000000000000000000001415504077600262665ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/inline-imports-with-multiple-array/_config.js000066400000000000000000000007341415504077600302340ustar00rootroot00000000000000module.exports = { 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/guide/en/#outputinlinedynamicimports' } }; rollup-2.61.1/test/function/samples/inline-imports-with-multiple-array/lib.js000066400000000000000000000000311415504077600273640ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/function/samples/inline-imports-with-multiple-array/main.js000066400000000000000000000000741415504077600275510ustar00rootroot00000000000000import('./lib').then(({value}) => assert.equal(value, 42)); rollup-2.61.1/test/function/samples/inline-imports-with-multiple-object/000077500000000000000000000000001415504077600264165ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/inline-imports-with-multiple-object/_config.js000066400000000000000000000007521415504077600303640ustar00rootroot00000000000000module.exports = { 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/guide/en/#outputinlinedynamicimports' } }; rollup-2.61.1/test/function/samples/inline-imports-with-multiple-object/lib.js000066400000000000000000000000311415504077600275140ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/function/samples/inline-imports-with-multiple-object/main.js000066400000000000000000000000741415504077600277010ustar00rootroot00000000000000import('./lib').then(({value}) => assert.equal(value, 42)); rollup-2.61.1/test/function/samples/inlined-dynamic-namespace-compact/000077500000000000000000000000001415504077600260215ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/inlined-dynamic-namespace-compact/_config.js000066400000000000000000000004141415504077600277620ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/inlined-dynamic-namespace-compact/dynamic.js000066400000000000000000000001521415504077600300010ustar00rootroot00000000000000import value from './lib'; export default import('./other-dynamic').then(other => other.default + value); rollup-2.61.1/test/function/samples/inlined-dynamic-namespace-compact/lib.js000066400000000000000000000000231415504077600271200ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/inlined-dynamic-namespace-compact/main.js000066400000000000000000000000761415504077600273060ustar00rootroot00000000000000export default import('./dynamic.js').then(ns => ns.default); rollup-2.61.1/test/function/samples/inlined-dynamic-namespace-compact/other-dynamic.js000066400000000000000000000000661415504077600311240ustar00rootroot00000000000000import value from './lib'; export default value * 2; rollup-2.61.1/test/function/samples/input-name-validation/000077500000000000000000000000001415504077600236045ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/input-name-validation/_config.js000066400000000000000000000005061415504077600255470ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/input-name-validation/main.js000066400000000000000000000000411415504077600250610ustar00rootroot00000000000000throw new Error('Not executed'); rollup-2.61.1/test/function/samples/input-name-validation2/000077500000000000000000000000001415504077600236665ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/input-name-validation2/_config.js000066400000000000000000000005101415504077600256240ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/input-name-validation2/main.js000066400000000000000000000000411415504077600251430ustar00rootroot00000000000000throw new Error('Not executed'); rollup-2.61.1/test/function/samples/input-name-validation3/000077500000000000000000000000001415504077600236675ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/input-name-validation3/_config.js000066400000000000000000000005121415504077600256270ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/input-name-validation3/main.js000066400000000000000000000000411415504077600251440ustar00rootroot00000000000000throw new Error('Not executed'); rollup-2.61.1/test/function/samples/inter-chunk-execution-order/000077500000000000000000000000001415504077600247405ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/inter-chunk-execution-order/_config.js000066400000000000000000000004771415504077600267120ustar00rootroot00000000000000const assert = require('assert'); const execution = { index: 0 }; module.exports = { 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-2.61.1/test/function/samples/inter-chunk-execution-order/chunk1.js000066400000000000000000000000441415504077600264650ustar00rootroot00000000000000assert.equal(++execution.index, 1); rollup-2.61.1/test/function/samples/inter-chunk-execution-order/chunk2.js000066400000000000000000000000441415504077600264660ustar00rootroot00000000000000assert.equal(++execution.index, 2); rollup-2.61.1/test/function/samples/inter-chunk-execution-order/dep.js000066400000000000000000000000731415504077600260460ustar00rootroot00000000000000import './chunk2.js'; assert.equal(++execution.index, 3); rollup-2.61.1/test/function/samples/inter-chunk-execution-order/main.js000066400000000000000000000001161415504077600262200ustar00rootroot00000000000000import './chunk1.js'; import './dep.js'; assert.equal(++execution.index, 4); rollup-2.61.1/test/function/samples/internal-reexports-from-external/000077500000000000000000000000001415504077600260255ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/internal-reexports-from-external/_config.js000066400000000000000000000015431415504077600277720ustar00rootroot00000000000000const assert = require('assert'); const fs = require('fs'); const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/internal-reexports-from-external/extra.js000066400000000000000000000000361415504077600275050ustar00rootroot00000000000000export const extra = 'extra'; rollup-2.61.1/test/function/samples/internal-reexports-from-external/main.js000066400000000000000000000001631415504077600273070ustar00rootroot00000000000000export * as fs from './reexport-external.js'; export * as fsOverride from './reexport-externals-with-override.js'; rollup-2.61.1/test/function/samples/internal-reexports-from-external/reexport-external.js000066400000000000000000000000241415504077600320470ustar00rootroot00000000000000export * from 'fs'; reexport-externals-with-override.js000066400000000000000000000002261415504077600347450ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/function/samples/interop-auto-live-bindings/000077500000000000000000000000001415504077600245555ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/interop-auto-live-bindings/_config.js000066400000000000000000000022051415504077600265160ustar00rootroot00000000000000let fooModule = 'foo'; let barModule = 'bar'; let barCjs = 'bar'; let fooDefault = 'foo'; let barDefault = 'bar'; module.exports = { 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-2.61.1/test/function/samples/interop-auto-live-bindings/main.js000066400000000000000000000032401415504077600260360ustar00rootroot00000000000000import 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-2.61.1/test/function/samples/interop-auto-no-live-bindings/000077500000000000000000000000001415504077600251675ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/interop-auto-no-live-bindings/_config.js000066400000000000000000000015621415504077600271350ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/interop-auto-no-live-bindings/main.js000066400000000000000000000017221415504077600264530ustar00rootroot00000000000000import 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-2.61.1/test/function/samples/interop-default-conflict/000077500000000000000000000000001415504077600243005ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/interop-default-conflict/_config.js000066400000000000000000000013651415504077600262470ustar00rootroot00000000000000const assert = require('assert'); let bar = 'initial bar'; let defaultValue = 'initial foo'; module.exports = { description: 'handles conflicts with added interop default variables and supports default live bindings', options: { external: 'external' }, 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-2.61.1/test/function/samples/interop-default-conflict/main.js000066400000000000000000000002151415504077600255600ustar00rootroot00000000000000import foo, { bar } from 'external'; const foo__default = 1; const external__default = 2; export {foo, foo__default, external__default, bar} rollup-2.61.1/test/function/samples/interop-default-only-named-import/000077500000000000000000000000001415504077600260525ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/interop-default-only-named-import/_config.js000066400000000000000000000010231415504077600300100ustar00rootroot00000000000000module.exports = { description: 'throws when using a named import with interop "defaultOnly"', options: { external: 'external', output: { interop: 'defaultOnly' } }, generateError: { code: 'UNEXPECTED_NAMED_IMPORT', id: 'external', 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.', url: 'https://rollupjs.org/guide/en/#outputinterop' } }; rollup-2.61.1/test/function/samples/interop-default-only-named-import/main.js000066400000000000000000000000471415504077600273350ustar00rootroot00000000000000import { foo } from 'external'; foo(); rollup-2.61.1/test/function/samples/interop-default-only-named-namespace-reexport/000077500000000000000000000000001415504077600303425ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/interop-default-only-named-namespace-reexport/_config.js000066400000000000000000000005301415504077600323020ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/interop-default-only-named-namespace-reexport/main.js000066400000000000000000000000411415504077600316170ustar00rootroot00000000000000export * as foo from 'external'; rollup-2.61.1/test/function/samples/interop-default-only-named-reexport/000077500000000000000000000000001415504077600264105ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/interop-default-only-named-reexport/_config.js000066400000000000000000000010321415504077600303460ustar00rootroot00000000000000module.exports = { description: 'throws when reexporting a namespace with interop "defaultOnly"', options: { external: 'external', output: { interop: 'defaultOnly' } }, generateError: { code: 'UNEXPECTED_NAMED_IMPORT', id: 'external', 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.', url: 'https://rollupjs.org/guide/en/#outputinterop' } }; rollup-2.61.1/test/function/samples/interop-default-only-named-reexport/main.js000066400000000000000000000000401415504077600276640ustar00rootroot00000000000000export { foo } from 'external'; rollup-2.61.1/test/function/samples/interop-default-only-namespace-import/000077500000000000000000000000001415504077600267225ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/interop-default-only-namespace-import/_config.js000066400000000000000000000002631415504077600306650ustar00rootroot00000000000000module.exports = { description: 'allows importing a namespace when interop is "defaultOnly"', options: { external: 'external', output: { interop: 'defaultOnly' } } }; rollup-2.61.1/test/function/samples/interop-default-only-namespace-import/main.js000066400000000000000000000001601415504077600302010ustar00rootroot00000000000000import * as foo from 'external'; assert.deepStrictEqual(foo, { __proto__: null, default: { external: true } }); rollup-2.61.1/test/function/samples/interop-default-only-namespace-reexport/000077500000000000000000000000001415504077600272605ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/interop-default-only-namespace-reexport/_config.js000066400000000000000000000012001415504077600312130ustar00rootroot00000000000000module.exports = { description: 'warns when reexporting a namespace with interop "defaultOnly"', options: { external: 'external', output: { interop: 'defaultOnly' } }, warnings: [ { code: 'UNEXPECTED_NAMED_IMPORT', id: '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/guide/en/#outputinterop' } ] }; rollup-2.61.1/test/function/samples/interop-default-only-namespace-reexport/main.js000066400000000000000000000000321415504077600305350ustar00rootroot00000000000000export * from 'external'; rollup-2.61.1/test/function/samples/interop-default-only/000077500000000000000000000000001415504077600234605ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/interop-default-only/_config.js000066400000000000000000000021701415504077600254220ustar00rootroot00000000000000let fooModule = 'foo'; let barModule = 'bar'; let barCjs = 'bar'; let fooDefault = 'foo'; let barDefault = 'bar'; module.exports = { 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-2.61.1/test/function/samples/interop-default-only/main.js000066400000000000000000000026271415504077600247510ustar00rootroot00000000000000import 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-2.61.1/test/function/samples/interop-default/000077500000000000000000000000001415504077600225015ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/interop-default/_config.js000066400000000000000000000022131415504077600244410ustar00rootroot00000000000000let fooModule = 'foo'; let barModule = 'bar'; let barCjs = 'bar'; let fooDefault = 'foo'; let barDefault = 'bar'; module.exports = { 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-2.61.1/test/function/samples/interop-default/main.js000066400000000000000000000035221415504077600237650ustar00rootroot00000000000000import 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-2.61.1/test/function/samples/interop-esmodule/000077500000000000000000000000001415504077600226725ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/interop-esmodule/_config.js000066400000000000000000000022531415504077600246360ustar00rootroot00000000000000let fooModule = 'foo'; let barModule = 'bar'; let barCjs = 'bar'; let fooDefault = 'foo'; let barDefault = 'bar'; module.exports = { 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-2.61.1/test/function/samples/interop-esmodule/main.js000066400000000000000000000025741415504077600241640ustar00rootroot00000000000000import 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-2.61.1/test/function/samples/invalid-default-export-mode/000077500000000000000000000000001415504077600247105ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/invalid-default-export-mode/_config.js000066400000000000000000000004721415504077600266550ustar00rootroot00000000000000module.exports = { 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, foo' } }; rollup-2.61.1/test/function/samples/invalid-default-export-mode/main.js000066400000000000000000000000521415504077600261670ustar00rootroot00000000000000export default 42; export const foo = 43; rollup-2.61.1/test/function/samples/invalid-interop/000077500000000000000000000000001415504077600225035ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/invalid-interop/_config.js000066400000000000000000000006031415504077600244440ustar00rootroot00000000000000module.exports = { 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 "auto", "esModule", "default", "defaultOnly", true, false.', url: 'https://rollupjs.org/guide/en/#outputinterop' } }; rollup-2.61.1/test/function/samples/invalid-interop/main.js000066400000000000000000000000441415504077600237630ustar00rootroot00000000000000export { default } from 'external'; rollup-2.61.1/test/function/samples/invalid-pattern-replacement/000077500000000000000000000000001415504077600247755ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/invalid-pattern-replacement/_config.js000066400000000000000000000004311415504077600267350ustar00rootroot00000000000000module.exports = { description: 'throws for invalid placeholders in patterns', options: { output: { entryFileNames: '[invalid].js' } }, generateError: { code: 'VALIDATION_ERROR', message: '"[invalid]" is not a valid placeholder in "output.entryFileNames" pattern.' } }; rollup-2.61.1/test/function/samples/invalid-pattern-replacement/main.js000066400000000000000000000000411415504077600262520ustar00rootroot00000000000000throw new Error('Not executed'); rollup-2.61.1/test/function/samples/invalid-pattern/000077500000000000000000000000001415504077600225005ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/invalid-pattern/_config.js000066400000000000000000000004561415504077600244470ustar00rootroot00000000000000module.exports = { 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.' } }; rollup-2.61.1/test/function/samples/invalid-pattern/main.js000066400000000000000000000000001415504077600237500ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/invalid-property-assignments/000077500000000000000000000000001415504077600252405ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/invalid-property-assignments/_config.js000066400000000000000000000003731415504077600272050ustar00rootroot00000000000000module.exports = { description: 'includes invalid property assignments', context: { globalOther: 'other' }, options: { treeshake: { propertyReadSideEffects: false, tryCatchDeoptimization: false, unknownGlobalSideEffects: false } } }; rollup-2.61.1/test/function/samples/invalid-property-assignments/main.js000066400000000000000000000012361415504077600265240ustar00rootroot00000000000000function 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-2.61.1/test/function/samples/invalid-property-calls/000077500000000000000000000000001415504077600240035ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/invalid-property-calls/_config.js000066400000000000000000000004131415504077600257430ustar00rootroot00000000000000module.exports = { description: 'includes invalid property calls', context: { globalFirst: 'first', globalOther: 'other' }, options: { treeshake: { propertyReadSideEffects: false, tryCatchDeoptimization: false, unknownGlobalSideEffects: false } } }; rollup-2.61.1/test/function/samples/invalid-property-calls/main.js000066400000000000000000000015161415504077600252700ustar00rootroot00000000000000function 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-2.61.1/test/function/samples/invalid-top-level-await/000077500000000000000000000000001415504077600240355ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/invalid-top-level-await/_config.js000066400000000000000000000003701415504077600257770ustar00rootroot00000000000000module.exports = { description: 'throws for invalid top-level-await format', generateError: { code: 'INVALID_TLA_FORMAT', message: 'Module format cjs does not support top-level await. Use the "es" or "system" output formats rather.' } }; rollup-2.61.1/test/function/samples/invalid-top-level-await/main.js000066400000000000000000000000311415504077600253110ustar00rootroot00000000000000await Promise.resolve(); rollup-2.61.1/test/function/samples/invalid-transform-source-function/000077500000000000000000000000001415504077600261575ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/invalid-transform-source-function/_config.js000066400000000000000000000006571415504077600301310ustar00rootroot00000000000000const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/invalid-transform-source-function/main.js000066400000000000000000000000231415504077600274340ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/keep-used-imports-from-pure-external-modules/000077500000000000000000000000001415504077600301545ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/keep-used-imports-from-pure-external-modules/_config.js000066400000000000000000000006041415504077600321160ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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 arg => assert.equal(arg, 'hi'); throw new Error('Unexpected import', id); } } }; rollup-2.61.1/test/function/samples/keep-used-imports-from-pure-external-modules/main.js000066400000000000000000000000571415504077600314400ustar00rootroot00000000000000import warning from 'warning'; warning('hi'); rollup-2.61.1/test/function/samples/labeled-statement-conditional-break/000077500000000000000000000000001415504077600263545ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/labeled-statement-conditional-break/_config.js000066400000000000000000000001411415504077600303120ustar00rootroot00000000000000module.exports = { description: 'handles conditional control flow due to labeled statements' }; rollup-2.61.1/test/function/samples/labeled-statement-conditional-break/main.js000066400000000000000000000002451415504077600276370ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/legal-import-modification/000077500000000000000000000000001415504077600244365ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/legal-import-modification/_config.js000066400000000000000000000001401415504077600263730ustar00rootroot00000000000000module.exports = { description: 'assigning to properties of imported bindings is permitted' }; rollup-2.61.1/test/function/samples/legal-import-modification/foo.js000066400000000000000000000000231415504077600255520ustar00rootroot00000000000000export default {}; rollup-2.61.1/test/function/samples/legal-import-modification/main.js000066400000000000000000000001041415504077600257130ustar00rootroot00000000000000import foo from './foo'; foo.modified = true; export default foo; rollup-2.61.1/test/function/samples/legal-suggested-names/000077500000000000000000000000001415504077600235545ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/legal-suggested-names/_config.js000066400000000000000000000001131415504077600255110ustar00rootroot00000000000000module.exports = { description: 'illegal name suggestions are ignored' }; rollup-2.61.1/test/function/samples/legal-suggested-names/bar.js000066400000000000000000000001551415504077600246570ustar00rootroot00000000000000import * as helpers from './helpers.js'; export default function bar ( a ) { return helpers.typeof( a ); } rollup-2.61.1/test/function/samples/legal-suggested-names/foo.js000066400000000000000000000001551415504077600246760ustar00rootroot00000000000000import * as helpers from './helpers.js'; export default function foo ( a ) { return helpers.typeof( a ); } rollup-2.61.1/test/function/samples/legal-suggested-names/helpers.js000066400000000000000000000001331415504077600255510ustar00rootroot00000000000000var _typeof = function ( thing ) { return typeof thing; }; export { _typeof as typeof }; rollup-2.61.1/test/function/samples/legal-suggested-names/main.js000066400000000000000000000004201415504077600250320ustar00rootroot00000000000000import * 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-2.61.1/test/function/samples/load-module-error/000077500000000000000000000000001415504077600227305ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/load-module-error/buildEnd/000077500000000000000000000000001415504077600244565ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/load-module-error/buildEnd/_config.js000066400000000000000000000004251415504077600264210ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/load-module-error/buildEnd/main.js000066400000000000000000000000261415504077600257360ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-2.61.1/test/function/samples/load-module-error/buildStart/000077500000000000000000000000001415504077600250455ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/load-module-error/buildStart/_config.js000066400000000000000000000004311415504077600270050ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/load-module-error/buildStart/main.js000066400000000000000000000000261415504077600263250ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-2.61.1/test/function/samples/load-module-error/generateBundle/000077500000000000000000000000001415504077600256545ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/load-module-error/generateBundle/_config.js000066400000000000000000000004511415504077600276160ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/load-module-error/generateBundle/main.js000066400000000000000000000000261415504077600271340ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-2.61.1/test/function/samples/load-module-error/load/000077500000000000000000000000001415504077600236475ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/load-module-error/load/_config.js000066400000000000000000000010401415504077600256040ustar00rootroot00000000000000const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/load-module-error/load/main.js000066400000000000000000000000211415504077600251220ustar00rootroot00000000000000import 'broken'; rollup-2.61.1/test/function/samples/load-module-error/renderChunk/000077500000000000000000000000001415504077600252005ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/load-module-error/renderChunk/_config.js000066400000000000000000000004431415504077600271430ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/load-module-error/renderChunk/main.js000066400000000000000000000000261415504077600264600ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-2.61.1/test/function/samples/load-module-error/renderStart/000077500000000000000000000000001415504077600252255ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/load-module-error/renderStart/_config.js000066400000000000000000000004431415504077600271700ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/load-module-error/renderStart/main.js000066400000000000000000000000261415504077600265050ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-2.61.1/test/function/samples/load-module-error/resolveId/000077500000000000000000000000001415504077600246645ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/load-module-error/resolveId/_config.js000066400000000000000000000004271415504077600266310ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/load-module-error/resolveId/main.js000066400000000000000000000000261415504077600261440ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-2.61.1/test/function/samples/load-module-error/transform/000077500000000000000000000000001415504077600247435ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/load-module-error/transform/_config.js000066400000000000000000000011341415504077600267040ustar00rootroot00000000000000const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/load-module-error/transform/main.js000066400000000000000000000000341415504077600262220ustar00rootroot00000000000000assert.equal( 21 * 2, TK ); rollup-2.61.1/test/function/samples/load-returns-empty-string/000077500000000000000000000000001415504077600244565ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/load-returns-empty-string/_config.js000066400000000000000000000004721415504077600264230ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/load-returns-empty-string/bar.js000066400000000000000000000000521415504077600255550ustar00rootroot00000000000000throw new Error('should not be reached'); rollup-2.61.1/test/function/samples/load-returns-empty-string/foo.js000066400000000000000000000000521415504077600255740ustar00rootroot00000000000000throw new Error('should not be reached'); rollup-2.61.1/test/function/samples/load-returns-empty-string/main.js000066400000000000000000000000651415504077600257410ustar00rootroot00000000000000import './foo.js'; import './bar.js'; assert(true); rollup-2.61.1/test/function/samples/load-returns-string-or-null/000077500000000000000000000000001415504077600247105ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/load-returns-string-or-null/_config.js000066400000000000000000000006421415504077600266540ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'throws error if load returns something wacky', options: { plugins: [ { name: 'bad-plugin', load() { return 42; } } ] }, error: { code: 'BAD_LOADER', message: `Error loading main.js: plugin load hook should return a string, a { code, map } object, or nothing/null`, watchFiles: [path.join(__dirname, 'main.js')] } }; rollup-2.61.1/test/function/samples/load-returns-string-or-null/main.js000066400000000000000000000000521415504077600261670ustar00rootroot00000000000000throw new Error('should not be reached'); rollup-2.61.1/test/function/samples/manual-chunks-conflict/000077500000000000000000000000001415504077600237445ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/manual-chunks-conflict/_config.js000066400000000000000000000005251415504077600257100ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/manual-chunks-conflict/dep.js000066400000000000000000000000241415504077600250460ustar00rootroot00000000000000console.log('dep'); rollup-2.61.1/test/function/samples/manual-chunks-conflict/main.js000066400000000000000000000000231415504077600252210ustar00rootroot00000000000000import './dep.js'; rollup-2.61.1/test/function/samples/manual-chunks-info/000077500000000000000000000000001415504077600230765ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/manual-chunks-info/_config.js000066400000000000000000000145321415504077600250450ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); function getId(name) { return path.join(__dirname, `${name}.js`); } module.exports = { description: 'provides additional chunk information to a manualChunks function', options: { external: 'external', output: { manualChunks(id, { getModuleIds, getModuleInfo }) { assert.deepStrictEqual( [...getModuleIds()], [getId('main'), 'external', getId('lib'), getId('dynamic')] ); assert.deepStrictEqual( JSON.parse(JSON.stringify([...getModuleIds()].map(id => getModuleInfo(id)))), [ { 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", dynamicallyImportedIds: [getId('dynamic')], dynamicImporters: [], hasModuleSideEffects: true, id: getId('main'), implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIds: [getId('lib'), 'external'], importers: [], isEntry: true, isExternal: false, meta: {}, syntheticNamedExports: false }, { ast: null, code: null, dynamicallyImportedIds: [], dynamicImporters: [getId('dynamic')], hasModuleSideEffects: true, id: 'external', implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIds: [], importers: [getId('main')], isEntry: false, isExternal: true, meta: {}, syntheticNamedExports: false }, { 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', dynamicallyImportedIds: [], dynamicImporters: [], hasModuleSideEffects: true, id: getId('lib'), implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIds: [], importers: [getId('dynamic'), getId('main')], isEntry: false, isExternal: false, meta: {}, syntheticNamedExports: false }, { 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", dynamicallyImportedIds: ['external'], dynamicImporters: [getId('main')], hasModuleSideEffects: true, id: getId('dynamic'), implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIds: [getId('lib')], importers: [], isEntry: false, isExternal: false, meta: {}, syntheticNamedExports: false } ] ); } } } }; rollup-2.61.1/test/function/samples/manual-chunks-info/dynamic.js000066400000000000000000000001301415504077600250520ustar00rootroot00000000000000export const promise = import('external'); export { default as internal } from './lib'; rollup-2.61.1/test/function/samples/manual-chunks-info/lib.js000066400000000000000000000000231415504077600241750ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/manual-chunks-info/main.js000066400000000000000000000001731415504077600243610ustar00rootroot00000000000000export const promise = import('./dynamic'); export { default as value } from './lib'; export { external } from 'external'; rollup-2.61.1/test/function/samples/mark-namespace-members/000077500000000000000000000000001415504077600237135ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/mark-namespace-members/_config.js000066400000000000000000000000761415504077600256600ustar00rootroot00000000000000module.exports = { description: 'marks namespace members' }; rollup-2.61.1/test/function/samples/mark-namespace-members/bar.js000066400000000000000000000000651415504077600250160ustar00rootroot00000000000000function bar () { return 42; } export default bar; rollup-2.61.1/test/function/samples/mark-namespace-members/foo.js000066400000000000000000000000501415504077600250270ustar00rootroot00000000000000export { default as bar } from './bar'; rollup-2.61.1/test/function/samples/mark-namespace-members/main.js000066400000000000000000000001301415504077600251670ustar00rootroot00000000000000import * as foo from './foo'; var member = 'bar'; assert.equal( foo[ member ](), 42 ); rollup-2.61.1/test/function/samples/max-parallel-file-reads-default/000077500000000000000000000000001415504077600254115ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/max-parallel-file-reads-default/1.js000066400000000000000000000000251415504077600261040ustar00rootroot00000000000000export const x1 = 1; rollup-2.61.1/test/function/samples/max-parallel-file-reads-default/2.js000066400000000000000000000000251415504077600261050ustar00rootroot00000000000000export const x2 = 2; rollup-2.61.1/test/function/samples/max-parallel-file-reads-default/3.js000066400000000000000000000000251415504077600261060ustar00rootroot00000000000000export const x3 = 3; rollup-2.61.1/test/function/samples/max-parallel-file-reads-default/4.js000066400000000000000000000000251415504077600261070ustar00rootroot00000000000000export const x4 = 4; rollup-2.61.1/test/function/samples/max-parallel-file-reads-default/5.js000066400000000000000000000000251415504077600261100ustar00rootroot00000000000000export const x5 = 5; rollup-2.61.1/test/function/samples/max-parallel-file-reads-default/_config.js000066400000000000000000000010641415504077600273540ustar00rootroot00000000000000const assert = require('assert'); const fs = require('fs'); const fsReadFile = fs.readFile; let currentReads = 0; let maxReads = 0; module.exports = { description: 'maxParallelFileReads not set', before() { fs.readFile = (path, options, callback) => { currentReads++; maxReads = Math.max(maxReads, currentReads); fsReadFile(path, options, (err, data) => { currentReads--; callback(err, data); }); }; }, after() { fs.readFile = fsReadFile; assert.strictEqual(maxReads, 5, 'Wrong number of parallel file reads: ' + maxReads); } }; rollup-2.61.1/test/function/samples/max-parallel-file-reads-default/main.js000066400000000000000000000001511415504077600266700ustar00rootroot00000000000000export * from './1'; export * from './2'; export * from './3'; export * from './4'; export * from './5'; rollup-2.61.1/test/function/samples/max-parallel-file-reads-error/000077500000000000000000000000001415504077600251165ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/max-parallel-file-reads-error/_config.js000066400000000000000000000013131415504077600270560ustar00rootroot00000000000000const fs = require('fs'); const path = require('path'); const { loader } = require('../../../utils.js'); const fsReadFile = fs.readFile; module.exports = { description: 'maxParallelFileReads: fileRead error is forwarded', options: { input: 'main', plugins: loader({ main: `import {foo} from './dep';` }) }, before() { fs.readFile = (path, options, callback) => { if (path.endsWith('dep.js')) { return callback(new Error('broken')); } fsReadFile(path, options, callback); }; }, after() { fs.readFile = fsReadFile; }, error: { message: `Could not load ${path.join(__dirname, 'dep.js')} (imported by main): broken`, watchFiles: ['main', path.join(__dirname, 'dep.js')] } }; rollup-2.61.1/test/function/samples/max-parallel-file-reads-error/dep.js000066400000000000000000000000001415504077600262120ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/max-parallel-file-reads-infinity/000077500000000000000000000000001415504077600256165ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/max-parallel-file-reads-infinity/1.js000066400000000000000000000000251415504077600263110ustar00rootroot00000000000000export const x1 = 1; rollup-2.61.1/test/function/samples/max-parallel-file-reads-infinity/2.js000066400000000000000000000000251415504077600263120ustar00rootroot00000000000000export const x2 = 2; rollup-2.61.1/test/function/samples/max-parallel-file-reads-infinity/3.js000066400000000000000000000000251415504077600263130ustar00rootroot00000000000000export const x3 = 3; rollup-2.61.1/test/function/samples/max-parallel-file-reads-infinity/4.js000066400000000000000000000000251415504077600263140ustar00rootroot00000000000000export const x4 = 4; rollup-2.61.1/test/function/samples/max-parallel-file-reads-infinity/5.js000066400000000000000000000000251415504077600263150ustar00rootroot00000000000000export const x5 = 5; rollup-2.61.1/test/function/samples/max-parallel-file-reads-infinity/_config.js000066400000000000000000000011461415504077600275620ustar00rootroot00000000000000const assert = require('assert'); const fs = require('fs'); const fsReadFile = fs.readFile; let currentReads = 0; let maxReads = 0; module.exports = { description: 'maxParallelFileReads set to infinity', options: { maxParallelFileReads: 0 }, before() { fs.readFile = (path, options, callback) => { currentReads++; maxReads = Math.max(maxReads, currentReads); fsReadFile(path, options, (err, data) => { currentReads--; callback(err, data); }); }; }, after() { fs.readFile = fsReadFile; assert.strictEqual(maxReads, 5, 'Wrong number of parallel file reads: ' + maxReads); } }; rollup-2.61.1/test/function/samples/max-parallel-file-reads-infinity/main.js000066400000000000000000000001511415504077600270750ustar00rootroot00000000000000export * from './1'; export * from './2'; export * from './3'; export * from './4'; export * from './5'; rollup-2.61.1/test/function/samples/max-parallel-file-reads-set/000077500000000000000000000000001415504077600245605ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/max-parallel-file-reads-set/1.js000066400000000000000000000000251415504077600252530ustar00rootroot00000000000000export const x1 = 1; rollup-2.61.1/test/function/samples/max-parallel-file-reads-set/2.js000066400000000000000000000000251415504077600252540ustar00rootroot00000000000000export const x2 = 2; rollup-2.61.1/test/function/samples/max-parallel-file-reads-set/3.js000066400000000000000000000000251415504077600252550ustar00rootroot00000000000000export const x3 = 3; rollup-2.61.1/test/function/samples/max-parallel-file-reads-set/4.js000066400000000000000000000000251415504077600252560ustar00rootroot00000000000000export const x4 = 4; rollup-2.61.1/test/function/samples/max-parallel-file-reads-set/5.js000066400000000000000000000000251415504077600252570ustar00rootroot00000000000000export const x5 = 5; rollup-2.61.1/test/function/samples/max-parallel-file-reads-set/_config.js000066400000000000000000000011371415504077600265240ustar00rootroot00000000000000const assert = require('assert'); const fs = require('fs'); const fsReadFile = fs.readFile; let currentReads = 0; let maxReads = 0; module.exports = { description: 'maxParallelFileReads set to 3', options: { maxParallelFileReads: 3 }, before() { fs.readFile = (path, options, callback) => { currentReads++; maxReads = Math.max(maxReads, currentReads); fsReadFile(path, options, (err, data) => { currentReads--; callback(err, data); }); }; }, after() { fs.readFile = fsReadFile; assert.strictEqual(maxReads, 3, 'Wrong number of parallel file reads: ' + maxReads); } }; rollup-2.61.1/test/function/samples/max-parallel-file-reads-set/main.js000066400000000000000000000001511415504077600260370ustar00rootroot00000000000000export * from './1'; export * from './2'; export * from './3'; export * from './4'; export * from './5'; rollup-2.61.1/test/function/samples/max-parallel-file-reads-with-plugin/000077500000000000000000000000001415504077600262345ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/max-parallel-file-reads-with-plugin/1.js000066400000000000000000000000251415504077600267270ustar00rootroot00000000000000export const x1 = 1; rollup-2.61.1/test/function/samples/max-parallel-file-reads-with-plugin/2.js000066400000000000000000000000251415504077600267300ustar00rootroot00000000000000export const x2 = 2; rollup-2.61.1/test/function/samples/max-parallel-file-reads-with-plugin/3.js000066400000000000000000000000251415504077600267310ustar00rootroot00000000000000export const x3 = 3; rollup-2.61.1/test/function/samples/max-parallel-file-reads-with-plugin/4.js000066400000000000000000000000251415504077600267320ustar00rootroot00000000000000export const x4 = 4; rollup-2.61.1/test/function/samples/max-parallel-file-reads-with-plugin/5.js000066400000000000000000000000251415504077600267330ustar00rootroot00000000000000export const x5 = 5; rollup-2.61.1/test/function/samples/max-parallel-file-reads-with-plugin/_config.js000066400000000000000000000014471415504077600302040ustar00rootroot00000000000000const assert = require('assert'); const fs = require('fs'); const fsReadFile = fs.readFile; let currentReads = 0; let maxReads = 0; module.exports = { description: 'maxParallelFileReads with plugin', options: { maxParallelFileReads: 3, plugins: [ { async load(id) { return new Promise((fulfil, reject) => fs.readFile(id, 'utf-8', (err, contents) => (err ? reject(err) : fulfil(contents))) ); } } ] }, before() { fs.readFile = (path, options, callback) => { currentReads++; maxReads = Math.max(maxReads, currentReads); fsReadFile(path, options, (err, data) => { currentReads--; callback(err, data); }); }; }, after() { fs.readFile = fsReadFile; assert.strictEqual(maxReads, 3, 'Wrong number of parallel file reads: ' + maxReads); } }; rollup-2.61.1/test/function/samples/max-parallel-file-reads-with-plugin/main.js000066400000000000000000000001511415504077600275130ustar00rootroot00000000000000export * from './1'; export * from './2'; export * from './3'; export * from './4'; export * from './5'; rollup-2.61.1/test/function/samples/member-expression-assignment-in-function/000077500000000000000000000000001415504077600274405ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/member-expression-assignment-in-function/_config.js000066400000000000000000000006041415504077600314020ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'detect side effect in member expression assignment when not top level', code(code) { assert.equal(code.indexOf('function set(key, value) { foo[key] = value; }') >= 0, true, code); assert.equal(code.indexOf('set("bar", 2);') >= 0, true, code); assert.equal(code.indexOf('set("qux", 3);') >= 0, true, code); } }; rollup-2.61.1/test/function/samples/member-expression-assignment-in-function/main.js000066400000000000000000000002171415504077600307220ustar00rootroot00000000000000var foo = {}; function set(key, value) { foo[key] = value; } set("bar", 2); set("qux", 3); assert.deepStrictEqual(foo, { bar: 2, qux: 3 }); rollup-2.61.1/test/function/samples/merged-namespace-live-bindings/000077500000000000000000000000001415504077600253245ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/merged-namespace-live-bindings/_config.js000066400000000000000000000006431415504077600272710ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/merged-namespace-live-bindings/internal.js000066400000000000000000000001701415504077600274740ustar00rootroot00000000000000export let internal = 'original'; export const updateInternal = () => (internal = 'updated'); export default 'ignored'; rollup-2.61.1/test/function/samples/merged-namespace-live-bindings/main.js000066400000000000000000000005541415504077600266120ustar00rootroot00000000000000import * 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-2.61.1/test/function/samples/merged-namespace-live-bindings/reexport.js000066400000000000000000000000661415504077600275340ustar00rootroot00000000000000export * from './internal'; export * from 'external'; rollup-2.61.1/test/function/samples/method-call-mutates-this/000077500000000000000000000000001415504077600242155ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/method-call-mutates-this/_config.js000066400000000000000000000001231415504077600261530ustar00rootroot00000000000000module.exports = { description: 'method calls are assumed to mutate the owner' }; rollup-2.61.1/test/function/samples/method-call-mutates-this/foo.js000066400000000000000000000003241415504077600253350ustar00rootroot00000000000000var 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-2.61.1/test/function/samples/method-call-mutates-this/main.js000066400000000000000000000000771415504077600255030ustar00rootroot00000000000000import foo from './foo'; assert.equal( foo( 'answer' ), 42 ); rollup-2.61.1/test/function/samples/method-call-side-effects/000077500000000000000000000000001415504077600241275ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/method-call-side-effects/_config.js000066400000000000000000000001351415504077600260700ustar00rootroot00000000000000module.exports = { description: 'assumes methods may mutate objects passed in, and self' }; rollup-2.61.1/test/function/samples/method-call-side-effects/main.js000066400000000000000000000001761415504077600254150ustar00rootroot00000000000000import object from './object'; import thing from './thing'; assert.ok( object.mutated ); assert.ok( thing.methodWasCalled ); rollup-2.61.1/test/function/samples/method-call-side-effects/object.js000066400000000000000000000001361415504077600257330ustar00rootroot00000000000000import thing from './thing'; var object = {}; thing.mutate( object ); export default object;rollup-2.61.1/test/function/samples/method-call-side-effects/thing.js000066400000000000000000000002071415504077600255750ustar00rootroot00000000000000export default { mutate: function ( object ) { object.mutated = true; this.methodWasCalled = true; }, methodWasCalled: false };rollup-2.61.1/test/function/samples/missing-spaces-after-simplification/000077500000000000000000000000001415504077600264335ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/missing-spaces-after-simplification/_config.js000066400000000000000000000003161415504077600303750ustar00rootroot00000000000000module.exports = { description: 'handle situations where the simplification of an expression can lead to issues due to missing white-space', options: { treeshake: { tryCatchDeoptimization: false } } }; rollup-2.61.1/test/function/samples/missing-spaces-after-simplification/main.js000066400000000000000000000006661415504077600277250ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/mixed-external-paths/000077500000000000000000000000001415504077600234425ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/mixed-external-paths/_config.js000066400000000000000000000005671415504077600254140ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/mixed-external-paths/main.js000066400000000000000000000001401415504077600247170ustar00rootroot00000000000000import a from 'dep-a'; import b from 'dep-b'; assert.equal(a, 'secret'); assert.equal(b, 'b'); rollup-2.61.1/test/function/samples/modify-assumed-global/000077500000000000000000000000001415504077600235635ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/modify-assumed-global/_config.js000066400000000000000000000003651415504077600255310ustar00rootroot00000000000000const assert = require('assert'); const Math = {}; module.exports = { description: 'side-effects to assumed globals are included', context: { Math }, exports() { assert.equal(Math.square(3), 9); assert.equal(Math.cube(3), 27); } }; rollup-2.61.1/test/function/samples/modify-assumed-global/main.js000066400000000000000000000001021415504077600250360ustar00rootroot00000000000000import { square } from './math'; assert.equal( square( 2 ), 4 ); rollup-2.61.1/test/function/samples/modify-assumed-global/math.js000066400000000000000000000002441415504077600250520ustar00rootroot00000000000000function square ( x ) { return x * x; } function cube ( x ) { return x * x * x; } Math.square = square; if ( true ) { Math.cube = cube; } export { square }; rollup-2.61.1/test/function/samples/modify-object-via-this-a/000077500000000000000000000000001415504077600240725ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/modify-object-via-this-a/_config.js000066400000000000000000000001141415504077600260300ustar00rootroot00000000000000module.exports = { description: 'tracks object modification via "this"' }; rollup-2.61.1/test/function/samples/modify-object-via-this-a/main.js000066400000000000000000000002161415504077600253530ustar00rootroot00000000000000const obj = { modify() { this.modified = true; } }; obj.modify(); assert.strictEqual(obj.modified ? 'MODIFIED' : 'BROKEN', 'MODIFIED'); rollup-2.61.1/test/function/samples/modify-object-via-this-b/000077500000000000000000000000001415504077600240735ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/modify-object-via-this-b/_config.js000066400000000000000000000001141415504077600260310ustar00rootroot00000000000000module.exports = { description: 'tracks object modification via "this"' }; rollup-2.61.1/test/function/samples/modify-object-via-this-b/main.js000066400000000000000000000002301415504077600253500ustar00rootroot00000000000000const obj = {}; function modify() { this.modified = true; } modify.call(obj); assert.strictEqual(obj.modified ? 'MODIFIED' : 'BROKEN', 'MODIFIED'); rollup-2.61.1/test/function/samples/modify-object-via-this-c/000077500000000000000000000000001415504077600240745ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/modify-object-via-this-c/_config.js000066400000000000000000000001141415504077600260320ustar00rootroot00000000000000module.exports = { description: 'tracks object modification via "this"' }; rollup-2.61.1/test/function/samples/modify-object-via-this-c/main.js000066400000000000000000000002521415504077600253550ustar00rootroot00000000000000const obj = {}; obj.modify = modify; function modify() { this.modified = true; } obj.modify(); assert.strictEqual(obj.modified ? 'MODIFIED' : 'BROKEN', 'MODIFIED'); rollup-2.61.1/test/function/samples/modify-object-via-this-d/000077500000000000000000000000001415504077600240755ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/modify-object-via-this-d/_config.js000066400000000000000000000001141415504077600260330ustar00rootroot00000000000000module.exports = { description: 'tracks object modification via "this"' }; rollup-2.61.1/test/function/samples/modify-object-via-this-d/main.js000066400000000000000000000002701415504077600253560ustar00rootroot00000000000000const obj = { modify() {} }; obj.modify = modify; function modify() { this.modified = true; } obj.modify(); assert.strictEqual(obj.modified ? 'MODIFIED' : 'BROKEN', 'MODIFIED'); rollup-2.61.1/test/function/samples/modify-this-via-getter/000077500000000000000000000000001415504077600237005ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/modify-this-via-getter/deoptimized-props-with-getter/000077500000000000000000000000001415504077600316175ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/modify-this-via-getter/deoptimized-props-with-getter/_config.js000066400000000000000000000002641415504077600335630ustar00rootroot00000000000000module.exports = { description: 'handles fully deoptimized objects', context: { require(id) { return { unknown: 'prop' }; } }, options: { external: ['external'] } }; rollup-2.61.1/test/function/samples/modify-this-via-getter/deoptimized-props-with-getter/main.js000066400000000000000000000003301415504077600330750ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/modify-this-via-getter/getter-in-assignment/000077500000000000000000000000001415504077600277445ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/modify-this-via-getter/getter-in-assignment/_config.js000066400000000000000000000001411415504077600317020ustar00rootroot00000000000000module.exports = { description: 'handles known getters that are triggered via an assignment' }; rollup-2.61.1/test/function/samples/modify-this-via-getter/getter-in-assignment/main.js000066400000000000000000000002601415504077600312240ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/modify-this-via-getter/getters-on-this/000077500000000000000000000000001415504077600267345ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/modify-this-via-getter/getters-on-this/_config.js000066400000000000000000000001101415504077600306660ustar00rootroot00000000000000module.exports = { description: 'handles calling getters on "this"' }; rollup-2.61.1/test/function/samples/modify-this-via-getter/getters-on-this/main.js000066400000000000000000000010631415504077600302160ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/modify-this-via-getter/known-getter/000077500000000000000000000000001415504077600263245ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/modify-this-via-getter/known-getter/_config.js000066400000000000000000000001171415504077600302650ustar00rootroot00000000000000module.exports = { description: 'handles known getters that modify "this"' }; rollup-2.61.1/test/function/samples/modify-this-via-getter/known-getter/main.js000066400000000000000000000002161415504077600276050ustar00rootroot00000000000000const obj = { flag: false, get prop() { this.flag = true; } }; obj.prop; if (!obj.flag) { throw new Error('mutation not detected'); } rollup-2.61.1/test/function/samples/modify-this-via-getter/known-super-prop/000077500000000000000000000000001415504077600271465ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/modify-this-via-getter/known-super-prop/_config.js000066400000000000000000000002011415504077600311010ustar00rootroot00000000000000module.exports = { description: 'handles getters that modify "this" on prototypes for known properties', minNodeVersion: 12 }; rollup-2.61.1/test/function/samples/modify-this-via-getter/known-super-prop/main.js000066400000000000000000000002701415504077600304270ustar00rootroot00000000000000class 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-2.61.1/test/function/samples/modify-this-via-getter/unknown-prop-getter/000077500000000000000000000000001415504077600276455ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/modify-this-via-getter/unknown-prop-getter/_config.js000066400000000000000000000002731415504077600316110ustar00rootroot00000000000000module.exports = { description: 'handles unknown getters that modify "this"', context: { require() { return { unknown: 'prop' }; } }, options: { external: ['external'] } }; rollup-2.61.1/test/function/samples/modify-this-via-getter/unknown-prop-getter/main.js000066400000000000000000000002701415504077600311260ustar00rootroot00000000000000import { unknown } from 'external'; const obj = { get [unknown]() { this.flag = true; }, flag: false }; obj.prop; if (!obj.flag) { throw new Error('mutation not detected'); } rollup-2.61.1/test/function/samples/modify-this-via-getter/unknown-prop-unknown-access/000077500000000000000000000000001415504077600313115ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/modify-this-via-getter/unknown-prop-unknown-access/_config.js000066400000000000000000000003311415504077600332500ustar00rootroot00000000000000module.exports = { description: 'handles unknown getters that modify "this" for unknown property access', context: { require(id) { return { unknown: 'prop' }; } }, options: { external: ['external'] } }; rollup-2.61.1/test/function/samples/modify-this-via-getter/unknown-prop-unknown-access/main.js000066400000000000000000000002741415504077600325760ustar00rootroot00000000000000import { unknown } from 'external'; const obj = { get [unknown]() { this.flag = true; }, flag: false }; obj[unknown]; if (!obj.flag) { throw new Error('mutation not detected'); } rollup-2.61.1/test/function/samples/modify-this-via-getter/unknown-property-access/000077500000000000000000000000001415504077600305205ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/modify-this-via-getter/unknown-property-access/_config.js000066400000000000000000000003211415504077600324560ustar00rootroot00000000000000module.exports = { description: 'handles getters that modify "this" for unknown property access', context: { require(id) { return { unknown: 'prop' }; } }, options: { external: ['external'] } }; rollup-2.61.1/test/function/samples/modify-this-via-getter/unknown-property-access/main.js000066400000000000000000000002671415504077600320070ustar00rootroot00000000000000import { unknown } from 'external'; const obj = { flag: false, get prop() { this.flag = true; } }; obj[unknown]; if (!obj.flag) { throw new Error('mutation not detected'); } rollup-2.61.1/test/function/samples/modify-this-via-getter/unknown-super-prop/000077500000000000000000000000001415504077600275115ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/modify-this-via-getter/unknown-super-prop/_config.js000066400000000000000000000003571415504077600314600ustar00rootroot00000000000000module.exports = { description: 'handles getters that modify "this" on prototypes for unknown properties', minNodeVersion: 12, context: { require(id) { return { unknown: 'prop' }; } }, options: { external: ['external'] } }; rollup-2.61.1/test/function/samples/modify-this-via-getter/unknown-super-prop/main.js000066400000000000000000000003411415504077600307710ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/modify-this-via-setter/000077500000000000000000000000001415504077600237145ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/modify-this-via-setter/deoptimized-props-with-setter/000077500000000000000000000000001415504077600316475ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/modify-this-via-setter/deoptimized-props-with-setter/_config.js000066400000000000000000000002641415504077600336130ustar00rootroot00000000000000module.exports = { description: 'handles fully deoptimized objects', context: { require(id) { return { unknown: 'prop' }; } }, options: { external: ['external'] } }; rollup-2.61.1/test/function/samples/modify-this-via-setter/deoptimized-props-with-setter/main.js000066400000000000000000000003451415504077600331330ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/modify-this-via-setter/known-setter/000077500000000000000000000000001415504077600263545ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/modify-this-via-setter/known-setter/_config.js000066400000000000000000000001171415504077600303150ustar00rootroot00000000000000module.exports = { description: 'handles known setters that modify "this"' }; rollup-2.61.1/test/function/samples/modify-this-via-setter/known-setter/main.js000066400000000000000000000002331415504077600276340ustar00rootroot00000000000000const obj = { flag: false, set prop(value) { this.flag = value; } }; obj.prop = true; if (!obj.flag) { throw new Error('mutation not detected'); } rollup-2.61.1/test/function/samples/modify-this-via-setter/known-super-prop/000077500000000000000000000000001415504077600271625ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/modify-this-via-setter/known-super-prop/_config.js000066400000000000000000000002011415504077600311150ustar00rootroot00000000000000module.exports = { description: 'handles setters that modify "this" on prototypes for known properties', minNodeVersion: 12 }; rollup-2.61.1/test/function/samples/modify-this-via-setter/known-super-prop/main.js000066400000000000000000000003051415504077600304420ustar00rootroot00000000000000class 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-2.61.1/test/function/samples/modify-this-via-setter/unknown-prop-setter/000077500000000000000000000000001415504077600276755ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/modify-this-via-setter/unknown-prop-setter/_config.js000066400000000000000000000002751415504077600316430ustar00rootroot00000000000000module.exports = { description: 'handles unknown setters that modify "this"', context: { require(id) { return { unknown: 'prop' }; } }, options: { external: ['external'] } }; rollup-2.61.1/test/function/samples/modify-this-via-setter/unknown-prop-setter/main.js000066400000000000000000000003051415504077600311550ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/modify-this-via-setter/unknown-prop-unknown-access/000077500000000000000000000000001415504077600313255ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/modify-this-via-setter/unknown-prop-unknown-access/_config.js000066400000000000000000000003311415504077600332640ustar00rootroot00000000000000module.exports = { description: 'handles unknown setters that modify "this" for unknown property access', context: { require(id) { return { unknown: 'prop' }; } }, options: { external: ['external'] } }; rollup-2.61.1/test/function/samples/modify-this-via-setter/unknown-prop-unknown-access/main.js000066400000000000000000000003111415504077600326020ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/modify-this-via-setter/unknown-super-prop/000077500000000000000000000000001415504077600275255ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/modify-this-via-setter/unknown-super-prop/_config.js000066400000000000000000000003571415504077600314740ustar00rootroot00000000000000module.exports = { description: 'handles setters that modify "this" on prototypes for unknown properties', minNodeVersion: 12, context: { require(id) { return { unknown: 'prop' }; } }, options: { external: ['external'] } }; rollup-2.61.1/test/function/samples/modify-this-via-setter/unknown-super-prop/main.js000066400000000000000000000003561415504077600310130ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/module-level-directive/000077500000000000000000000000001415504077600237455ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/module-level-directive/_config.js000066400000000000000000000007251415504077600257130ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'module level directives should produce warnings', warnings: [ { code: 'MODULE_LEVEL_DIRECTIVE', message: "Module level directives cause errors when bundled, 'use asm' was ignored.", pos: 0, id: path.join(__dirname, 'main.js'), loc: { file: path.join(__dirname, 'main.js'), line: 1, column: 0 }, frame: ` 1: "use asm";\n ^\n2:\n3: export default 1; ` } ] }; rollup-2.61.1/test/function/samples/module-level-directive/main.js000066400000000000000000000000351415504077600252250ustar00rootroot00000000000000"use asm"; export default 1;rollup-2.61.1/test/function/samples/module-parsed-hook/000077500000000000000000000000001415504077600230765ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/module-parsed-hook/_config.js000066400000000000000000000052401415504077600250410ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const parsedModules = []; const ID_MAIN = path.join(__dirname, 'main.js'); const ID_DEP = path.join(__dirname, 'dep.js'); module.exports = { 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)), [ { 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", dynamicallyImportedIds: [], dynamicImporters: [], hasModuleSideEffects: true, id: ID_MAIN, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIds: [ID_DEP], importers: [], isEntry: true, isExternal: false, meta: {}, syntheticNamedExports: false }, { 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', dynamicallyImportedIds: [], dynamicImporters: [], hasModuleSideEffects: true, id: ID_DEP, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIds: [], importers: [ID_MAIN], isEntry: false, isExternal: false, meta: {}, syntheticNamedExports: false } ]); } } } }; rollup-2.61.1/test/function/samples/module-parsed-hook/dep.js000066400000000000000000000000311415504077600241760ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/function/samples/module-parsed-hook/main.js000066400000000000000000000000421415504077600243540ustar00rootroot00000000000000export { value } from './dep.js'; rollup-2.61.1/test/function/samples/module-parsed-imported-ids/000077500000000000000000000000001415504077600245365ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/module-parsed-imported-ids/_config.js000066400000000000000000000020221415504077600264740ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/module-parsed-imported-ids/dynamic.js000066400000000000000000000000361415504077600265170ustar00rootroot00000000000000export const bar = 'dynamic'; rollup-2.61.1/test/function/samples/module-parsed-imported-ids/main.js000066400000000000000000000001311415504077600260130ustar00rootroot00000000000000import { foo } from './static.js'; export const result = [foo, import('./dynamic.js')]; rollup-2.61.1/test/function/samples/module-parsed-imported-ids/static.js000066400000000000000000000000351415504077600263610ustar00rootroot00000000000000export const foo = 'static'; rollup-2.61.1/test/function/samples/module-side-effects/000077500000000000000000000000001415504077600232235ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/module-side-effects/array/000077500000000000000000000000001415504077600243415ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/module-side-effects/array/_config.js000066400000000000000000000024621415504077600263070ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const sideEffects = []; module.exports = { 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-2.61.1/test/function/samples/module-side-effects/array/main.js000066400000000000000000000005101415504077600256170ustar00rootroot00000000000000import '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-2.61.1/test/function/samples/module-side-effects/external-false/000077500000000000000000000000001415504077600261355ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/module-side-effects/external-false/_config.js000066400000000000000000000024651415504077600301060ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const sideEffects = []; module.exports = { 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', importer: 'main.js', message: "'implicit-external' is imported by main.js, but could not be resolved – treating it as an external dependency", source: 'implicit-external', url: 'https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency' } ] }; rollup-2.61.1/test/function/samples/module-side-effects/external-false/main.js000066400000000000000000000001621415504077600274160ustar00rootroot00000000000000import 'pluginsideeffects-false'; import 'pluginsideeffects-true'; import 'internal'; import 'implicit-external'; rollup-2.61.1/test/function/samples/module-side-effects/global-false/000077500000000000000000000000001415504077600255535ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/module-side-effects/global-false/_config.js000066400000000000000000000015211415504077600275140ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const sideEffects = []; module.exports = { 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-2.61.1/test/function/samples/module-side-effects/global-false/main.js000066400000000000000000000001251415504077600270330ustar00rootroot00000000000000import 'pluginsideeffects-null'; import 'pluginsideeffects-true'; import 'external'; rollup-2.61.1/test/function/samples/module-side-effects/invalid-option/000077500000000000000000000000001415504077600261575ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/module-side-effects/invalid-option/_config.js000066400000000000000000000005551415504077600301260ustar00rootroot00000000000000module.exports = { 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/guide/en/#treeshake' } }; rollup-2.61.1/test/function/samples/module-side-effects/invalid-option/main.js000066400000000000000000000000311415504077600274330ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/function/samples/module-side-effects/load/000077500000000000000000000000001415504077600241425ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/module-side-effects/load/_config.js000066400000000000000000000016551415504077600261130ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const sideEffects = []; module.exports = { 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-2.61.1/test/function/samples/module-side-effects/load/main.js000066400000000000000000000005231415504077600254240ustar00rootroot00000000000000import '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-2.61.1/test/function/samples/module-side-effects/reexport-from-external/000077500000000000000000000000001415504077600276545ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/module-side-effects/reexport-from-external/_config.js000066400000000000000000000006441415504077600316220ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/module-side-effects/reexport-from-external/main.js000066400000000000000000000001141415504077600311320ustar00rootroot00000000000000export { value as external } from 'external'; export * from 'externalStar'; rollup-2.61.1/test/function/samples/module-side-effects/reexports/000077500000000000000000000000001415504077600252565ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/module-side-effects/reexports/_config.js000066400000000000000000000004761415504077600272270ustar00rootroot00000000000000const assert = require('assert'); const sideEffects = []; module.exports = { description: 'handles reexporting values when module side-effects are false', context: { sideEffects }, exports() { assert.deepStrictEqual(sideEffects, ['dep1']); }, options: { treeshake: { moduleSideEffects: false } } }; rollup-2.61.1/test/function/samples/module-side-effects/reexports/dep1.js000066400000000000000000000000701415504077600264420ustar00rootroot00000000000000sideEffects.push('dep1'); export const value = 'dep1'; rollup-2.61.1/test/function/samples/module-side-effects/reexports/dep2.js000066400000000000000000000000701415504077600264430ustar00rootroot00000000000000sideEffects.push('dep2'); export const value = 'dep2'; rollup-2.61.1/test/function/samples/module-side-effects/reexports/lib.js000066400000000000000000000001651415504077600263640ustar00rootroot00000000000000sideEffects.push('main'); export { value as value1 } from './dep1.js'; export { value as value2 } from './dep2.js'; rollup-2.61.1/test/function/samples/module-side-effects/reexports/main.js000066400000000000000000000000431415504077600265350ustar00rootroot00000000000000export { value1 } from './lib.js'; rollup-2.61.1/test/function/samples/module-side-effects/resolve-id-external/000077500000000000000000000000001415504077600271145ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/module-side-effects/resolve-id-external/_config.js000066400000000000000000000063721415504077600310660ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const sideEffects = []; module.exports = { 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( Array.from(this.getModuleIds()) .filter(id => !path.isAbsolute(id)) .sort() .map(id => ({ id, hasModuleSideEffects: this.getModuleInfo(id).hasModuleSideEffects })), [ { id: 'sideeffects-false-usereffects-false', hasModuleSideEffects: false }, { id: 'sideeffects-false-usereffects-false-unused-import', hasModuleSideEffects: false }, { id: 'sideeffects-false-usereffects-false-used-import', hasModuleSideEffects: false }, { id: 'sideeffects-false-usereffects-true', hasModuleSideEffects: false }, { id: 'sideeffects-false-usereffects-true-unused-import', hasModuleSideEffects: false }, { id: 'sideeffects-false-usereffects-true-used-import', hasModuleSideEffects: false }, { id: 'sideeffects-null-usereffects-false', hasModuleSideEffects: false }, { id: 'sideeffects-null-usereffects-false-unused-import', hasModuleSideEffects: false }, { id: 'sideeffects-null-usereffects-false-used-import', hasModuleSideEffects: false }, { id: 'sideeffects-null-usereffects-true', hasModuleSideEffects: true }, { id: 'sideeffects-null-usereffects-true-unused-import', hasModuleSideEffects: true }, { id: 'sideeffects-null-usereffects-true-used-import', hasModuleSideEffects: true }, { id: 'sideeffects-true-usereffects-false', hasModuleSideEffects: true }, { id: 'sideeffects-true-usereffects-false-unused-import', hasModuleSideEffects: true }, { id: 'sideeffects-true-usereffects-false-used-import', hasModuleSideEffects: true }, { id: 'sideeffects-true-usereffects-true', hasModuleSideEffects: true }, { id: 'sideeffects-true-usereffects-true-unused-import', hasModuleSideEffects: true }, { id: 'sideeffects-true-usereffects-true-used-import', hasModuleSideEffects: true } ] ); } } }, warnings(warnings) { for (const warning of warnings) { assert.strictEqual(warning.code, 'UNUSED_EXTERNAL_IMPORT'); } } }; rollup-2.61.1/test/function/samples/module-side-effects/resolve-id-external/main.js000066400000000000000000000026211415504077600303770ustar00rootroot00000000000000import '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-2.61.1/test/function/samples/module-side-effects/resolve-id/000077500000000000000000000000001415504077600252745ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/module-side-effects/resolve-id/_config.js000066400000000000000000000067071415504077600272500ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const sideEffects = []; module.exports = { 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).hasModuleSideEffects, typeof sideEffects === 'boolean' ? sideEffects : userEffects ); return `export const value = '${id}'; sideEffects.push(value);`; } }, buildEnd() { assert.deepStrictEqual( Array.from(this.getModuleIds()) .filter(id => !path.isAbsolute(id)) .sort() .map(id => ({ id, hasModuleSideEffects: this.getModuleInfo(id).hasModuleSideEffects })), [ { id: 'sideeffects-false-usereffects-false', hasModuleSideEffects: false }, { id: 'sideeffects-false-usereffects-false-unused-import', hasModuleSideEffects: false }, { id: 'sideeffects-false-usereffects-false-used-import', hasModuleSideEffects: false }, { id: 'sideeffects-false-usereffects-true', hasModuleSideEffects: false }, { id: 'sideeffects-false-usereffects-true-unused-import', hasModuleSideEffects: false }, { id: 'sideeffects-false-usereffects-true-used-import', hasModuleSideEffects: false }, { id: 'sideeffects-null-usereffects-false', hasModuleSideEffects: false }, { id: 'sideeffects-null-usereffects-false-unused-import', hasModuleSideEffects: false }, { id: 'sideeffects-null-usereffects-false-used-import', hasModuleSideEffects: false }, { id: 'sideeffects-null-usereffects-true', hasModuleSideEffects: true }, { id: 'sideeffects-null-usereffects-true-unused-import', hasModuleSideEffects: true }, { id: 'sideeffects-null-usereffects-true-used-import', hasModuleSideEffects: true }, { id: 'sideeffects-true-usereffects-false', hasModuleSideEffects: true }, { id: 'sideeffects-true-usereffects-false-unused-import', hasModuleSideEffects: true }, { id: 'sideeffects-true-usereffects-false-used-import', hasModuleSideEffects: true }, { id: 'sideeffects-true-usereffects-true', hasModuleSideEffects: true }, { id: 'sideeffects-true-usereffects-true-unused-import', hasModuleSideEffects: true }, { id: 'sideeffects-true-usereffects-true-used-import', hasModuleSideEffects: true } ] ); } } } }; rollup-2.61.1/test/function/samples/module-side-effects/resolve-id/main.js000066400000000000000000000026211415504077600265570ustar00rootroot00000000000000import '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-2.61.1/test/function/samples/module-side-effects/transform/000077500000000000000000000000001415504077600252365ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/module-side-effects/transform/_config.js000066400000000000000000000031641415504077600272040ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const sideEffects = []; module.exports = { 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-2.61.1/test/function/samples/module-side-effects/transform/main.js000066400000000000000000000021601415504077600265170ustar00rootroot00000000000000import '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-2.61.1/test/function/samples/module-sort-order/000077500000000000000000000000001415504077600227625ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/module-sort-order/_config.js000066400000000000000000000001421415504077600247210ustar00rootroot00000000000000module.exports = { description: 'module sorter is not confused by top-level call expressions' }; rollup-2.61.1/test/function/samples/module-sort-order/a.js000066400000000000000000000003001415504077600235310ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/module-sort-order/b.js000066400000000000000000000000371415504077600235410ustar00rootroot00000000000000export var b = function () {}; rollup-2.61.1/test/function/samples/module-sort-order/c.js000066400000000000000000000001201415504077600235330ustar00rootroot00000000000000import { b } from './b'; export var c = function() { assert.equal(42, 42); }; rollup-2.61.1/test/function/samples/module-sort-order/main.js000066400000000000000000000000601415504077600242400ustar00rootroot00000000000000import a from './a'; import z from './z'; z(); rollup-2.61.1/test/function/samples/module-sort-order/z.js000066400000000000000000000000771415504077600235750ustar00rootroot00000000000000import { c } from './c'; export default function () { c(); } rollup-2.61.1/test/function/samples/module-tree/000077500000000000000000000000001415504077600216215ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/module-tree/_config.js000066400000000000000000000015751415504077600235730ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { 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: [ { chunkName: 'main', code: 'EMPTY_BUNDLE', message: 'Generated an empty chunk: "main"' } ] }; rollup-2.61.1/test/function/samples/module-tree/bar.js000066400000000000000000000000321415504077600227160ustar00rootroot00000000000000import './nested/baz.js'; rollup-2.61.1/test/function/samples/module-tree/foo.js000066400000000000000000000000231415504077600227350ustar00rootroot00000000000000import './bar.js'; rollup-2.61.1/test/function/samples/module-tree/main.js000066400000000000000000000000461415504077600231030ustar00rootroot00000000000000import './foo.js'; import './bar.js'; rollup-2.61.1/test/function/samples/module-tree/nested/000077500000000000000000000000001415504077600231035ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/module-tree/nested/baz.js000066400000000000000000000000341415504077600242120ustar00rootroot00000000000000import qux from './qux.js'; rollup-2.61.1/test/function/samples/module-tree/nested/qux.js000066400000000000000000000000331415504077600242520ustar00rootroot00000000000000export default 'whatever'; rollup-2.61.1/test/function/samples/name-conflict-object/000077500000000000000000000000001415504077600233625ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/name-conflict-object/_config.js000066400000000000000000000007321415504077600253260ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/name-conflict-object/main.js000066400000000000000000000001231415504077600246400ustar00rootroot00000000000000export * as foo from 'external'; export const Object = null; export default 'bar'; rollup-2.61.1/test/function/samples/name-conflict-promise/000077500000000000000000000000001415504077600235725ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/name-conflict-promise/_config.js000066400000000000000000000004151415504077600255340ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/name-conflict-promise/dep.js000066400000000000000000000000361415504077600246770ustar00rootroot00000000000000export const Promise = 'foo'; rollup-2.61.1/test/function/samples/name-conflict-promise/main.js000066400000000000000000000001071415504077600250520ustar00rootroot00000000000000export const Promise = 'bar'; export const promised = import('./dep'); rollup-2.61.1/test/function/samples/name-conflict-symbol/000077500000000000000000000000001415504077600234215ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/name-conflict-symbol/_config.js000066400000000000000000000005001415504077600253560ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'avoids name conflicts with local variables named Symbol', options: { output: { namespaceToStringTag: true } }, exports(exports) { assert.strictEqual(exports.Symbol, null); assert.strictEqual(exports.toString(), '[object Module]'); } }; rollup-2.61.1/test/function/samples/name-conflict-symbol/main.js000066400000000000000000000000341415504077600247000ustar00rootroot00000000000000export const Symbol = null; rollup-2.61.1/test/function/samples/named-external-method-in-prototype/000077500000000000000000000000001415504077600262305ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/named-external-method-in-prototype/_config.js000066400000000000000000000005121415504077600301700ustar00rootroot00000000000000module.exports = { 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') { return require('./bar'); } return require(name); } }, options: { external: ['bar'] } }; rollup-2.61.1/test/function/samples/named-external-method-in-prototype/bar.js000066400000000000000000000000721415504077600273310ustar00rootroot00000000000000exports.bar = { foobar: function () { return 42; } }; rollup-2.61.1/test/function/samples/named-external-method-in-prototype/foo.js000066400000000000000000000002271415504077600273520ustar00rootroot00000000000000import { bar } from 'bar'; export default function Foo() { this.answer = bar.foobar(); } Foo.prototype.bar = function () { return bar.foobar(); }; rollup-2.61.1/test/function/samples/named-external-method-in-prototype/main.js000066400000000000000000000001021415504077600275030ustar00rootroot00000000000000import Foo from './foo.js'; assert.equal( new Foo().bar(), 42 ); rollup-2.61.1/test/function/samples/namespace-missing-export/000077500000000000000000000000001415504077600243215ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/namespace-missing-export/_config.js000066400000000000000000000012671415504077600262710ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'replaces missing namespace members with undefined and warns about them', warnings: [ { code: 'MISSING_EXPORT', exporter: 'empty.js', importer: 'main.js', id: path.join(__dirname, 'main.js'), missing: 'foo', message: `'foo' is not exported by 'empty.js'`, pos: 61, loc: { file: require('path').resolve(__dirname, 'main.js'), line: 3, column: 25 }, frame: ` 1: import * as mod from './empty.js'; 2: 3: assert.equal( typeof mod.foo, 'undefined' ); ^ `, url: `https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module` } ] }; rollup-2.61.1/test/function/samples/namespace-missing-export/empty.js000066400000000000000000000000471415504077600260160ustar00rootroot00000000000000// this space left intentionally blank rollup-2.61.1/test/function/samples/namespace-missing-export/main.js000066400000000000000000000001211415504077600255750ustar00rootroot00000000000000import * as mod from './empty.js'; assert.equal( typeof mod.foo, 'undefined' ); rollup-2.61.1/test/function/samples/namespace-reassign-import-fails/000077500000000000000000000000001415504077600255505ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/namespace-reassign-import-fails/_config.js000066400000000000000000000030101415504077600275040ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const { assertIncludes } = require('../../../utils.js'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = { description: 'warns for reassignments to namespace exports', code(code) { assertIncludes(code, 'foo = 2'); assertIncludes(code, 'undefined = 3'); }, warnings: [ { code: 'MISSING_EXPORT', exporter: 'foo.js', frame: ` 2: 3: exp.foo = 2; 4: exp.bar = 3; ^ `, id: ID_MAIN, importer: 'main.js', loc: { column: 4, file: ID_MAIN, line: 4 }, message: "'bar' is not exported by 'foo.js'", missing: 'bar', pos: 48, url: 'https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module' }, { code: 'ILLEGAL_NAMESPACE_REASSIGNMENT', message: `Illegal reassignment to import 'exp'`, id: ID_MAIN, pos: 31, loc: { file: ID_MAIN, line: 3, column: 0 }, frame: ` 1: import * as exp from './foo'; 2: 3: exp.foo = 2; ^ 4: exp.bar = 3; ` }, { code: 'ILLEGAL_NAMESPACE_REASSIGNMENT', message: `Illegal reassignment to import 'exp'`, id: ID_MAIN, pos: 44, loc: { file: ID_MAIN, line: 4, column: 0 }, 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-2.61.1/test/function/samples/namespace-reassign-import-fails/foo.js000066400000000000000000000000261415504077600266670ustar00rootroot00000000000000export const foo = 1; rollup-2.61.1/test/function/samples/namespace-reassign-import-fails/main.js000066400000000000000000000000711415504077600270300ustar00rootroot00000000000000import * as exp from './foo'; exp.foo = 2; exp.bar = 3; rollup-2.61.1/test/function/samples/namespace-tostring/000077500000000000000000000000001415504077600232025ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/namespace-tostring/dynamic-import-default-mode/000077500000000000000000000000001415504077600305025ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/namespace-tostring/dynamic-import-default-mode/_config.js000066400000000000000000000007511415504077600324470ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'adds Symbol.toStringTag property to dynamic imports of entry chunks with default export mode', options: { 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); } }; rollup-2.61.1/test/function/samples/namespace-tostring/dynamic-import-default-mode/foo.js000066400000000000000000000000231415504077600316160ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/namespace-tostring/dynamic-import-default-mode/main.js000066400000000000000000000000401415504077600317560ustar00rootroot00000000000000export default import('./foo'); rollup-2.61.1/test/function/samples/namespace-tostring/dynamic-import/000077500000000000000000000000001415504077600261365ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/namespace-tostring/dynamic-import/_config.js000066400000000000000000000006401415504077600301000ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'adds Symbol.toStringTag property to dynamic imports', options: { 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.bar, 42); } }; rollup-2.61.1/test/function/samples/namespace-tostring/dynamic-import/foo.js000066400000000000000000000000271415504077600272560ustar00rootroot00000000000000export const bar = 42; rollup-2.61.1/test/function/samples/namespace-tostring/dynamic-import/main.js000066400000000000000000000000401415504077600274120ustar00rootroot00000000000000export default import('./foo'); rollup-2.61.1/test/function/samples/namespace-tostring/entry-default/000077500000000000000000000000001415504077600257655ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/namespace-tostring/entry-default/_config.js000066400000000000000000000006771415504077600277410ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'does not add Symbol.toStringTag property to entry chunks with default export mode', options: { 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); } }; rollup-2.61.1/test/function/samples/namespace-tostring/entry-default/main.js000066400000000000000000000000341415504077600272440ustar00rootroot00000000000000export default { foo: 42 }; rollup-2.61.1/test/function/samples/namespace-tostring/entry-named/000077500000000000000000000000001415504077600254255ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/namespace-tostring/entry-named/_config.js000066400000000000000000000006561415504077600273760ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'adds Symbol.toStringTag property to entry chunks with named exports', options: { output: { namespaceToStringTag: true, exports: 'named' } }, exports(exports) { assert.strictEqual(exports[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(exports), '[object Module]'); assert.strictEqual(exports.foo, 42); } }; rollup-2.61.1/test/function/samples/namespace-tostring/entry-named/main.js000066400000000000000000000000271415504077600267060ustar00rootroot00000000000000export const foo = 42; rollup-2.61.1/test/function/samples/namespace-tostring/external-namespaces/000077500000000000000000000000001415504077600271415ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/namespace-tostring/external-namespaces/_config.js000066400000000000000000000010461415504077600311040ustar00rootroot00000000000000module.exports = { description: 'adds Symbol.toStringTag property to external namespaces', options: { 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 }; } } }; rollup-2.61.1/test/function/samples/namespace-tostring/external-namespaces/main.js000066400000000000000000000014201415504077600304200ustar00rootroot00000000000000import * 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-2.61.1/test/function/samples/namespace-tostring/inlined-namespace/000077500000000000000000000000001415504077600265565ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/namespace-tostring/inlined-namespace/_config.js000066400000000000000000000002331415504077600305160ustar00rootroot00000000000000module.exports = { description: 'adds Symbol.toStringTag property to inlined namespaces', options: { output: { namespaceToStringTag: true } } }; rollup-2.61.1/test/function/samples/namespace-tostring/inlined-namespace/foo.js000066400000000000000000000000271415504077600276760ustar00rootroot00000000000000export const bar = 42; rollup-2.61.1/test/function/samples/namespace-tostring/inlined-namespace/main.js000066400000000000000000000003031415504077600300340ustar00rootroot00000000000000import * 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-2.61.1/test/function/samples/namespace-update-import-fails/000077500000000000000000000000001415504077600252175ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/namespace-update-import-fails/_config.js000066400000000000000000000014631415504077600271650ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const { assertIncludes } = require('../../../utils.js'); module.exports = { description: 'disallows updates to namespace exports', code(code) { assertIncludes(code, 'foo++'); }, warnings: [ { code: 'ILLEGAL_NAMESPACE_REASSIGNMENT', message: `Illegal reassignment to import 'exp'`, id: path.join(__dirname, 'main.js'), pos: 31, loc: { file: path.join(__dirname, 'main.js'), line: 3, column: 0 }, 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-2.61.1/test/function/samples/namespace-update-import-fails/foo.js000066400000000000000000000000261415504077600263360ustar00rootroot00000000000000export const foo = 1; rollup-2.61.1/test/function/samples/namespace-update-import-fails/main.js000066400000000000000000000000551415504077600265010ustar00rootroot00000000000000import * as exp from './foo'; exp['foo']++; rollup-2.61.1/test/function/samples/namespaces-are-frozen/000077500000000000000000000000001415504077600235645ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/namespaces-are-frozen/_config.js000066400000000000000000000011031415504077600255210ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'namespaces should be non-extensible and its properties immutatable and non-configurable', exports(exports) { const ns = exports.ns; function extend(obj) { 'use strict'; obj.newProperty = true; } function reconfigure(obj) { Object.defineProperty(obj, 'a', { value: null }); } function mutate(obj) { 'use strict'; obj.a = 2; } assert.throws(() => { extend(ns); }); assert.throws(() => { reconfigure(ns); }); assert.throws(() => { mutate(ns); }); } }; rollup-2.61.1/test/function/samples/namespaces-are-frozen/main.js000066400000000000000000000000551415504077600250460ustar00rootroot00000000000000import * as ns from './mod'; export { ns }; rollup-2.61.1/test/function/samples/namespaces-are-frozen/mod.js000066400000000000000000000000441415504077600246770ustar00rootroot00000000000000export var a = 1; export var b = 2; rollup-2.61.1/test/function/samples/namespaces-have-null-prototype/000077500000000000000000000000001415504077600254525ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/namespaces-have-null-prototype/_config.js000066400000000000000000000001161415504077600274120ustar00rootroot00000000000000module.exports = { description: 'creates namespaces with null prototypes' }; rollup-2.61.1/test/function/samples/namespaces-have-null-prototype/main.js000066400000000000000000000001171415504077600267330ustar00rootroot00000000000000import * as ns from './mod'; assert.equal( Object.getPrototypeOf(ns), null ); rollup-2.61.1/test/function/samples/namespaces-have-null-prototype/mod.js000066400000000000000000000000441415504077600265650ustar00rootroot00000000000000export var a = 1; export var b = 2; rollup-2.61.1/test/function/samples/namespacing-collisions-2/000077500000000000000000000000001415504077600241775ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/namespacing-collisions-2/Material.js000066400000000000000000000000641415504077600262730ustar00rootroot00000000000000export function Material() { return 'Material'; } rollup-2.61.1/test/function/samples/namespacing-collisions-2/MaterialAgain.js000066400000000000000000000000761415504077600272360ustar00rootroot00000000000000export function MaterialAgain() { return 'MaterialAgain'; } rollup-2.61.1/test/function/samples/namespacing-collisions-2/Something.js000066400000000000000000000002241415504077600264700ustar00rootroot00000000000000import * as Material from './Material'; export function Something() { assert.strictEqual(Material.Material(), 'Material'); return 'Something'; } rollup-2.61.1/test/function/samples/namespacing-collisions-2/SomethingAgain.js000066400000000000000000000002551415504077600274340ustar00rootroot00000000000000import * as Material from './MaterialAgain'; export function SomethingAgain() { assert.strictEqual(Material.MaterialAgain(), 'MaterialAgain'); return 'SomethingAgain'; } rollup-2.61.1/test/function/samples/namespacing-collisions-2/_config.js000066400000000000000000000003671415504077600261470ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'correctly namespaces when using * exports, take two (#910)', exports(exports) { assert.deepEqual(exports, ['Material', 'MaterialAgain', 'Something', 'SomethingAgain']); } }; rollup-2.61.1/test/function/samples/namespacing-collisions-2/main.js000066400000000000000000000004261415504077600254630ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/namespacing-collisions/000077500000000000000000000000001415504077600240405ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/namespacing-collisions/Material.js000066400000000000000000000000641415504077600261340ustar00rootroot00000000000000export function Material() { return 'Material'; } rollup-2.61.1/test/function/samples/namespacing-collisions/Something.js000066400000000000000000000002241415504077600263310ustar00rootroot00000000000000import * as Material from './Material'; export function Something() { assert.strictEqual(Material.Material(), 'Material'); return 'Something'; } rollup-2.61.1/test/function/samples/namespacing-collisions/_config.js000066400000000000000000000003201415504077600257750ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'correctly namespaces when using * exports (#910)', exports(exports) { assert.deepStrictEqual(exports, ['Material', 'Something']); } }; rollup-2.61.1/test/function/samples/namespacing-collisions/main.js000066400000000000000000000002161415504077600253210ustar00rootroot00000000000000import { Something } from './Something'; import { Material } from './Material'; var result = [Material(), Something()] export default result;rollup-2.61.1/test/function/samples/namespacing-in-sub-functions/000077500000000000000000000000001415504077600250655ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/namespacing-in-sub-functions/_config.js000066400000000000000000000002561415504077600270320ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'correctly namespaces sub-functions (#910)', exports(exports) { assert.equal(exports, 'foobar'); } }; rollup-2.61.1/test/function/samples/namespacing-in-sub-functions/main.js000066400000000000000000000003321415504077600263450ustar00rootroot00000000000000import { problematicFunc as otherFunc } from './problematicFunc'; function innerFunc() { function problematicFunc () { return otherFunc(); } return problematicFunc(); } var res = innerFunc(); export default res;rollup-2.61.1/test/function/samples/namespacing-in-sub-functions/problematicFunc.js000066400000000000000000000001151415504077600305350ustar00rootroot00000000000000function problematicFunc() { return 'foobar'; } export { problematicFunc };rollup-2.61.1/test/function/samples/nested-foreach/000077500000000000000000000000001415504077600222665ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/nested-foreach/_config.js000066400000000000000000000002731415504077600242320ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'detects side-effects in nested .forEach calls (#3533)', exports: exports => assert.strictEqual(exports.result, 9) }; rollup-2.61.1/test/function/samples/nested-foreach/main.js000066400000000000000000000001501415504077600235440ustar00rootroot00000000000000const list = [1, 2]; export let result = 0; list.forEach(p => list.forEach(pp => (result += p * pp))); rollup-2.61.1/test/function/samples/nested-inlined-dynamic-import-1/000077500000000000000000000000001415504077600253715ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/nested-inlined-dynamic-import-1/_config.js000066400000000000000000000004661415504077600273410ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/nested-inlined-dynamic-import-1/foo.js000066400000000000000000000000311415504077600265040ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/function/samples/nested-inlined-dynamic-import-1/main.js000066400000000000000000000001411415504077600266470ustar00rootroot00000000000000export default () => { const foo = 1; return import('./foo.js').then(ns => ns.value + foo); }; rollup-2.61.1/test/function/samples/nested-inlined-dynamic-import-2/000077500000000000000000000000001415504077600253725ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/nested-inlined-dynamic-import-2/_config.js000066400000000000000000000006411415504077600273350ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'deconflicts variables when nested dynamic imports are inlined', warnings: [ { code: 'CIRCULAR_DEPENDENCY', cycle: ['lib1.js', 'lib2.js', 'lib1.js'], importer: 'lib1.js', message: 'Circular dependency: lib1.js -> lib2.js -> lib1.js' } ], exports(exports) { return exports().then(result => assert.strictEqual(result, 43)); } }; rollup-2.61.1/test/function/samples/nested-inlined-dynamic-import-2/lib1.js000066400000000000000000000001671415504077600265630ustar00rootroot00000000000000import './lib2.js'; export default () => { const lib2 = 1; return import('./lib2.js').then(ns => ns.foo + lib2); }; rollup-2.61.1/test/function/samples/nested-inlined-dynamic-import-2/lib2.js000066400000000000000000000000541415504077600265570ustar00rootroot00000000000000import './lib1.js'; export const foo = 42; rollup-2.61.1/test/function/samples/nested-inlined-dynamic-import-2/main.js000066400000000000000000000000431415504077600266510ustar00rootroot00000000000000export {default} from './lib1.js'; rollup-2.61.1/test/function/samples/nested-namespace-member-expression/000077500000000000000000000000001415504077600262555ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/nested-namespace-member-expression/_config.js000066400000000000000000000002711415504077600302170ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'handles accessing members of namespaces correctly', exports(exports) { assert.strictEqual(exports, false); } }; rollup-2.61.1/test/function/samples/nested-namespace-member-expression/helpers.js000066400000000000000000000000411415504077600302500ustar00rootroot00000000000000export var global = {Object: {}};rollup-2.61.1/test/function/samples/nested-namespace-member-expression/main.js000066400000000000000000000001321415504077600275330ustar00rootroot00000000000000import * as helpers from './helpers.js'; export default helpers.global.Object === Object; rollup-2.61.1/test/function/samples/nested-property-call-performance/000077500000000000000000000000001415504077600257535ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/nested-property-call-performance/_config.js000066400000000000000000000001401415504077600277100ustar00rootroot00000000000000module.exports = { description: 'handles nested property calls with acceptable performance' }; rollup-2.61.1/test/function/samples/nested-property-call-performance/main.js000066400000000000000000000010761415504077600272410ustar00rootroot00000000000000assert.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-2.61.1/test/function/samples/newline-after-comment/000077500000000000000000000000001415504077600235775ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/newline-after-comment/_config.js000066400000000000000000000002361415504077600255420ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'inserts newline after comment', exports(exports) { assert.equal(exports(), 42); } }; rollup-2.61.1/test/function/samples/newline-after-comment/main.js000066400000000000000000000001341415504077600250570ustar00rootroot00000000000000// this comment should not affect the line below export default function () { return 42; } rollup-2.61.1/test/function/samples/no-external-live-bindings-compact/000077500000000000000000000000001415504077600260075ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/no-external-live-bindings-compact/_config.js000066400000000000000000000014721415504077600277550ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Allows omitting the code that handles external live bindings', options: { external: () => true, output: { compact: true, externalLiveBindings: false, name: 'bundle' } }, 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-2.61.1/test/function/samples/no-external-live-bindings-compact/main.js000066400000000000000000000001561415504077600272730ustar00rootroot00000000000000export { external1 } from 'external1'; export * from 'external2'; export const dynamic = import('external3'); rollup-2.61.1/test/function/samples/no-external-live-bindings/000077500000000000000000000000001415504077600243635ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/no-external-live-bindings/_config.js000066400000000000000000000014501415504077600263250ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Allows omitting the code that handles external live bindings', options: { external: () => true, output: { externalLiveBindings: false, name: 'bundle' } }, 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-2.61.1/test/function/samples/no-external-live-bindings/main.js000066400000000000000000000001561415504077600256470ustar00rootroot00000000000000export { external1 } from 'external1'; export * from 'external2'; export const dynamic = import('external3'); rollup-2.61.1/test/function/samples/no-imports/000077500000000000000000000000001415504077600215065ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/no-imports/_config.js000066400000000000000000000001251415504077600234460ustar00rootroot00000000000000module.exports = { description: 'creates a bundle from a module with no imports' }; rollup-2.61.1/test/function/samples/no-imports/main.js000066400000000000000000000000221415504077600227620ustar00rootroot00000000000000assert.ok( true );rollup-2.61.1/test/function/samples/no-relative-external/000077500000000000000000000000001415504077600234445ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/no-relative-external/_config.js000066400000000000000000000004211415504077600254030ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'missing relative imports are an error, not a warning', error: { code: 'UNRESOLVED_IMPORT', message: `Could not resolve './missing.js' from main.js`, watchFiles: [path.join(__dirname, 'main.js')] } }; rollup-2.61.1/test/function/samples/no-relative-external/main.js000066400000000000000000000000441415504077600247240ustar00rootroot00000000000000import missing from './missing.js'; rollup-2.61.1/test/function/samples/non-extension-dot/000077500000000000000000000000001415504077600227675ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/non-extension-dot/_config.js000066400000000000000000000001371415504077600247320ustar00rootroot00000000000000module.exports = { description: 'adds .js to module paths with non-extension dots in them' }; rollup-2.61.1/test/function/samples/non-extension-dot/foo.bar.js000066400000000000000000000000301415504077600246440ustar00rootroot00000000000000export default 'fubar'; rollup-2.61.1/test/function/samples/non-extension-dot/main.js000066400000000000000000000001011415504077600242410ustar00rootroot00000000000000import status from './foo.bar'; assert.equal( status, 'fubar' ); rollup-2.61.1/test/function/samples/non-function-hook-async/000077500000000000000000000000001415504077600240655ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/non-function-hook-async/_config.js000066400000000000000000000005571415504077600260360ustar00rootroot00000000000000module.exports = { description: 'throws when providing a value for an async function hook', options: { plugins: { resolveId: 'value' } }, error: { code: 'PLUGIN_ERROR', hook: 'resolveId', message: 'Error running plugin hook resolveId for at position 1, expected a function hook.', plugin: 'at position 1', pluginCode: 'INVALID_PLUGIN_HOOK' } }; rollup-2.61.1/test/function/samples/non-function-hook-async/foo.js000066400000000000000000000000231415504077600252010ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/non-function-hook-async/main.js000066400000000000000000000000511415504077600253430ustar00rootroot00000000000000export default () => import('./foo.js'); rollup-2.61.1/test/function/samples/non-function-hook-sync/000077500000000000000000000000001415504077600237245ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/non-function-hook-sync/_config.js000066400000000000000000000006011415504077600256630ustar00rootroot00000000000000module.exports = { description: 'throws when providing a value for a sync function hook', options: { plugins: { outputOptions: 'value' } }, generateError: { code: 'PLUGIN_ERROR', hook: 'outputOptions', message: 'Error running plugin hook outputOptions for at position 1, expected a function hook.', plugin: 'at position 1', pluginCode: 'INVALID_PLUGIN_HOOK' } }; rollup-2.61.1/test/function/samples/non-function-hook-sync/foo.js000066400000000000000000000000231415504077600250400ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/non-function-hook-sync/main.js000066400000000000000000000000511415504077600252020ustar00rootroot00000000000000export default () => import('./foo.js'); rollup-2.61.1/test/function/samples/non-js-extensions/000077500000000000000000000000001415504077600230005ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/non-js-extensions/_config.js000066400000000000000000000004101415504077600247350ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'non .js extensions are preserved', options: { plugins: [ { transform(code, id) { if (path.extname(id) === '.json') { return 'export default ' + code; } } } ] } }; rollup-2.61.1/test/function/samples/non-js-extensions/info.json000066400000000000000000000000221415504077600246200ustar00rootroot00000000000000{ "answer": 42 } rollup-2.61.1/test/function/samples/non-js-extensions/main.js000066400000000000000000000001021415504077600242530ustar00rootroot00000000000000import info from './info.json'; assert.equal( info.answer, 42 ); rollup-2.61.1/test/function/samples/object-deep-access-effect/000077500000000000000000000000001415504077600242515ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/object-deep-access-effect/_config.js000066400000000000000000000003311415504077600262100ustar00rootroot00000000000000module.exports = { description: 'throws when an nested property of an unknown object property is accessed', context: { require() { return { unknown: 'prop' }; } }, options: { external: ['external'] } }; rollup-2.61.1/test/function/samples/object-deep-access-effect/main.js000066400000000000000000000002231415504077600255300ustar00rootroot00000000000000import { unknown } from 'external'; assert.throws(() => { const obj = {}; obj[unknown].prop; }, /^TypeError: Cannot read propert.*'prop'.*$/ ); rollup-2.61.1/test/function/samples/object-destructuring-renaming/000077500000000000000000000000001415504077600253435ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/object-destructuring-renaming/_config.js000066400000000000000000000003361415504077600273070ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'renaming destructured object properties should request the correct property (#527)', exports(exports) { assert.equal(exports.env, process.env); } }; rollup-2.61.1/test/function/samples/object-destructuring-renaming/main.js000066400000000000000000000001021415504077600266160ustar00rootroot00000000000000import { getEnv } from './module.js'; export var env = getEnv(); rollup-2.61.1/test/function/samples/object-destructuring-renaming/module.js000066400000000000000000000001041415504077600271610ustar00rootroot00000000000000const { env } = process; export function getEnv() { return env; } rollup-2.61.1/test/function/samples/object-dynamic-properties/000077500000000000000000000000001415504077600244615ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/object-dynamic-properties/_config.js000066400000000000000000000001241415504077600264200ustar00rootroot00000000000000module.exports = { description: 'dynamic object assignments should be imported' }; rollup-2.61.1/test/function/samples/object-dynamic-properties/main.js000066400000000000000000000002421415504077600257410ustar00rootroot00000000000000import tags from './tags'; assert.equal(tags['[object Object]'], true); assert.equal(tags['[object Number]'], false); assert.equal(Object.keys(tags).length, 6); rollup-2.61.1/test/function/samples/object-dynamic-properties/tags.js000066400000000000000000000007571415504077600257660ustar00rootroot00000000000000// 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-2.61.1/test/function/samples/object-expression-shadowed-properties/000077500000000000000000000000001415504077600270305ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/object-expression-shadowed-properties/_config.js000066400000000000000000000003051415504077600307700ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/object-expression-shadowed-properties/main.js000066400000000000000000000005331415504077600303130ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/object-properties/000077500000000000000000000000001415504077600230375ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/object-properties/_config.js000066400000000000000000000001201415504077600247720ustar00rootroot00000000000000module.exports = { description: 'includes object properties in definitions' }; rollup-2.61.1/test/function/samples/object-properties/main.js000066400000000000000000000001011415504077600243110ustar00rootroot00000000000000import object from './object'; assert.equal( object.answer, 42 );rollup-2.61.1/test/function/samples/object-properties/object.js000066400000000000000000000000651415504077600246440ustar00rootroot00000000000000var answer = 42; export default { answer: answer };rollup-2.61.1/test/function/samples/object-prototype-properties/000077500000000000000000000000001415504077600251025ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/object-prototype-properties/_config.js000066400000000000000000000001411415504077600270400ustar00rootroot00000000000000module.exports = { description: 'handles names conflicting with Object.prototype properties' }; rollup-2.61.1/test/function/samples/object-prototype-properties/foo.js000066400000000000000000000001261415504077600262220ustar00rootroot00000000000000function valueOf() { return 42; } export default function() { return valueOf(); }; rollup-2.61.1/test/function/samples/object-prototype-properties/main.js000066400000000000000000000000651415504077600263650ustar00rootroot00000000000000import foo from './foo'; assert.equal( foo(), 42 ); rollup-2.61.1/test/function/samples/object-spread-side-effect/000077500000000000000000000000001415504077600242755ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/object-spread-side-effect/_config.js000066400000000000000000000001321415504077600262330ustar00rootroot00000000000000module.exports = { description: 'triggers getter side effects when spreading objects' }; rollup-2.61.1/test/function/samples/object-spread-side-effect/main.js000066400000000000000000000001751415504077600255620ustar00rootroot00000000000000let result = 'FAIL'; const unused = { ...{ get prop() { result = 'PASS'; } } }; assert.strictEqual(result, 'PASS'); rollup-2.61.1/test/function/samples/optional-catch-binding/000077500000000000000000000000001415504077600237145ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/optional-catch-binding/_config.js000066400000000000000000000003021415504077600256510ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'allows optional catch binding with appropriate acorn settings', exports(exports) { assert.equal(exports.foo, true); } }; rollup-2.61.1/test/function/samples/optional-catch-binding/main.js000066400000000000000000000000701415504077600251730ustar00rootroot00000000000000export let foo; try { foo(); } catch { foo = true; } rollup-2.61.1/test/function/samples/options-async-hook/000077500000000000000000000000001415504077600231435ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/options-async-hook/_config.js000066400000000000000000000014241415504077600251060ustar00rootroot00000000000000const assert = require('assert'); const { promises: fs } = require('fs'); module.exports = { 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-2.61.1/test/function/samples/options-async-hook/file.txt000066400000000000000000000000071415504077600246200ustar00rootroot00000000000000unused rollup-2.61.1/test/function/samples/options-async-hook/unused.js000066400000000000000000000000411415504077600247770ustar00rootroot00000000000000throw new Error('Not executed'); rollup-2.61.1/test/function/samples/options-async-hook/used.js000066400000000000000000000000231415504077600244340ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/options-hook/000077500000000000000000000000001415504077600220305ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/options-hook/_config.js000066400000000000000000000025651415504077600240020ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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: { allowAwaitOutsideFunction: true, ecmaVersion: 'latest', preserveParens: false, sourceType: 'module' }, acornInjectPlugins: [], context: 'undefined', experimentalCacheExpiry: 10, input: ['used'], makeAbsoluteExternalsRelative: true, maxParallelFileReads: 20, perf: false, plugins: [ { name: 'test-plugin' } ], preserveEntrySignatures: 'strict', 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-2.61.1/test/function/samples/options-hook/unused.js000066400000000000000000000000411415504077600236640ustar00rootroot00000000000000throw new Error('Not executed'); rollup-2.61.1/test/function/samples/options-hook/used.js000066400000000000000000000000231415504077600233210ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/options-in-renderstart/000077500000000000000000000000001415504077600240315ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/options-in-renderstart/_config.js000066400000000000000000000013311415504077600257710ustar00rootroot00000000000000const assert = require('assert'); const checkedOptions = []; module.exports = { 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, [ 'output-plugin', 'cjs', 'global', 'input-plugin', 'cjs', 'global' ]); } }; rollup-2.61.1/test/function/samples/options-in-renderstart/main.js000066400000000000000000000000211415504077600253040ustar00rootroot00000000000000assert.ok(this); rollup-2.61.1/test/function/samples/output-options-hook/000077500000000000000000000000001415504077600233665ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/output-options-hook/_config.js000066400000000000000000000036101415504077600253300ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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 }, assetFileNames: 'assets/[name]-[hash][extname]', chunkFileNames: '[name]-[hash].js', compact: false, entryFileNames: '[name].js', esModule: true, exports: 'auto', extend: false, externalLiveBindings: true, format: 'cjs', freeze: true, generatedCode: { arrowFunctions: false, constBindings: false, objectShorthand: false, reservedNamesAsProps: 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: false, 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-2.61.1/test/function/samples/output-options-hook/main.js000066400000000000000000000000271415504077600246470ustar00rootroot00000000000000export const foo = 42; rollup-2.61.1/test/function/samples/override-external-namespace/000077500000000000000000000000001415504077600247705ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/override-external-namespace/_config.js000066400000000000000000000007241415504077600267350ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/override-external-namespace/main.js000066400000000000000000000002221415504077600262460ustar00rootroot00000000000000export * from 'path'; export const dirname = 'defined'; export let resolve; export var join; export const reassign = () => (resolve = 'defined'); rollup-2.61.1/test/function/samples/override-static-external-namespace/000077500000000000000000000000001415504077600262555ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/override-static-external-namespace/_config.js000066400000000000000000000010451415504077600302170ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/override-static-external-namespace/main.js000066400000000000000000000002211415504077600275320ustar00rootroot00000000000000export * from 'path'; export const dirname = 'defined'; export let resolve; export var join; export const reassign = () => (resolve = 'defined');rollup-2.61.1/test/function/samples/parenthesised-default-export/000077500000000000000000000000001415504077600251765ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/parenthesised-default-export/_config.js000066400000000000000000000001331415504077600271350ustar00rootroot00000000000000module.exports = { description: 'allows default exports to be enclosed in parentheses' }; rollup-2.61.1/test/function/samples/parenthesised-default-export/main.js000066400000000000000000000000271415504077600264570ustar00rootroot00000000000000export default ( 42 ); rollup-2.61.1/test/function/samples/pass-namespace-to-function/000077500000000000000000000000001415504077600245425ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/pass-namespace-to-function/_config.js000066400000000000000000000001241415504077600265010ustar00rootroot00000000000000module.exports = { description: 'allows a namespace to be passed to a function' }; rollup-2.61.1/test/function/samples/pass-namespace-to-function/bar.js000066400000000000000000000000471415504077600256450ustar00rootroot00000000000000// this space left intentionally blank rollup-2.61.1/test/function/samples/pass-namespace-to-function/foo.js000066400000000000000000000001641415504077600256640ustar00rootroot00000000000000import * as bar from './bar'; export default function foo () {} foo.x = function () { doSomethingWith( bar ); }; rollup-2.61.1/test/function/samples/pass-namespace-to-function/main.js000066400000000000000000000001011415504077600260140ustar00rootroot00000000000000import foo from './foo'; export default function () { foo(); } rollup-2.61.1/test/function/samples/paths-are-case-sensitive/000077500000000000000000000000001415504077600242035ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/paths-are-case-sensitive/Foo.js000066400000000000000000000000641415504077600252640ustar00rootroot00000000000000export default function () { assert.ok( false ); } rollup-2.61.1/test/function/samples/paths-are-case-sensitive/_config.js000066400000000000000000000003761415504077600261530ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'insists on correct casing for imports', error: { code: 'UNRESOLVED_IMPORT', message: `Could not resolve './foo.js' from main.js`, watchFiles: [path.join(__dirname, 'main.js')] } }; rollup-2.61.1/test/function/samples/paths-are-case-sensitive/main.js000066400000000000000000000000441415504077600254630ustar00rootroot00000000000000import foo from './foo.js'; foo(); rollup-2.61.1/test/function/samples/per-output-plugins-warn-hooks/000077500000000000000000000000001415504077600252705ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/per-output-plugins-warn-hooks/_config.js000066400000000000000000000060571415504077600272420ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/per-output-plugins-warn-hooks/_expected/000077500000000000000000000000001415504077600272305ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/per-output-plugins-warn-hooks/_expected/amd.js000066400000000000000000000000761415504077600303320ustar00rootroot00000000000000define(function () { 'use strict'; console.log('amd'); }); rollup-2.61.1/test/function/samples/per-output-plugins-warn-hooks/_expected/cjs.js000066400000000000000000000000431415504077600303420ustar00rootroot00000000000000'use strict'; console.log('cjs'); rollup-2.61.1/test/function/samples/per-output-plugins-warn-hooks/_expected/es.js000066400000000000000000000000231415504077600301700ustar00rootroot00000000000000console.log('es'); rollup-2.61.1/test/function/samples/per-output-plugins-warn-hooks/_expected/iife.js000066400000000000000000000000741415504077600305030ustar00rootroot00000000000000(function () { 'use strict'; console.log('iife'); }()); rollup-2.61.1/test/function/samples/per-output-plugins-warn-hooks/_expected/system.js000066400000000000000000000001741415504077600311140ustar00rootroot00000000000000System.register([], function () { 'use strict'; return { execute: function () { console.log('system'); } }; }); rollup-2.61.1/test/function/samples/per-output-plugins-warn-hooks/_expected/umd.js000066400000000000000000000002361415504077600303540ustar00rootroot00000000000000(function (factory) { typeof define === 'function' && define.amd ? define(factory) : factory(); }((function () { 'use strict'; console.log('umd'); }))); rollup-2.61.1/test/function/samples/per-output-plugins-warn-hooks/main.js000066400000000000000000000000231415504077600265450ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/plugin-cache/000077500000000000000000000000001415504077600217365ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-cache/anonymous-delete/000077500000000000000000000000001415504077600252265ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-cache/anonymous-delete/_config.js000066400000000000000000000006341415504077600271730ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/plugin-cache/anonymous-delete/main.js000066400000000000000000000000261415504077600265060ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-2.61.1/test/function/samples/plugin-cache/anonymous-get/000077500000000000000000000000001415504077600245435ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-cache/anonymous-get/_config.js000066400000000000000000000006231415504077600265060ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/plugin-cache/anonymous-get/main.js000066400000000000000000000000261415504077600260230ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-2.61.1/test/function/samples/plugin-cache/anonymous-has/000077500000000000000000000000001415504077600245375ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-cache/anonymous-has/_config.js000066400000000000000000000006241415504077600265030ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/plugin-cache/anonymous-has/main.js000066400000000000000000000000261415504077600260170ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-2.61.1/test/function/samples/plugin-cache/anonymous-set/000077500000000000000000000000001415504077600245575ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-cache/anonymous-set/_config.js000066400000000000000000000006351415504077600265250ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/plugin-cache/anonymous-set/main.js000066400000000000000000000000261415504077600260370ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-2.61.1/test/function/samples/plugin-cache/duplicate-names-no-cache/000077500000000000000000000000001415504077600264645ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-cache/duplicate-names-no-cache/_config.js000066400000000000000000000004511415504077600304260ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/plugin-cache/duplicate-names-no-cache/main.js000066400000000000000000000000261415504077600277440ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-2.61.1/test/function/samples/plugin-cache/duplicate-names/000077500000000000000000000000001415504077600250115ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-cache/duplicate-names/_config.js000066400000000000000000000012271415504077600267550ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/plugin-cache/duplicate-names/main.js000066400000000000000000000000261415504077600262710ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-2.61.1/test/function/samples/plugin-error-loc-instead-pos/000077500000000000000000000000001415504077600250235ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-error-loc-instead-pos/_config.js000066400000000000000000000011631415504077600267660ustar00rootroot00000000000000const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/plugin-error-loc-instead-pos/main.js000066400000000000000000000000341415504077600263020ustar00rootroot00000000000000assert.equal( 21 * 2, TK ); rollup-2.61.1/test/function/samples/plugin-error-module-parsed/000077500000000000000000000000001415504077600245635ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-error-module-parsed/_config.js000066400000000000000000000006051415504077600265260ustar00rootroot00000000000000const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/plugin-error-module-parsed/main.js000066400000000000000000000002021415504077600260370ustar00rootroot00000000000000let effect = false; var b = { get a() { effect = true; } }; function X() {} X.prototype = b; new X().a; assert.ok(effect); rollup-2.61.1/test/function/samples/plugin-error-only-first-render-chunk/000077500000000000000000000000001415504077600265135ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-error-only-first-render-chunk/_config.js000066400000000000000000000006721415504077600304620ustar00rootroot00000000000000module.exports = { description: 'throws error only with first plugin renderChunk', options: { plugins: [ { name: 'plugin1', renderChunk() { throw Error('Something happened 1'); } }, { name: 'plugin2', renderChunk() { throw Error('Something happened 2'); } } ] }, generateError: { code: 'PLUGIN_ERROR', plugin: 'plugin1', hook: 'renderChunk', message: `Something happened 1` } }; rollup-2.61.1/test/function/samples/plugin-error-only-first-render-chunk/main.js000066400000000000000000000000201415504077600277650ustar00rootroot00000000000000console.log(1); rollup-2.61.1/test/function/samples/plugin-error-only-first-transform/000077500000000000000000000000001415504077600261415ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-error-only-first-transform/_config.js000066400000000000000000000010411415504077600300770ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'throws error only with first plugin transform', options: { plugins: [ { name: 'plugin1', transform() { throw Error('Something happened 1'); } }, { name: 'plugin2', transform() { throw 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-2.61.1/test/function/samples/plugin-error-only-first-transform/main.js000066400000000000000000000000201415504077600274130ustar00rootroot00000000000000console.log(1); rollup-2.61.1/test/function/samples/plugin-error/000077500000000000000000000000001415504077600220245ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-error/buildEnd/000077500000000000000000000000001415504077600235525ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-error/buildEnd/_config.js000066400000000000000000000004251415504077600255150ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/plugin-error/buildEnd/main.js000066400000000000000000000000261415504077600250320ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-2.61.1/test/function/samples/plugin-error/buildStart/000077500000000000000000000000001415504077600241415ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-error/buildStart/_config.js000066400000000000000000000004311415504077600261010ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/plugin-error/buildStart/main.js000066400000000000000000000000261415504077600254210ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-2.61.1/test/function/samples/plugin-error/generateBundle/000077500000000000000000000000001415504077600247505ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-error/generateBundle/_config.js000066400000000000000000000004511415504077600267120ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/plugin-error/generateBundle/main.js000066400000000000000000000000261415504077600262300ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-2.61.1/test/function/samples/plugin-error/load/000077500000000000000000000000001415504077600227435ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-error/load/_config.js000066400000000000000000000006201415504077600247030ustar00rootroot00000000000000const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/plugin-error/load/main.js000066400000000000000000000000261415504077600242230ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-2.61.1/test/function/samples/plugin-error/renderChunk/000077500000000000000000000000001415504077600242745ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-error/renderChunk/_config.js000066400000000000000000000004431415504077600262370ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/plugin-error/renderChunk/main.js000066400000000000000000000000261415504077600255540ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-2.61.1/test/function/samples/plugin-error/renderStart/000077500000000000000000000000001415504077600243215ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-error/renderStart/_config.js000066400000000000000000000004431415504077600262640ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/plugin-error/renderStart/main.js000066400000000000000000000000261415504077600256010ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-2.61.1/test/function/samples/plugin-error/resolveId/000077500000000000000000000000001415504077600237605ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-error/resolveId/_config.js000066400000000000000000000004271415504077600257250ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/plugin-error/resolveId/main.js000066400000000000000000000000261415504077600252400ustar00rootroot00000000000000assert.equal( 1, 1 ); rollup-2.61.1/test/function/samples/plugin-error/transform/000077500000000000000000000000001415504077600240375ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-error/transform/_config.js000066400000000000000000000011341415504077600260000ustar00rootroot00000000000000const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/plugin-error/transform/main.js000066400000000000000000000000341415504077600253160ustar00rootroot00000000000000assert.equal( 21 * 2, TK ); rollup-2.61.1/test/function/samples/plugin-module-information-early-access/000077500000000000000000000000001415504077600270545ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-module-information-early-access/_config.js000066400000000000000000000006721415504077600310230ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = { description: 'handles accessing module information via plugins early in a graceful way', options: { external: ['path'], plugins: [ { buildStart() { assert.deepStrictEqual(Array.from(this.getModuleIds()), []); assert.strictEqual(this.getModuleInfo(ID_MAIN), null); } } ] } }; rollup-2.61.1/test/function/samples/plugin-module-information-early-access/main.js000066400000000000000000000000231415504077600303310ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/plugin-module-information/000077500000000000000000000000001415504077600245035ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-module-information/_config.js000066400000000000000000000226551415504077600264570ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); 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 = { description: 'provides module information on the plugin context', options: { external: ['path'], plugins: { load(id) { assert.deepStrictEqual(this.getModuleInfo(id), { ast: null, code: null, dynamicImporters: [], dynamicallyImportedIds: [], hasModuleSideEffects: true, id, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIds: [], importers: [], isEntry: id === ID_MAIN, isExternal: false, meta: {}, syntheticNamedExports: false }); }, renderStart() { rendered = true; assert.deepStrictEqual([...this.getModuleIds()], [ID_MAIN, ID_FOO, ID_PATH, ID_NESTED]); assert.deepStrictEqual( JSON.parse(JSON.stringify([...this.getModuleIds()].map(id => this.getModuleInfo(id)))), [ { 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", dynamicallyImportedIds: [ID_NESTED, ID_PATH], dynamicImporters: [], hasModuleSideEffects: true, id: ID_MAIN, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIds: [ID_FOO], importers: [], isEntry: true, isExternal: false, meta: {}, syntheticNamedExports: false }, { 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", dynamicallyImportedIds: [], dynamicImporters: [], hasModuleSideEffects: true, id: ID_FOO, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIds: [ID_PATH], importers: [ID_MAIN, ID_NESTED], isEntry: false, isExternal: false, meta: {}, syntheticNamedExports: false }, { ast: null, code: null, dynamicallyImportedIds: [], dynamicImporters: [ID_MAIN], hasModuleSideEffects: true, id: ID_PATH, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIds: [], importers: [ID_FOO], isEntry: false, isExternal: true, meta: {}, syntheticNamedExports: false }, { 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", dynamicallyImportedIds: [], dynamicImporters: [ID_MAIN], hasModuleSideEffects: true, id: ID_NESTED, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIds: [ID_FOO], importers: [], isEntry: false, isExternal: false, meta: {}, syntheticNamedExports: false } ] ); } } }, context: { thePath: 'path' }, bundle() { assert.ok(rendered); } }; rollup-2.61.1/test/function/samples/plugin-module-information/foo.js000066400000000000000000000001021415504077600256150ustar00rootroot00000000000000import path from 'path'; export const foo = path.resolve('foo'); rollup-2.61.1/test/function/samples/plugin-module-information/main.js000066400000000000000000000002371415504077600257670ustar00rootroot00000000000000export { foo } from './foo.js'; export const nested = import('./nested/nested'); export const path = import('path'); export const pathAgain = import(thePath); rollup-2.61.1/test/function/samples/plugin-module-information/nested/000077500000000000000000000000001415504077600257655ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-module-information/nested/nested.js000066400000000000000000000001101415504077600275750ustar00rootroot00000000000000import { foo } from '../foo.js'; export const nested = 'nested' + foo; rollup-2.61.1/test/function/samples/plugin-parse-ast-receives-comments/000077500000000000000000000000001415504077600262205ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-parse-ast-receives-comments/_config.js000066400000000000000000000006141415504077600301630ustar00rootroot00000000000000const assert = require('assert'); const comments = []; module.exports = { description: 'plugin parse ast receives comments', options: { plugins: [ { transform(code) { const ast = this.parse(code, { onComment(...args) { comments.push(args); } }); return { ast, code, map: null }; } } ] }, after() { assert.ok(comments.length > 0); } }; rollup-2.61.1/test/function/samples/plugin-parse-ast-receives-comments/main.js000066400000000000000000000001151415504077600274770ustar00rootroot00000000000000/* this is a comment */ export function main() { // this is also a comment }rollup-2.61.1/test/function/samples/plugin-parse-ast-remove-sourcemapping/000077500000000000000000000000001415504077600267375ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-parse-ast-remove-sourcemapping/_config.js000066400000000000000000000005631415504077600307050ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/plugin-parse-ast-remove-sourcemapping/main.js000066400000000000000000000003051415504077600302170ustar00rootroot00000000000000export function main() { } //# sourceMappingURL=http://example.com/path/to/your/sourcemap.map export function foo() { } /*# sourceMappingURL=http://example.com/path/to/your/sourcemap.map */ rollup-2.61.1/test/function/samples/plugin-parse/000077500000000000000000000000001415504077600220055ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-parse/_config.js000066400000000000000000000012201415504077600237420ustar00rootroot00000000000000const MagicString = require('magic-string'); module.exports = { 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) { ast.body.forEach(node => { if (node.type === 'VariableDeclaration') { node.declarations.forEach(decl => { if (decl.id.name === 'answer') { magicString.overwrite(decl.init.start, decl.init.end, '42'); } }); } }); } rollup-2.61.1/test/function/samples/plugin-parse/main.js000066400000000000000000000001231415504077600232630ustar00rootroot00000000000000const foo = 1; const answer = 41; assert.equal(foo, 1); assert.equal(answer, 42); rollup-2.61.1/test/function/samples/plugin-warn-loc-instead-pos/000077500000000000000000000000001415504077600246415ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-warn-loc-instead-pos/_config.js000066400000000000000000000012041415504077600266000ustar00rootroot00000000000000const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/plugin-warn-loc-instead-pos/main.js000066400000000000000000000000341415504077600261200ustar00rootroot00000000000000assert.equal( 21 * 2, TK ); rollup-2.61.1/test/function/samples/plugin-warn/000077500000000000000000000000001415504077600216425ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugin-warn/_config.js000066400000000000000000000014761415504077600236140ustar00rootroot00000000000000const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/plugin-warn/main.js000066400000000000000000000000341415504077600231210ustar00rootroot00000000000000assert.equal( 21 * 2, TK ); rollup-2.61.1/test/function/samples/plugins-can-manipulate-options/000077500000000000000000000000001415504077600254455ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/plugins-can-manipulate-options/_config.js000066400000000000000000000005041415504077600274060ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/plugins-can-manipulate-options/answer.js000066400000000000000000000000231415504077600272750ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/preload-cyclic-module/000077500000000000000000000000001415504077600235545ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preload-cyclic-module/_config.js000066400000000000000000000020131415504077600255120ustar00rootroot00000000000000module.exports = { description: 'handles pre-loading a cyclic module in the resolveId hook', warnings: [ { code: 'CIRCULAR_DEPENDENCY', cycle: ['main.js', 'main.js?proxy', 'main.js'], importer: 'main.js', 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.indexOf('/* use proxy */') >= 0) { 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-2.61.1/test/function/samples/preload-cyclic-module/main.js000066400000000000000000000002501415504077600250330ustar00rootroot00000000000000/* main *//* use proxy */ import { foo as bar, extra } from './main.js'; export const foo = 'foo'; assert.strictEqual(bar, 'foo'); assert.strictEqual(extra, 'extra'); rollup-2.61.1/test/function/samples/preload-loading-module/000077500000000000000000000000001415504077600237235ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preload-loading-module/_config.js000066400000000000000000000006121415504077600256640ustar00rootroot00000000000000const assert = require('assert'); let preloadedCode; module.exports = { 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(err) { assert.strictEqual(preloadedCode, 'assert.ok(true);\n'); } } ] } }; rollup-2.61.1/test/function/samples/preload-loading-module/main.js000066400000000000000000000000211415504077600251760ustar00rootroot00000000000000assert.ok(true); rollup-2.61.1/test/function/samples/preload-module/000077500000000000000000000000001415504077600223105ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preload-module/_config.js000066400000000000000000000057211415504077600242570ustar00rootroot00000000000000const assert = require('assert'); const path = require('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 = { 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, { code: "import './dep';\nassert.ok(true);\n", dynamicImporters: [], dynamicallyImportedIds: [], hasModuleSideEffects: true, id: ID_MAIN, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIds: [], importers: [], isEntry: false, isExternal: false, meta: { testPlugin: 'first' }, syntheticNamedExports: false }); assert.strictEqual(loadedModules.filter(id => id === ID_MAIN, 'loaded').length, 1); assert.strictEqual( transformedModules.filter(id => id === ID_MAIN, 'transformed').length, 1 ); assert.strictEqual(parsedModules.filter(id => id === ID_MAIN, 'parsed').length, 0); // No dependencies have been loaded yet assert.deepStrictEqual([...this.getModuleIds()], [ID_MAIN]); await this.load({ id: ID_OTHER }); assert.deepStrictEqual([...this.getModuleIds()], [ID_MAIN, ID_OTHER]); return resolvedId; } }, async buildEnd(err) { if (err) { 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, { code: 'assert.ok(true);\n', dynamicImporters: [], dynamicallyImportedIds: [], hasModuleSideEffects: true, id: ID_DEP, implicitlyLoadedAfterOneOf: [], implicitlyLoadedBefore: [], importedIds: [], importers: [ID_MAIN], isEntry: false, isExternal: false, meta: {}, syntheticNamedExports: false }); assert.strictEqual(loadedModules.filter(id => id === ID_DEP, 'loaded').length, 1); assert.strictEqual( transformedModules.filter(id => id === ID_DEP, 'transformed').length, 1 ); assert.strictEqual(parsedModules.filter(id => id === ID_DEP, 'parsed').length, 1); assert.deepStrictEqual([...this.getModuleIds()], [ID_MAIN, ID_OTHER, ID_DEP]); } } ] } }; rollup-2.61.1/test/function/samples/preload-module/dep.js000066400000000000000000000000211415504077600234070ustar00rootroot00000000000000assert.ok(true); rollup-2.61.1/test/function/samples/preload-module/main.js000066400000000000000000000000411415504077600235650ustar00rootroot00000000000000import './dep'; assert.ok(true); rollup-2.61.1/test/function/samples/preload-module/other-dep.js000066400000000000000000000000531415504077600245330ustar00rootroot00000000000000throw new Error('Should not be executed'); rollup-2.61.1/test/function/samples/preload-module/other.js000066400000000000000000000001011415504077600237570ustar00rootroot00000000000000import './other-dep'; throw new Error('Should not be executed'); rollup-2.61.1/test/function/samples/preserve-entry-signatures-empty-facade/000077500000000000000000000000001415504077600271105ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preserve-entry-signatures-empty-facade/_config.js000066400000000000000000000014461415504077600310570ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'warns when creating an empty facade and "preserveEntrySignatures" is not specified', options: { input: ['main.js'] }, warnings: [ { code: 'EMPTY_FACADE', id: path.join(__dirname, 'main.js'), message: `To preserve the export signature of the entry module "main.js", an empty facade chunk was created. This often happens when creating a bundle for a web app where chunks are placed in script tags and exports are ignored. In this case it is recommended to set "preserveEntrySignatures: false" to avoid this and reduce the number of chunks. Otherwise if this is intentional, set "preserveEntrySignatures: 'strict'" explicitly to silence this warning.`, url: 'https://rollupjs.org/guide/en/#preserveentrysignatures' } ] }; rollup-2.61.1/test/function/samples/preserve-entry-signatures-empty-facade/dynamic.js000066400000000000000000000000731415504077600310720ustar00rootroot00000000000000import { shared } from './lib.js'; global.shared = shared; rollup-2.61.1/test/function/samples/preserve-entry-signatures-empty-facade/lib.js000066400000000000000000000000401415504077600302060ustar00rootroot00000000000000export const shared = 'shared'; rollup-2.61.1/test/function/samples/preserve-entry-signatures-empty-facade/main.js000066400000000000000000000001231415504077600303660ustar00rootroot00000000000000import { shared } from './lib.js'; global.shared = shared; import('./dynamic.js'); rollup-2.61.1/test/function/samples/preserve-for-of-iterable/000077500000000000000000000000001415504077600242055ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preserve-for-of-iterable/_config.js000066400000000000000000000000771415504077600261530ustar00rootroot00000000000000module.exports = { description: 'preserves for...of loops' }; rollup-2.61.1/test/function/samples/preserve-for-of-iterable/iterables.js000066400000000000000000000007121415504077600265150ustar00rootroot00000000000000export 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-2.61.1/test/function/samples/preserve-for-of-iterable/loops.js000066400000000000000000000006531415504077600257030ustar00rootroot00000000000000export 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-2.61.1/test/function/samples/preserve-for-of-iterable/main.js000066400000000000000000000002421415504077600254650ustar00rootroot00000000000000import { zeroToFive, dirty } from './iterables'; import { iterate } from './loops'; assert.equal(dirty, undefined); iterate(zeroToFive); assert.equal(dirty, 5); rollup-2.61.1/test/function/samples/preserve-modules-circular-order/000077500000000000000000000000001415504077600256135ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preserve-modules-circular-order/_config.js000066400000000000000000000016701415504077600275610ustar00rootroot00000000000000const assert = require('assert'); const executionOrder = []; module.exports = { 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', cycle: ['data.js', 'tag.js', 'data.js'], importer: 'data.js', message: 'Circular dependency: data.js -> tag.js -> data.js' }, { code: 'CIRCULAR_DEPENDENCY', cycle: ['data.js', 'tag.js', 'index.js', 'data.js'], importer: 'data.js', message: 'Circular dependency: data.js -> tag.js -> index.js -> data.js' }, { code: 'CIRCULAR_DEPENDENCY', cycle: ['tag.js', 'index.js', 'tag.js'], importer: 'tag.js', message: 'Circular dependency: tag.js -> index.js -> tag.js' } ] }; rollup-2.61.1/test/function/samples/preserve-modules-circular-order/data.js000066400000000000000000000002411415504077600270570ustar00rootroot00000000000000import { Tag } from './tag.js'; import './index.js'; executionOrder.push('data'); export const data = () => 'data'; export const Data = () => `Tag: ${Tag()}`; rollup-2.61.1/test/function/samples/preserve-modules-circular-order/index.js000066400000000000000000000002041415504077600272540ustar00rootroot00000000000000import { Data, data } from './data.js'; import { Tag } from './tag.js'; executionOrder.push('index'); export { Data, data, Tag }; rollup-2.61.1/test/function/samples/preserve-modules-circular-order/main.js000066400000000000000000000002111415504077600270670ustar00rootroot00000000000000import { Data } from './data.js'; import { Tag } from './tag.js'; import './index.js'; executionOrder.push(`main: ${Data()} ${Tag()}`); rollup-2.61.1/test/function/samples/preserve-modules-circular-order/tag.js000066400000000000000000000002101415504077600267150ustar00rootroot00000000000000import * as D from './data.js'; import './index.js'; executionOrder.push('tag'); export function Tag() { return `Tag ${D.data()}`; } rollup-2.61.1/test/function/samples/preserve-modules-default-mode-namespace/000077500000000000000000000000001415504077600271765ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preserve-modules-default-mode-namespace/_config.js000066400000000000000000000005231415504077600311400ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/preserve-modules-default-mode-namespace/lib.js000066400000000000000000000000261415504077600303000ustar00rootroot00000000000000export default 'foo'; rollup-2.61.1/test/function/samples/preserve-modules-default-mode-namespace/main.js000066400000000000000000000000611415504077600304550ustar00rootroot00000000000000import * as lib from './lib.js'; export { lib }; rollup-2.61.1/test/function/samples/preserve-modules/000077500000000000000000000000001415504077600227005ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preserve-modules/inline-dynamic-imports/000077500000000000000000000000001415504077600272735ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preserve-modules/inline-dynamic-imports/_config.js000066400000000000000000000007161415504077600312410ustar00rootroot00000000000000module.exports = { 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/guide/en/#outputinlinedynamicimports' } }; rollup-2.61.1/test/function/samples/preserve-modules/inline-dynamic-imports/lib.js000066400000000000000000000000311415504077600303710ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/function/samples/preserve-modules/inline-dynamic-imports/main.js000066400000000000000000000000741415504077600305560ustar00rootroot00000000000000import('./lib').then(({value}) => assert.equal(value, 42)); rollup-2.61.1/test/function/samples/preserve-modules/invalid-default-export-mode/000077500000000000000000000000001415504077600302115ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preserve-modules/invalid-default-export-mode/_config.js000066400000000000000000000005651415504077600321610ustar00rootroot00000000000000module.exports = { 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' } }; rollup-2.61.1/test/function/samples/preserve-modules/invalid-default-export-mode/lib.js000066400000000000000000000000311415504077600313070ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/function/samples/preserve-modules/invalid-default-export-mode/main.js000066400000000000000000000001161415504077600314710ustar00rootroot00000000000000import { value } from './lib.js'; assert.equal(value, 42); export default 43; rollup-2.61.1/test/function/samples/preserve-modules/invalid-no-preserve-entry-signatures/000077500000000000000000000000001415504077600321125ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preserve-modules/invalid-no-preserve-entry-signatures/_config.js000066400000000000000000000007111415504077600340530ustar00rootroot00000000000000module.exports = { 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/guide/en/#preserveentrysignatures' } }; rollup-2.61.1/test/function/samples/preserve-modules/invalid-no-preserve-entry-signatures/main.js000066400000000000000000000000311415504077600333660ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/function/samples/preserve-modules/invalid-none-export-mode/000077500000000000000000000000001415504077600275245ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preserve-modules/invalid-none-export-mode/_config.js000066400000000000000000000005541415504077600314720ustar00rootroot00000000000000module.exports = { 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' } }; rollup-2.61.1/test/function/samples/preserve-modules/invalid-none-export-mode/lib.js000066400000000000000000000000311415504077600306220ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/function/samples/preserve-modules/invalid-none-export-mode/main.js000066400000000000000000000000741415504077600310070ustar00rootroot00000000000000import { value } from './lib.js'; assert.equal(value, 42); rollup-2.61.1/test/function/samples/preserve-modules/manual-chunks/000077500000000000000000000000001415504077600254465ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preserve-modules/manual-chunks/_config.js000066400000000000000000000007001415504077600274050ustar00rootroot00000000000000module.exports = { 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/guide/en/#outputmanualchunks' } }; rollup-2.61.1/test/function/samples/preserve-modules/manual-chunks/lib.js000066400000000000000000000000311415504077600265440ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/function/samples/preserve-modules/manual-chunks/main.js000066400000000000000000000000711415504077600267260ustar00rootroot00000000000000import { value } from './lib'; assert.equal(value, 42); rollup-2.61.1/test/function/samples/preserve-modules/mixed-exports/000077500000000000000000000000001415504077600255105ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preserve-modules/mixed-exports/_config.js000066400000000000000000000017611415504077600274570ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'warns for mixed exports in all chunks when preserving modules', options: { input: ['main.js'], output: { preserveModules: true } }, warnings: [ { code: 'MIXED_EXPORTS', id: path.join(__dirname, 'main.js'), 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/guide/en/#outputexports' }, { code: 'MIXED_EXPORTS', id: path.join(__dirname, 'lib1.js'), 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/guide/en/#outputexports' } ] }; rollup-2.61.1/test/function/samples/preserve-modules/mixed-exports/lib1.js000066400000000000000000000000551415504077600266750ustar00rootroot00000000000000export const value1 = 42; export default 42; rollup-2.61.1/test/function/samples/preserve-modules/mixed-exports/lib2.js000066400000000000000000000000231415504077600266710ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/preserve-modules/mixed-exports/lib3.js000066400000000000000000000000321415504077600266720ustar00rootroot00000000000000export const value3 = 42; rollup-2.61.1/test/function/samples/preserve-modules/mixed-exports/main.js000066400000000000000000000003651415504077600267760ustar00rootroot00000000000000import 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-2.61.1/test/function/samples/preserve-modules/virtual-modules-conflict/000077500000000000000000000000001415504077600276335ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preserve-modules/virtual-modules-conflict/_config.js000066400000000000000000000014401415504077600315740ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/preserve-modules/virtual-modules-conflict/_virtual/000077500000000000000000000000001415504077600314605ustar00rootroot00000000000000_virtualModule.js000066400000000000000000000001101415504077600347220ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preserve-modules/virtual-modules-conflict/_virtualexport const notSoVirtual = 'real'; assert.equal(virtual, 'Virtual!'); rollup-2.61.1/test/function/samples/preserve-modules/virtual-modules-conflict/main.js000066400000000000000000000002021415504077600311070ustar00rootroot00000000000000import { notSoVirtual } from './_virtual/_virtualModule'; assert.equal(virtual, 'Virtual!'); assert.equal(notSoVirtual, 'real'); rollup-2.61.1/test/function/samples/preserve-modules/virtual-modules/000077500000000000000000000000001415504077600260345ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preserve-modules/virtual-modules/_config.js000066400000000000000000000014031415504077600277740ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/preserve-modules/virtual-modules/lib/000077500000000000000000000000001415504077600266025ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preserve-modules/virtual-modules/lib/lib.js000066400000000000000000000000431415504077600277030ustar00rootroot00000000000000assert.equal(virtual, 'Virtual!'); rollup-2.61.1/test/function/samples/preserve-modules/virtual-modules/main.js000066400000000000000000000000731415504077600273160ustar00rootroot00000000000000import './lib/lib.js'; assert.equal(virtual, 'Virtual!'); rollup-2.61.1/test/function/samples/preserve-symlink/000077500000000000000000000000001415504077600227165ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preserve-symlink/_config.js000066400000000000000000000002051415504077600246550ustar00rootroot00000000000000module.exports = { skip: process.platform === 'win32', description: 'follows symlinks', options: { preserveSymlinks: true } }; rollup-2.61.1/test/function/samples/preserve-symlink/bar.js000066400000000000000000000000561415504077600240210ustar00rootroot00000000000000export default function () { return 'BAR'; } rollup-2.61.1/test/function/samples/preserve-symlink/foo.js000077700000000000000000000000001415504077600271522symlinked/foo.jsustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preserve-symlink/main.js000066400000000000000000000000701415504077600241750ustar00rootroot00000000000000import foo from './foo.js'; assert.equal( foo, 'BAR' ); rollup-2.61.1/test/function/samples/preserve-symlink/symlinked/000077500000000000000000000000001415504077600247155ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preserve-symlink/symlinked/foo.js000066400000000000000000000000621415504077600260340ustar00rootroot00000000000000import bar from './bar.js'; export default bar(); rollup-2.61.1/test/function/samples/preserves-catch-argument/000077500000000000000000000000001415504077600243155ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preserves-catch-argument/_config.js000066400000000000000000000001741415504077600262610ustar00rootroot00000000000000module.exports = { description: 'does not replace argument to catch block (#1462)', options: { external: ['path'] } }; rollup-2.61.1/test/function/samples/preserves-catch-argument/main.js000066400000000000000000000003241415504077600255760ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/preserves-default-exports-used-locally/000077500000000000000000000000001415504077600271345ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preserves-default-exports-used-locally/_config.js000066400000000000000000000001421415504077600310730ustar00rootroot00000000000000module.exports = { description: 'preserves default exports that are only used locally (#984)' }; rollup-2.61.1/test/function/samples/preserves-default-exports-used-locally/foo.js000066400000000000000000000000741415504077600302560ustar00rootroot00000000000000export default function foo () { global.foo = 1; } foo(); rollup-2.61.1/test/function/samples/preserves-default-exports-used-locally/main.js000066400000000000000000000000571415504077600304200ustar00rootroot00000000000000import './foo'; assert.equal( global.foo, 1 ); rollup-2.61.1/test/function/samples/preserves-function-expression-names/000077500000000000000000000000001415504077600265365ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preserves-function-expression-names/_config.js000066400000000000000000000004331415504077600305000ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/preserves-function-expression-names/main.js000066400000000000000000000002011415504077600300110ustar00rootroot00000000000000import { basename } from 'path'; var x = function basename () {}; var y = basename( 'path/to/somefile.txt' ); export { x, y }; rollup-2.61.1/test/function/samples/preserves-var-declarations-in-dead-branches/000077500000000000000000000000001415504077600277335ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/preserves-var-declarations-in-dead-branches/_config.js000066400000000000000000000001311415504077600316700ustar00rootroot00000000000000module.exports = { description: 'preserves var declarations in dead branches (#977)' }; rollup-2.61.1/test/function/samples/preserves-var-declarations-in-dead-branches/main.js000066400000000000000000000000741415504077600312160ustar00rootroot00000000000000if ( false ) { var foo; } assert.equal( foo, undefined ); rollup-2.61.1/test/function/samples/prevent-asi-with-line-comments/000077500000000000000000000000001415504077600253555ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/prevent-asi-with-line-comments/_config.js000066400000000000000000000003241415504077600273160ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'prevent semicolon insertion for return statements when there are line comments', exports(exports) { assert.strictEqual(exports(), 1); } }; rollup-2.61.1/test/function/samples/prevent-asi-with-line-comments/main.js000066400000000000000000000000771415504077600266430ustar00rootroot00000000000000export default function () { return true && // comment 1; } rollup-2.61.1/test/function/samples/prevent-context-resolve-loop/000077500000000000000000000000001415504077600251705ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/prevent-context-resolve-loop/_config.js000066400000000000000000000033421415504077600271340ustar00rootroot00000000000000const assert = require('assert'); const path = require('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 = { 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-2.61.1/test/function/samples/prevent-context-resolve-loop/dep.js000066400000000000000000000001001415504077600262650ustar00rootroot00000000000000import third from './other3.js'; assert.strictEqual(third, 4); rollup-2.61.1/test/function/samples/prevent-context-resolve-loop/main.js000066400000000000000000000002241415504077600264500ustar00rootroot00000000000000import first from './other1.js'; import second from './other2.js'; import './dep.js'; assert.strictEqual(first, 4); assert.strictEqual(second, 4); rollup-2.61.1/test/function/samples/prevent-context-resolve-loop/other1.js000066400000000000000000000000221415504077600267220ustar00rootroot00000000000000export default 1; rollup-2.61.1/test/function/samples/prevent-context-resolve-loop/other2.js000066400000000000000000000000221415504077600267230ustar00rootroot00000000000000export default 2; rollup-2.61.1/test/function/samples/prevent-context-resolve-loop/other3.js000066400000000000000000000000221415504077600267240ustar00rootroot00000000000000export default 3; rollup-2.61.1/test/function/samples/prevent-context-resolve-loop/other4.js000066400000000000000000000000221415504077600267250ustar00rootroot00000000000000export default 4; rollup-2.61.1/test/function/samples/prevent-tree-shaking-asi/000077500000000000000000000000001415504077600242135ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/prevent-tree-shaking-asi/_config.js000066400000000000000000000002651415504077600261600ustar00rootroot00000000000000module.exports = { description: 'prevent automatic semicolon insertion from changing behaviour when tree-shaking', options: { treeshake: { tryCatchDeoptimization: false } } }; rollup-2.61.1/test/function/samples/prevent-tree-shaking-asi/main.js000066400000000000000000000017251415504077600255020ustar00rootroot00000000000000function 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-2.61.1/test/function/samples/property-keys-not-renamed/000077500000000000000000000000001415504077600244435ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/property-keys-not-renamed/_config.js000066400000000000000000000001041415504077600264000ustar00rootroot00000000000000module.exports = { description: 'does not rename property keys' }; rollup-2.61.1/test/function/samples/property-keys-not-renamed/main.js000066400000000000000000000002561415504077600257300ustar00rootroot00000000000000import one from './one'; import two from './two'; import three from './three'; assert.equal( one(), 'one' ); assert.equal( two(), 'two' ); assert.equal( three(), 'three' ); rollup-2.61.1/test/function/samples/property-keys-not-renamed/one.js000066400000000000000000000001601415504077600255570ustar00rootroot00000000000000var obj = { foo: foo }; function foo () { return 'one'; } export default function () { return obj.foo(); } rollup-2.61.1/test/function/samples/property-keys-not-renamed/three.js000066400000000000000000000001621415504077600261070ustar00rootroot00000000000000var obj = { foo: foo }; function foo () { return 'three'; } export default function () { return obj.foo(); } rollup-2.61.1/test/function/samples/property-keys-not-renamed/two.js000066400000000000000000000001601415504077600256070ustar00rootroot00000000000000var obj = { foo: foo }; function foo () { return 'two'; } export default function () { return obj.foo(); } rollup-2.61.1/test/function/samples/propertyReadSideEffects-always/000077500000000000000000000000001415504077600254625ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/propertyReadSideEffects-always/_config.js000066400000000000000000000002521415504077600274230ustar00rootroot00000000000000module.exports = { description: 'verify property accesses are retained for getters with side effects', options: { treeshake: { propertyReadSideEffects: 'always' } } }; rollup-2.61.1/test/function/samples/propertyReadSideEffects-always/main.js000066400000000000000000000002661415504077600267500ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/protect-cjs-globals/000077500000000000000000000000001415504077600232555ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/protect-cjs-globals/_config.js000066400000000000000000000001201415504077600252100ustar00rootroot00000000000000module.exports = { description: 'prevent conflicts with cjs module globals' }; rollup-2.61.1/test/function/samples/protect-cjs-globals/main.js000066400000000000000000000002061415504077600245350ustar00rootroot00000000000000export const exports = 1; export const require = 2; export const module = 3; export const __filename = 4; export const __dirname = 5; rollup-2.61.1/test/function/samples/proto-accessors/000077500000000000000000000000001415504077600225255ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/proto-accessors/_config.js000066400000000000000000000001321415504077600244630ustar00rootroot00000000000000module.exports = { description: 'handles getters and setters on __proto__ properties' }; rollup-2.61.1/test/function/samples/proto-accessors/main.js000066400000000000000000000005431415504077600240110ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/re-export-default-import/000077500000000000000000000000001415504077600242565ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/re-export-default-import/_config.js000066400000000000000000000002721415504077600262210ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/re-export-default-import/first.js000066400000000000000000000000601415504077600257370ustar00rootroot00000000000000export default function hi() { return 'hi'; } rollup-2.61.1/test/function/samples/re-export-default-import/main.js000066400000000000000000000000711415504077600255360ustar00rootroot00000000000000import { hi } from './second'; assert.equal(hi(), 'hi'); rollup-2.61.1/test/function/samples/re-export-default-import/second.js000066400000000000000000000000511415504077600260630ustar00rootroot00000000000000import hi from './first'; export { hi }; rollup-2.61.1/test/function/samples/re-export-namespace-import/000077500000000000000000000000001415504077600245665ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/re-export-namespace-import/_config.js000066400000000000000000000002761415504077600265350ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/re-export-namespace-import/first.js000066400000000000000000000000441415504077600262510ustar00rootroot00000000000000export var a = 1; export var b = 2; rollup-2.61.1/test/function/samples/re-export-namespace-import/main.js000066400000000000000000000001351415504077600260470ustar00rootroot00000000000000import { mod } from './second'; assert.strictEqual(mod.a, 1); assert.strictEqual(mod.b, 2); rollup-2.61.1/test/function/samples/re-export-namespace-import/second.js000066400000000000000000000000601415504077600263730ustar00rootroot00000000000000import * as mod from './first'; export { mod }; rollup-2.61.1/test/function/samples/reassign-array-literal-elements/000077500000000000000000000000001415504077600255725ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/reassign-array-literal-elements/_config.js000066400000000000000000000001351415504077600275330ustar00rootroot00000000000000module.exports = { description: 'makes sure reassignments of array elements are tracked' }; rollup-2.61.1/test/function/samples/reassign-array-literal-elements/main.js000066400000000000000000000002301415504077600270470ustar00rootroot00000000000000var 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-2.61.1/test/function/samples/reassign-computed-prototype/000077500000000000000000000000001415504077600250735ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/reassign-computed-prototype/_config.js000066400000000000000000000002041415504077600270310ustar00rootroot00000000000000module.exports = { description: 'reassign function prototype via computed property access', context: { proto: 'prototype' } }; rollup-2.61.1/test/function/samples/reassign-computed-prototype/main.js000066400000000000000000000003121415504077600263510ustar00rootroot00000000000000function 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-2.61.1/test/function/samples/reassign-constructor-parameter-property/000077500000000000000000000000001415504077600274355ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/reassign-constructor-parameter-property/_config.js000066400000000000000000000001421415504077600313740ustar00rootroot00000000000000module.exports = { description: 'track reassignments of properties of constructor parameters' }; rollup-2.61.1/test/function/samples/reassign-constructor-parameter-property/main.js000066400000000000000000000003111415504077600307120ustar00rootroot00000000000000const obj = { flag: false }; function Reassign(x) { x.flag = true; } new Reassign(obj); let hasBeenReassigned = false; if (obj.flag) { hasBeenReassigned = true; } assert.ok(hasBeenReassigned); rollup-2.61.1/test/function/samples/reassign-double-declarations/000077500000000000000000000000001415504077600251305ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/reassign-double-declarations/_config.js000066400000000000000000000002011415504077600270630ustar00rootroot00000000000000module.exports = { description: 'makes sure reassignments of double declared variables and their initializers are tracked' }; rollup-2.61.1/test/function/samples/reassign-double-declarations/main.js000066400000000000000000000003731415504077600264150ustar00rootroot00000000000000var 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-2.61.1/test/function/samples/reassign-empty-objects/000077500000000000000000000000001415504077600237755ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/reassign-empty-objects/_config.js000066400000000000000000000001231415504077600257330ustar00rootroot00000000000000module.exports = { description: 'track reassignments of empty objects (#2306)' }; rollup-2.61.1/test/function/samples/reassign-empty-objects/main.js000066400000000000000000000005131415504077600252560ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/reassign-for-loop-declarations/000077500000000000000000000000001415504077600254135ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/reassign-for-loop-declarations/_config.js000066400000000000000000000001051415504077600273510ustar00rootroot00000000000000module.exports = { description: 'reassign for-loop declarations' }; rollup-2.61.1/test/function/samples/reassign-for-loop-declarations/main.js000066400000000000000000000004541415504077600267000ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/reassign-import-fails/000077500000000000000000000000001415504077600236165ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/reassign-import-fails/_config.js000066400000000000000000000011161415504077600255570ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'disallows assignments to imported bindings', error: { code: 'ILLEGAL_REASSIGNMENT', message: `Illegal reassignment to import 'x'`, id: path.join(__dirname, 'main.js'), pos: 113, watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'foo.js')], loc: { file: path.join(__dirname, 'main.js'), line: 8, column: 0 }, frame: ` 6: }); 7: 8: x = 10; ^ ` } }; // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/reassign-import-fails rollup-2.61.1/test/function/samples/reassign-import-fails/foo.js000066400000000000000000000000221415504077600247310ustar00rootroot00000000000000export var x = 1; rollup-2.61.1/test/function/samples/reassign-import-fails/main.js000066400000000000000000000001711415504077600250770ustar00rootroot00000000000000import { x } from './foo'; (function() { for(var x = 0; x < 1; x++){} for(var x = 0; x < 1; x++){} }); x = 10; rollup-2.61.1/test/function/samples/reassign-import-not-at-top-level-fails/000077500000000000000000000000001415504077600267235ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/reassign-import-not-at-top-level-fails/_config.js000066400000000000000000000012041415504077600306620ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'disallows assignments to imported bindings not at the top level', error: { code: 'ILLEGAL_REASSIGNMENT', message: `Illegal reassignment to import 'x'`, id: path.join(__dirname, 'main.js'), pos: 95, watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'foo.js')], loc: { file: path.join(__dirname, 'main.js'), line: 7, column: 2 }, frame: ` 5: } 6: export function bar () { 7: x = 1; ^ 8: } ` } }; // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/reassign-import-fails rollup-2.61.1/test/function/samples/reassign-import-not-at-top-level-fails/foo.js000066400000000000000000000000221415504077600300360ustar00rootroot00000000000000export var x = 1; rollup-2.61.1/test/function/samples/reassign-import-not-at-top-level-fails/main.js000066400000000000000000000001501415504077600302010ustar00rootroot00000000000000import { x } from './foo'; export function foo () { var x = 1; } export function bar () { x = 1; } rollup-2.61.1/test/function/samples/reassign-namespace/000077500000000000000000000000001415504077600231445ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/reassign-namespace/_config.js000066400000000000000000000001661415504077600251110ustar00rootroot00000000000000module.exports = { description: 'members of namespaces are reassigned when the namespace is passed to a function' }; rollup-2.61.1/test/function/samples/reassign-namespace/foo.js000066400000000000000000000002201415504077600242570ustar00rootroot00000000000000const flags = {}; function test() { if (!flags.x) { throw new Error('Flag "x" not set'); } assert.ok(flags.x); } export { flags, test }; rollup-2.61.1/test/function/samples/reassign-namespace/main.js000066400000000000000000000001711415504077600244250ustar00rootroot00000000000000import * as foo from './foo.js'; function reassignFlagX(obj) { obj.flags.x = true; } reassignFlagX(foo); foo.test(); rollup-2.61.1/test/function/samples/reassign-object-literal-1/000077500000000000000000000000001415504077600242465ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/reassign-object-literal-1/_config.js000066400000000000000000000001221415504077600262030ustar00rootroot00000000000000module.exports = { description: 'track reassignments through object literals' }; rollup-2.61.1/test/function/samples/reassign-object-literal-1/main.js000066400000000000000000000003261415504077600255310ustar00rootroot00000000000000let triggered = false; const obj = { reassigned() {} }; let y = obj; reassign(); y = null; function reassign() { y.reassigned = function() { triggered = true; }; } obj.reassigned(); assert.ok(triggered); rollup-2.61.1/test/function/samples/reassign-object-literal-2/000077500000000000000000000000001415504077600242475ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/reassign-object-literal-2/_config.js000066400000000000000000000001221415504077600262040ustar00rootroot00000000000000module.exports = { description: 'track reassignments through object literals' }; rollup-2.61.1/test/function/samples/reassign-object-literal-2/main.js000066400000000000000000000003031415504077600255250ustar00rootroot00000000000000let triggered = false; const obj = { reassigned() {} }; global.wrapper = { obj }; global.wrapper.obj.reassigned = function() { triggered = true; }; obj.reassigned(); assert.ok(triggered); rollup-2.61.1/test/function/samples/reassign-parameter-property/000077500000000000000000000000001415504077600250525ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/reassign-parameter-property/_config.js000066400000000000000000000001371415504077600270150ustar00rootroot00000000000000module.exports = { description: 'track reassignments of properties of function parameters' }; rollup-2.61.1/test/function/samples/reassign-parameter-property/main.js000066400000000000000000000003051415504077600263320ustar00rootroot00000000000000const obj = { flag: false }; function reassign(x) { x.flag = true; } reassign(obj); let hasBeenReassigned = false; if (obj.flag) { hasBeenReassigned = true; } assert.ok(hasBeenReassigned); rollup-2.61.1/test/function/samples/reassign-parameter/000077500000000000000000000000001415504077600231705ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/reassign-parameter/_config.js000066400000000000000000000001131415504077600251250ustar00rootroot00000000000000module.exports = { description: 'parameters can be reassigned/updated' }; rollup-2.61.1/test/function/samples/reassign-parameter/main.js000066400000000000000000000002361415504077600244530ustar00rootroot00000000000000function 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-2.61.1/test/function/samples/reassign-pattern-defaults/000077500000000000000000000000001415504077600244725ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/reassign-pattern-defaults/_config.js000066400000000000000000000001371415504077600264350ustar00rootroot00000000000000module.exports = { description: 'makes sure reassignments of pattern defaults are tracked' }; rollup-2.61.1/test/function/samples/reassign-pattern-defaults/main.js000066400000000000000000000001631415504077600257540ustar00rootroot00000000000000var foo = {x: true}; var {bar: bar = foo} = {}; bar.x = false; if (foo.x) assert.fail('foo was not reassigned'); rollup-2.61.1/test/function/samples/reassign-return-expression/000077500000000000000000000000001415504077600247245ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/reassign-return-expression/_config.js000066400000000000000000000001401415504077600266610ustar00rootroot00000000000000module.exports = { description: 'track reassignments of single function return expressions' }; rollup-2.61.1/test/function/samples/reassign-return-expression/main.js000066400000000000000000000002751415504077600262120ustar00rootroot00000000000000const obj = { flag: false }; const getObj = () => obj; getObj().flag = true; let hasBeenReassigned = false; if (obj.flag) { hasBeenReassigned = true; } assert.ok(hasBeenReassigned); rollup-2.61.1/test/function/samples/reassign-return-expressions/000077500000000000000000000000001415504077600251075ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/reassign-return-expressions/_config.js000066400000000000000000000001421415504077600270460ustar00rootroot00000000000000module.exports = { description: 'track reassignments of multiple function return expressions' }; rollup-2.61.1/test/function/samples/reassign-return-expressions/main.js000066400000000000000000000003541415504077600263730ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/reassigned-return-expression/000077500000000000000000000000001415504077600252355ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/reassigned-return-expression/_config.js000066400000000000000000000001541415504077600271770ustar00rootroot00000000000000module.exports = { description: 'does not bind return expressions before assignments are bound (#3382)' }; rollup-2.61.1/test/function/samples/reassigned-return-expression/main.js000066400000000000000000000003641415504077600265220ustar00rootroot00000000000000function 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-2.61.1/test/function/samples/recursive-parameter-assignments/000077500000000000000000000000001415504077600257155ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/recursive-parameter-assignments/_config.js000066400000000000000000000001631415504077600276570ustar00rootroot00000000000000module.exports = { description: 'Avoid maximum call stack error with recursive parameter assignments (#1710).' }; rollup-2.61.1/test/function/samples/recursive-parameter-assignments/main.js000066400000000000000000000003571415504077600272040ustar00rootroot00000000000000class 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-2.61.1/test/function/samples/redeclare-parameter/000077500000000000000000000000001415504077600233035ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/redeclare-parameter/_config.js000066400000000000000000000001171415504077600252440ustar00rootroot00000000000000module.exports = { description: 'associates redeclared parameters (#2451)' }; rollup-2.61.1/test/function/samples/redeclare-parameter/main.js000066400000000000000000000007101415504077600245630ustar00rootroot00000000000000function 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-2.61.1/test/function/samples/reexport-from-synthetic/000077500000000000000000000000001415504077600242205ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/reexport-from-synthetic/_config.js000066400000000000000000000003411415504077600261600ustar00rootroot00000000000000module.exports = { description: 'handles reexporting a synthetic namespace from a non-synthetic module', options: { plugins: [ { transform() { return { syntheticNamedExports: '__synth' }; } } ] } }; rollup-2.61.1/test/function/samples/reexport-from-synthetic/main.js000066400000000000000000000002371415504077600255040ustar00rootroot00000000000000import { synth, explicit1, explicit2 } from './reexport.js'; assert.strictEqual(synth, 1); assert.strictEqual(explicit1, 2); assert.strictEqual(explicit2, 4); rollup-2.61.1/test/function/samples/reexport-from-synthetic/reexport.js000066400000000000000000000001021415504077600264170ustar00rootroot00000000000000export * from './synthetic1.js'; export * from './synthetic2.js'; rollup-2.61.1/test/function/samples/reexport-from-synthetic/synthetic1.js000066400000000000000000000001011415504077600266410ustar00rootroot00000000000000export const __synth = { synth: 1 }; export const explicit1 = 2; rollup-2.61.1/test/function/samples/reexport-from-synthetic/synthetic2.js000066400000000000000000000001011415504077600266420ustar00rootroot00000000000000export const __synth = { synth: 3 }; export const explicit2 = 4; rollup-2.61.1/test/function/samples/reexport-missing-error/000077500000000000000000000000001415504077600240455ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/reexport-missing-error/_config.js000066400000000000000000000011331415504077600260050ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'reexporting a missing identifier should print an error', error: { code: 'MISSING_EXPORT', message: `'foo' is not exported by empty.js, imported by main.js`, id: path.join(__dirname, 'main.js'), pos: 9, watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'empty.js')], loc: { file: path.join(__dirname, 'main.js'), line: 1, column: 9 }, frame: ` 1: export { foo as bar } from './empty.js'; ^ `, url: 'https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module' } }; rollup-2.61.1/test/function/samples/reexport-missing-error/empty.js000066400000000000000000000000471415504077600255420ustar00rootroot00000000000000// this space left intentionally blank rollup-2.61.1/test/function/samples/reexport-missing-error/main.js000066400000000000000000000000511415504077600253230ustar00rootroot00000000000000export { foo as bar } from './empty.js'; rollup-2.61.1/test/function/samples/reexport-ns/000077500000000000000000000000001415504077600216655ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/reexport-ns/_config.js000066400000000000000000000005741415504077600236350ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'external namespace reexport', options: { 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); } }; rollup-2.61.1/test/function/samples/reexport-ns/main.js000066400000000000000000000000741415504077600231500ustar00rootroot00000000000000import * as maths from './maths.js'; export default maths; rollup-2.61.1/test/function/samples/reexport-ns/maths.js000066400000000000000000000000601415504077600233330ustar00rootroot00000000000000export { default as maths } from './square.js'; rollup-2.61.1/test/function/samples/reexport-ns/square.js000066400000000000000000000000611415504077600235200ustar00rootroot00000000000000import * as m from 'external'; export default m; rollup-2.61.1/test/function/samples/reexports-from-external/000077500000000000000000000000001415504077600242135ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/reexports-from-external/_config.js000066400000000000000000000005501415504077600261550ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/reexports-from-external/main.js000066400000000000000000000000321415504077600254700ustar00rootroot00000000000000export * from 'external'; rollup-2.61.1/test/function/samples/relative-external-include-once-nested/000077500000000000000000000000001415504077600266555ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/relative-external-include-once-nested/_config.js000066400000000000000000000006011415504077600306140ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/relative-external-include-once-nested/first/000077500000000000000000000000001415504077600300045ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/relative-external-include-once-nested/first/foo.js000066400000000000000000000000001415504077600311130ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/relative-external-include-once-nested/first/module.js000066400000000000000000000001351415504077600316260ustar00rootroot00000000000000import foo from './foo'; import second from './second/module'; export default foo + second; rollup-2.61.1/test/function/samples/relative-external-include-once-nested/first/second/000077500000000000000000000000001415504077600312575ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/relative-external-include-once-nested/first/second/module.js000066400000000000000000000000571415504077600331040ustar00rootroot00000000000000import foo from '../foo'; export default foo; rollup-2.61.1/test/function/samples/relative-external-include-once-nested/main.js000066400000000000000000000001401415504077600301320ustar00rootroot00000000000000import foo from './first/foo'; import first from './first/module'; export default foo + first; rollup-2.61.1/test/function/samples/relative-external-include-once-two-external/000077500000000000000000000000001415504077600300245ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/relative-external-include-once-two-external/_config.js000066400000000000000000000010721415504077600317660ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { description: 'includes a relative external module only once (two external deps)', options: { external: [path.join(__dirname, './foo.js'), path.join(__dirname, './first/foo.js')] }, context: { require(required) { assert(['./foo.js', './first/foo.js'].indexOf(required) !== -1, 'required wrong module'); return required === './foo.js' ? 'a' : 'b'; } }, exports(exports) { assert(exports === 'ab' || exports === 'ba', 'two different modules should be required'); } }; rollup-2.61.1/test/function/samples/relative-external-include-once-two-external/first/000077500000000000000000000000001415504077600311535ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/relative-external-include-once-two-external/first/foo.js000066400000000000000000000000001415504077600322620ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/relative-external-include-once-two-external/first/module.js000066400000000000000000000000561415504077600327770ustar00rootroot00000000000000import foo from './foo'; export default foo; rollup-2.61.1/test/function/samples/relative-external-include-once-two-external/foo.js000066400000000000000000000000001415504077600311330ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/relative-external-include-once-two-external/main.js000066400000000000000000000001321415504077600313020ustar00rootroot00000000000000import foo from './foo'; import first from './first/module'; export default foo + first; rollup-2.61.1/test/function/samples/relative-external-include-once-up/000077500000000000000000000000001415504077600260175ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/relative-external-include-once-up/_config.js000066400000000000000000000006631415504077600277660ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/relative-external-include-once-up/first/000077500000000000000000000000001415504077600271465ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/relative-external-include-once-up/first/main.js000066400000000000000000000001251415504077600304260ustar00rootroot00000000000000import foo from '../foo'; import first from './module'; export default foo + first; rollup-2.61.1/test/function/samples/relative-external-include-once-up/first/module.js000066400000000000000000000001361415504077600307710ustar00rootroot00000000000000import foo from '../foo'; import second from './second/module'; export default foo + second; rollup-2.61.1/test/function/samples/relative-external-include-once-up/first/second/000077500000000000000000000000001415504077600304215ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/relative-external-include-once-up/first/second/module.js000066400000000000000000000000621415504077600322420ustar00rootroot00000000000000import foo from '../../foo'; export default foo; rollup-2.61.1/test/function/samples/relative-external-include-once-up/foo.js000066400000000000000000000000001415504077600271260ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/relative-external-include-once/000077500000000000000000000000001415504077600253755ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/relative-external-include-once/_config.js000066400000000000000000000005441415504077600273420ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/relative-external-include-once/first/000077500000000000000000000000001415504077600265245ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/relative-external-include-once/first/module.js000066400000000000000000000001361415504077600303470ustar00rootroot00000000000000import foo from '../foo'; import second from './second/module'; export default foo + second; rollup-2.61.1/test/function/samples/relative-external-include-once/first/second/000077500000000000000000000000001415504077600277775ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/relative-external-include-once/first/second/module.js000066400000000000000000000000621415504077600316200ustar00rootroot00000000000000import foo from '../../foo'; export default foo; rollup-2.61.1/test/function/samples/relative-external-include-once/foo.js000066400000000000000000000000001415504077600265040ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/relative-external-include-once/main.js000066400000000000000000000001321415504077600266530ustar00rootroot00000000000000import foo from './foo'; import first from './first/module'; export default foo + first; rollup-2.61.1/test/function/samples/relative-outside-external/000077500000000000000000000000001415504077600245045ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/relative-outside-external/_config.js000066400000000000000000000006361415504077600264530ustar00rootroot00000000000000const assert = require('assert'); const cwd = process.cwd; module.exports = { 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-2.61.1/test/function/samples/relative-outside-external/main.js000066400000000000000000000000631415504077600257650ustar00rootroot00000000000000export {default as value} from '../../../test.js'; rollup-2.61.1/test/function/samples/removes-empty-exported-vars/000077500000000000000000000000001415504077600250145ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/removes-empty-exported-vars/_config.js000066400000000000000000000002521415504077600267550ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'removes empty exported var declarations', exports(exports) { assert.equal(exports.foo, 42); } }; rollup-2.61.1/test/function/samples/removes-empty-exported-vars/main.js000066400000000000000000000000441415504077600262740ustar00rootroot00000000000000var foo; foo = 42; export { foo }; rollup-2.61.1/test/function/samples/rename-conditional-expression-children/000077500000000000000000000000001415504077600271325ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/rename-conditional-expression-children/_config.js000066400000000000000000000001331415504077600310710ustar00rootroot00000000000000module.exports = { description: 'correctly renders children of ConditionalExpressions' }; rollup-2.61.1/test/function/samples/rename-conditional-expression-children/foo.js000066400000000000000000000000561415504077600302540ustar00rootroot00000000000000export const bar = 42; export const baz = 43; rollup-2.61.1/test/function/samples/rename-conditional-expression-children/main.js000066400000000000000000000001201415504077600304050ustar00rootroot00000000000000import * as foo from './foo.js'; assert.equal( true ? foo.bar : foo.baz, 42 ); rollup-2.61.1/test/function/samples/rename-default-export/000077500000000000000000000000001415504077600236075ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/rename-default-export/_config.js000066400000000000000000000003171415504077600255520ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'avoids SyntaxError with default token (#33)', exports(exports) { assert.equal(exports.foo, 42); assert.equal(exports.bar, 42); } }; rollup-2.61.1/test/function/samples/rename-default-export/bar.js000066400000000000000000000000621415504077600247070ustar00rootroot00000000000000import { baz } from './baz'; export default baz; rollup-2.61.1/test/function/samples/rename-default-export/baz.js000066400000000000000000000001051415504077600247150ustar00rootroot00000000000000function Baz () {} export var baz = 42; export default Baz( baz ); rollup-2.61.1/test/function/samples/rename-default-export/foo.js000066400000000000000000000000621415504077600247260ustar00rootroot00000000000000import { baz } from './baz'; export default baz; rollup-2.61.1/test/function/samples/rename-default-export/main.js000066400000000000000000000001121415504077600250630ustar00rootroot00000000000000import foo from './foo'; import bar from './bar'; export { foo, bar }; rollup-2.61.1/test/function/samples/renamed-arguments/000077500000000000000000000000001415504077600230155ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/renamed-arguments/_config.js000066400000000000000000000003751415504077600247640ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'function arguments are renamed as appropriate (#32)', exports(exports) { const obj = {}; assert.strictEqual(exports.foo(), 42); assert.strictEqual(exports.bar(obj), obj); } }; rollup-2.61.1/test/function/samples/renamed-arguments/bar.js000066400000000000000000000001031415504077600241110ustar00rootroot00000000000000function thing ( thing ) { return thing; } export default thing; rollup-2.61.1/test/function/samples/renamed-arguments/foo.js000066400000000000000000000000711415504077600241340ustar00rootroot00000000000000function thing () { return 42; } export default thing; rollup-2.61.1/test/function/samples/renamed-arguments/main.js000066400000000000000000000001121415504077600242710ustar00rootroot00000000000000import foo from './foo'; import bar from './bar'; export { foo, bar }; rollup-2.61.1/test/function/samples/render-chunk-async/000077500000000000000000000000001415504077600230775ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/render-chunk-async/_config.js000066400000000000000000000005611415504077600250430ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/render-chunk-async/main.js000066400000000000000000000000261415504077600243570ustar00rootroot00000000000000assert.equal( x, 3 ); rollup-2.61.1/test/function/samples/resolve-id-object/000077500000000000000000000000001415504077600227145ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/resolve-id-object/_config.js000066400000000000000000000011171415504077600246560ustar00rootroot00000000000000const path = require('path'); module.exports = { 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-2.61.1/test/function/samples/resolve-id-object/foo.js000066400000000000000000000000231415504077600240300ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/resolve-id-object/main.js000066400000000000000000000003321415504077600241740ustar00rootroot00000000000000import external from 'external'; import internal1 from 'internal1'; import internal2 from 'internal2'; assert.strictEqual(internal1, 42); assert.strictEqual(internal2, 42); assert.strictEqual(external, 'external'); rollup-2.61.1/test/function/samples/resolve-relative-external-id/000077500000000000000000000000001415504077600251015ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/resolve-relative-external-id/_config.js000066400000000000000000000014561415504077600270510ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { 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'), { external: true, id: path.join(__dirname, 'external.js'), meta: {}, moduleSideEffects: true, syntheticNamedExports: false }); assert.deepStrictEqual( await this.resolve('./external.js', path.join(__dirname, 'nested', 'some-file.js')), { external: true, id: path.join(__dirname, 'nested', 'external.js'), meta: {}, moduleSideEffects: true, syntheticNamedExports: false } ); } } } }; rollup-2.61.1/test/function/samples/resolve-relative-external-id/main.js000066400000000000000000000000231415504077600263560ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/resolve-unordered-assignments-2/000077500000000000000000000000001415504077600255335ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/resolve-unordered-assignments-2/_config.js000066400000000000000000000003121415504077600274710ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Assignments should be correctly bound independent of their order', exports(exports) { assert.equal(exports.baz, 'present'); } }; rollup-2.61.1/test/function/samples/resolve-unordered-assignments-2/main.js000066400000000000000000000003261415504077600270160ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/resolve-unordered-assignments/000077500000000000000000000000001415504077600253745ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/resolve-unordered-assignments/_config.js000066400000000000000000000003121415504077600273320ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Assignments should be correctly bound independent of their order', exports(exports) { assert.equal(exports.baz, 'present'); } }; rollup-2.61.1/test/function/samples/resolve-unordered-assignments/main.js000066400000000000000000000003461415504077600266610ustar00rootroot00000000000000const foo1 = { noEffect: () => {} }; let foo2 = { noEffect: () => {} }; const bar = {}; assignFoo(); foo2.noEffect = () => { bar.baz = 'present'; }; foo1.noEffect(); function assignFoo () { foo2 = foo1; } export default bar; rollup-2.61.1/test/function/samples/resolveid-is-entry/000077500000000000000000000000001415504077600231435ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/resolveid-is-entry/_config.js000066400000000000000000000051521415504077600251100ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const ID_MAIN = path.join(__dirname, 'main.js'); module.exports = { 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-2.61.1/test/function/samples/resolveid-is-entry/chunkWithImporter.js000066400000000000000000000000251415504077600271640ustar00rootroot00000000000000console.log('with'); rollup-2.61.1/test/function/samples/resolveid-is-entry/chunkWithoutImporter.js000066400000000000000000000000301415504077600277100ustar00rootroot00000000000000console.log('without'); rollup-2.61.1/test/function/samples/resolveid-is-entry/dep.js000066400000000000000000000000231415504077600242440ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/resolveid-is-entry/main.js000066400000000000000000000000761415504077600244300ustar00rootroot00000000000000import value from './dep.js'; assert.strictEqual(value, 42); rollup-2.61.1/test/function/samples/resolveid-is-entry/resolutionWithImporter.js000066400000000000000000000000251415504077600302570ustar00rootroot00000000000000console.log('with'); rollup-2.61.1/test/function/samples/resolveid-is-entry/resolutionWithImporterEntry.js000066400000000000000000000000331415504077600313000ustar00rootroot00000000000000console.log('with entry'); rollup-2.61.1/test/function/samples/resolveid-is-entry/resolutionWithImporterNonEntry.js000066400000000000000000000000371415504077600317570ustar00rootroot00000000000000console.log('with non entry'); rollup-2.61.1/test/function/samples/resolveid-is-entry/resolutionWithoutImporter.js000066400000000000000000000000301415504077600310030ustar00rootroot00000000000000console.log('without'); rollup-2.61.1/test/function/samples/resolveid-is-entry/resolutionWithoutImporterEntry.js000066400000000000000000000000361415504077600320330ustar00rootroot00000000000000console.log('without entry'); rollup-2.61.1/test/function/samples/resolveid-is-entry/resolutionWithoutImporterNonEntry.js000066400000000000000000000000421415504077600325030ustar00rootroot00000000000000console.log('without non entry'); rollup-2.61.1/test/function/samples/resolves-namespace-default/000077500000000000000000000000001415504077600246155ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/resolves-namespace-default/_config.js000066400000000000000000000002641415504077600265610ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: "namespace's 'default' properties should be available", exports(exports) { assert.equal(exports, 42); } }; rollup-2.61.1/test/function/samples/resolves-namespace-default/main.js000066400000000000000000000001001415504077600260660ustar00rootroot00000000000000import * as mod from './mod.js'; export default mod.default(); rollup-2.61.1/test/function/samples/resolves-namespace-default/mod.js000066400000000000000000000000521415504077600257270ustar00rootroot00000000000000export default function () { return 42; } rollup-2.61.1/test/function/samples/respect-default-export-reexporter-side-effects/000077500000000000000000000000001415504077600305415ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/respect-default-export-reexporter-side-effects/_config.js000066400000000000000000000002631415504077600325040ustar00rootroot00000000000000module.exports = { description: 'respect side-effects in reexporting modules even if moduleSideEffects are off', options: { treeshake: { moduleSideEffects: false } } }; rollup-2.61.1/test/function/samples/respect-default-export-reexporter-side-effects/foo.js000066400000000000000000000000271415504077600316610ustar00rootroot00000000000000export const foo = {}; rollup-2.61.1/test/function/samples/respect-default-export-reexporter-side-effects/main.js000066400000000000000000000002451415504077600320240ustar00rootroot00000000000000import { foo } from './reexporter-chain-1.js'; assert.deepStrictEqual(foo, { chain2: 'modified', chain3: 'modified', chain4: 'modified', chain5: 'modified' }); reexporter-chain-1.js000066400000000000000000000002051415504077600344320ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001301415504077600344300ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/respect-default-export-reexporter-side-effectsimport { foo } from './reexporter-chain-3.js'; foo.chain2 = 'modified'; export { foo }; reexporter-chain-3.js000066400000000000000000000001241415504077600344340ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/respect-default-export-reexporter-side-effectsimport foo from './reexporter-chain-4.js'; foo.chain3 = 'modified'; export { foo }; reexporter-chain-4.js000066400000000000000000000001301415504077600344320ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/respect-default-export-reexporter-side-effectsimport foo from './reexporter-chain-5.js'; foo.chain4 = 'modified'; export default foo; reexporter-chain-5.js000066400000000000000000000001151415504077600344360ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/respect-default-export-reexporter-side-effectsimport { foo } from './foo.js'; foo.chain5 = 'modified'; export default foo; rollup-2.61.1/test/function/samples/respect-reexporter-side-effects/000077500000000000000000000000001415504077600256005ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/respect-reexporter-side-effects/_config.js000066400000000000000000000002631415504077600275430ustar00rootroot00000000000000module.exports = { description: 'respect side-effects in reexporting modules even if moduleSideEffects are off', options: { treeshake: { moduleSideEffects: false } } }; rollup-2.61.1/test/function/samples/respect-reexporter-side-effects/foo.js000066400000000000000000000000271415504077600267200ustar00rootroot00000000000000export const foo = {}; rollup-2.61.1/test/function/samples/respect-reexporter-side-effects/main.js000066400000000000000000000010571415504077600270650ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/respect-reexporter-side-effects/reexporter-chain-1.js000066400000000000000000000002051415504077600315500ustar00rootroot00000000000000import { foo } from './reexporter-chain-2.js'; foo.chain1 = 'should not be modified'; export { foo } from './reexporter-chain-2.js'; rollup-2.61.1/test/function/samples/respect-reexporter-side-effects/reexporter-chain-2.js000066400000000000000000000001301415504077600315460ustar00rootroot00000000000000import { foo } from './reexporter-chain-3.js'; foo.chain2 = 'modified'; export { foo }; rollup-2.61.1/test/function/samples/respect-reexporter-side-effects/reexporter-chain-3.js000066400000000000000000000001111415504077600315460ustar00rootroot00000000000000import { foo } from './foo.js'; foo.chain3 = 'modified'; export { foo }; rollup-2.61.1/test/function/samples/respect-reexporter-side-effects/reexporter-direct.js000066400000000000000000000001471415504077600316070ustar00rootroot00000000000000import { foo } from './foo.js'; foo.direct = 'should not be modified'; export { foo } from './foo.js'; rollup-2.61.1/test/function/samples/respect-reexporter-side-effects/reexporter-indirect-ignored.js000066400000000000000000000001401415504077600335540ustar00rootroot00000000000000import { foo } from './foo.js'; foo.indirectIgnored = 'should not be modified'; export { foo }; rollup-2.61.1/test/function/samples/respect-reexporter-side-effects/reexporter-indirect.js000066400000000000000000000001131415504077600321270ustar00rootroot00000000000000import { foo } from './foo.js'; foo.indirect = 'modified'; export { foo }; rollup-2.61.1/test/function/samples/respect-synthetic-export-reexporter-side-effects/000077500000000000000000000000001415504077600311275ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/respect-synthetic-export-reexporter-side-effects/_config.js000066400000000000000000000004351415504077600330730ustar00rootroot00000000000000module.exports = { description: 'respect side-effects in reexporting modules even if moduleSideEffects are off', options: { treeshake: { moduleSideEffects: false }, plugins: [ { transform() { return { syntheticNamedExports: '__synthetic' }; } } ] } }; rollup-2.61.1/test/function/samples/respect-synthetic-export-reexporter-side-effects/baz.js000066400000000000000000000000511415504077600322350ustar00rootroot00000000000000export const baz = { bar: { foo: {} } }; rollup-2.61.1/test/function/samples/respect-synthetic-export-reexporter-side-effects/main.js000066400000000000000000000003741415504077600324150ustar00rootroot00000000000000import { 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.js000066400000000000000000000002051415504077600350200ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001361415504077600351030ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001261415504077600351030ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/respect-synthetic-export-reexporter-side-effectsimport { baz } from './baz.js'; baz.bar.foo.chain11 = 'modified'; export default baz; reexporter-chain-2.js000066400000000000000000000001241415504077600350210ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/respect-synthetic-export-reexporter-side-effectsimport foo from './reexporter-chain-3.js'; foo.chain2 = 'modified'; export { foo }; reexporter-chain-3.js000066400000000000000000000001341415504077600350230ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/respect-synthetic-export-reexporter-side-effectsimport { foo } from './reexporter-chain-4.js'; foo.chain3 = 'modified'; export default foo; reexporter-chain-4.js000066400000000000000000000001461415504077600350270ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001401415504077600350220ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002111415504077600350220ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001341415504077600350270ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/respect-synthetic-export-reexporter-side-effectsimport { bar } from './reexporter-chain-8.js'; bar.foo.chain7 = 'modified'; export { bar }; reexporter-chain-8.js000066400000000000000000000001571415504077600350350ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000002161415504077600350320ustar00rootroot00000000000000rollup-2.61.1/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-2.61.1/test/function/samples/retains-sort-order-b/000077500000000000000000000000001415504077600233615ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/retains-sort-order-b/_config.js000066400000000000000000000003171415504077600253240ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'sorts statements according to their original order within modules, part 2', exports(exports) { assert.equal(exports.answer, 42); } }; rollup-2.61.1/test/function/samples/retains-sort-order-b/bar.js000066400000000000000000000001321415504077600244570ustar00rootroot00000000000000var bar = {}; bar.apply = function ( object ) { object.answer = 42; }; export { bar }; rollup-2.61.1/test/function/samples/retains-sort-order-b/foo.js000066400000000000000000000002601415504077600245000ustar00rootroot00000000000000import { bar } from './bar'; var Foo = function () { this.id = incr(); }; bar.apply( Foo.prototype ); var count = 0; function incr () { return count++; }; export { Foo }; rollup-2.61.1/test/function/samples/retains-sort-order-b/main.js000066400000000000000000000000701415504077600246400ustar00rootroot00000000000000import { Foo } from './foo'; export default new Foo(); rollup-2.61.1/test/function/samples/retains-sort-order/000077500000000000000000000000001415504077600231425ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/retains-sort-order/_config.js000066400000000000000000000003151415504077600251030ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'sorts statements according to their original order within modules', exports(exports) { assert.equal(exports, 'GREAT SUCCESS'); } }; rollup-2.61.1/test/function/samples/retains-sort-order/baz.js000066400000000000000000000000401415504077600242460ustar00rootroot00000000000000export default 'GREAT SUCCESS'; rollup-2.61.1/test/function/samples/retains-sort-order/foobar.js000066400000000000000000000003531415504077600247510ustar00rootroot00000000000000import 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-2.61.1/test/function/samples/retains-sort-order/main.js000066400000000000000000000001221415504077600244170ustar00rootroot00000000000000import { Foo, Bar } from './foobar'; new Foo(); export default new Bar().test(); rollup-2.61.1/test/function/samples/return-expression-depending-on-conditional/000077500000000000000000000000001415504077600277615ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/return-expression-depending-on-conditional/_config.js000066400000000000000000000002141415504077600317200ustar00rootroot00000000000000module.exports = { description: 'tracks return expressions that depend on conditional expressions that are deoptimized at some point' }; rollup-2.61.1/test/function/samples/return-expression-depending-on-conditional/main.js000066400000000000000000000002531415504077600312430ustar00rootroot00000000000000var x = true; var triggered = false; reassign(); (x ? () => () => {} : () => () => {triggered = true;})()(); function reassign() { x = false; } assert.ok(triggered); rollup-2.61.1/test/function/samples/returned-array-mutation/000077500000000000000000000000001415504077600242015ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/returned-array-mutation/_config.js000066400000000000000000000000751415504077600261450ustar00rootroot00000000000000module.exports = { description: 'tracks array mutations' }; rollup-2.61.1/test/function/samples/returned-array-mutation/main.js000066400000000000000000000003501415504077600254610ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/rewrite-member-expressions/000077500000000000000000000000001415504077600247055ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/rewrite-member-expressions/_config.js000066400000000000000000000001351415504077600266460ustar00rootroot00000000000000module.exports = { description: 'rewrites identifiers at the head of member expressions' }; rollup-2.61.1/test/function/samples/rewrite-member-expressions/getLengthOfOtherQueue.js000066400000000000000000000001521415504077600314560ustar00rootroot00000000000000export default function getLengthOfOtherQueue () { return queue.length; } var queue = new Array( 1000 );rollup-2.61.1/test/function/samples/rewrite-member-expressions/main.js000066400000000000000000000003361415504077600261710ustar00rootroot00000000000000import { addToQueue, getQueueItem } from './mainQueue'; import getLengthOfOtherQueue from './getLengthOfOtherQueue'; addToQueue( 42 ); assert.equal( getQueueItem( 0 ), 42 ); assert.equal( getLengthOfOtherQueue(), 1000 );rollup-2.61.1/test/function/samples/rewrite-member-expressions/mainQueue.js000066400000000000000000000002011415504077600271650ustar00rootroot00000000000000var queue = []; export function addToQueue ( x ) { queue.push( x ); } export function getQueueItem ( i ) { return queue[i]; }rollup-2.61.1/test/function/samples/sequence-expression/000077500000000000000000000000001415504077600234045ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/sequence-expression/_config.js000066400000000000000000000001401415504077600253410ustar00rootroot00000000000000module.exports = { description: 'do not change context of callable in sequence expressions' }; rollup-2.61.1/test/function/samples/sequence-expression/main.js000066400000000000000000000002121415504077600246610ustar00rootroot00000000000000 // should maintain this context var module = {}; module.bar = function () { assert.notEqual(this, module); }; var h = (0, module.bar)(); rollup-2.61.1/test/function/samples/sequence-expressions-template-tag/000077500000000000000000000000001415504077600261515ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/sequence-expressions-template-tag/_config.js000066400000000000000000000001631415504077600301130ustar00rootroot00000000000000module.exports = { description: 'uses corrrect "this" for tagged template expressions in simplified sequences' }; rollup-2.61.1/test/function/samples/sequence-expressions-template-tag/main.js000066400000000000000000000002341415504077600274320ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/shadowed-external-export/000077500000000000000000000000001415504077600243345ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/shadowed-external-export/_config.js000066400000000000000000000001551415504077600262770ustar00rootroot00000000000000module.exports = { description: 'external modules are not shadowed', options: { external: ['path'] } }; rollup-2.61.1/test/function/samples/shadowed-external-export/main.js000066400000000000000000000004631415504077600256210ustar00rootroot00000000000000import { 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-2.61.1/test/function/samples/shadowed-namespace-b/000077500000000000000000000000001415504077600233465ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/shadowed-namespace-b/_config.js000066400000000000000000000001061415504077600253050ustar00rootroot00000000000000module.exports = { description: 'namespaces are not shadowed (b)' }; rollup-2.61.1/test/function/samples/shadowed-namespace-b/bar.js000066400000000000000000000000471415504077600244510ustar00rootroot00000000000000export function foo () { return 42; } rollup-2.61.1/test/function/samples/shadowed-namespace-b/main.js000066400000000000000000000002201415504077600246220ustar00rootroot00000000000000import * as bar from './bar'; function car () { var foo = function () { return 'nope'; }; return bar.foo(); } assert.equal( car(), 42 ); rollup-2.61.1/test/function/samples/shadowed-namespace/000077500000000000000000000000001415504077600231275ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/shadowed-namespace/_config.js000066400000000000000000000001021415504077600250620ustar00rootroot00000000000000module.exports = { description: 'namespaces are not shadowed' }; rollup-2.61.1/test/function/samples/shadowed-namespace/bar.js000066400000000000000000000000541415504077600242300ustar00rootroot00000000000000export function foo () { return 'FUBAR'; } rollup-2.61.1/test/function/samples/shadowed-namespace/main.js000066400000000000000000000002761415504077600244160ustar00rootroot00000000000000import * 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-2.61.1/test/function/samples/shadowed-variables/000077500000000000000000000000001415504077600231435ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/shadowed-variables/_config.js000066400000000000000000000003041415504077600251020ustar00rootroot00000000000000module.exports = { description: 'renames shadowed variables correctly' }; // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/named-function-expression rollup-2.61.1/test/function/samples/shadowed-variables/foo.js000066400000000000000000000000221415504077600242560ustar00rootroot00000000000000export var a = 1; rollup-2.61.1/test/function/samples/shadowed-variables/main.js000066400000000000000000000002171415504077600244250ustar00rootroot00000000000000import { a } from './foo'; var getA = function getA() { var a = 2; return a; }; assert.strictEqual(a, 1); assert.strictEqual(getA(), 2); rollup-2.61.1/test/function/samples/shims-missing-exports/000077500000000000000000000000001415504077600236735ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/shims-missing-exports/_config.js000066400000000000000000000004301415504077600256320ustar00rootroot00000000000000module.exports = { description: 'shims missing exports', options: { shimMissingExports: true }, warnings: [ { code: 'SHIMMED_EXPORT', message: 'Missing export "missing" has been shimmed in module dep1.js.', exporter: 'dep1.js', exportName: 'missing' } ] }; rollup-2.61.1/test/function/samples/shims-missing-exports/dep1.js000066400000000000000000000000001415504077600250500ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/shims-missing-exports/dep2.js000066400000000000000000000000001415504077600250510ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/shims-missing-exports/main.js000066400000000000000000000000671415504077600251600ustar00rootroot00000000000000import { missing } from './dep1.js'; export {missing} rollup-2.61.1/test/function/samples/side-effect-free-module-function/000077500000000000000000000000001415504077600256025ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/side-effect-free-module-function/_config.js000066400000000000000000000003341415504077600275440ustar00rootroot00000000000000module.exports = { description: 'correctly include functions with side effects from side-effect-free modules (#3942)', options: { plugins: { transform() { return { moduleSideEffects: false }; } } } }; rollup-2.61.1/test/function/samples/side-effect-free-module-function/curry.js000066400000000000000000000002341415504077600273030ustar00rootroot00000000000000export function curry(fn, args = []) { return (..._args) => (rest => (rest.length >= fn.length ? fn(...rest) : curry(fn, rest)))([...args, ..._args]); } rollup-2.61.1/test/function/samples/side-effect-free-module-function/main.js000066400000000000000000000002261415504077600270640ustar00rootroot00000000000000import { curry } from './curry'; let result; function foo() { result = 'foo'; } var fooc = curry(foo); fooc(); assert.strictEqual(result, 'foo'); rollup-2.61.1/test/function/samples/side-effects-only-default-exports/000077500000000000000000000000001415504077600260435ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/side-effects-only-default-exports/_config.js000066400000000000000000000006221415504077600300050ustar00rootroot00000000000000const assert = require('assert'); const mutated = {}; module.exports = { 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-2.61.1/test/function/samples/side-effects-only-default-exports/bar.js000066400000000000000000000001351415504077600271440ustar00rootroot00000000000000import x from 'external'; export default (x.veryMutated = true, x.extremelyMutated = true); rollup-2.61.1/test/function/samples/side-effects-only-default-exports/baz.js000066400000000000000000000001701415504077600271530ustar00rootroot00000000000000import x from 'external'; export default true ? { a: x.totallyMutated = true, makeSureThisIsAnObject: true } : null; rollup-2.61.1/test/function/samples/side-effects-only-default-exports/foo.js000066400000000000000000000001431415504077600271620ustar00rootroot00000000000000import x from 'external'; export default { a: x.mutated = true, makeSureThisIsAnObject: true }; rollup-2.61.1/test/function/samples/side-effects-only-default-exports/main.js000066400000000000000000000001621415504077600273240ustar00rootroot00000000000000import foo from './foo.js'; import bar from './bar.js'; import baz from './baz.js'; import quux from './quux.js'; rollup-2.61.1/test/function/samples/side-effects-only-default-exports/quux.js000066400000000000000000000001621415504077600274020ustar00rootroot00000000000000import x from 'external'; export default true && { a: x.utterlyMutated = true, makeSureThisIsAnObject: true }; rollup-2.61.1/test/function/samples/simplified-nested-if/000077500000000000000000000000001415504077600234005ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/simplified-nested-if/_config.js000066400000000000000000000002351415504077600253420ustar00rootroot00000000000000module.exports = { description: 'do not catch else branches from parent if statements when simplifiying if-statements', context: { unknown: true } }; rollup-2.61.1/test/function/samples/simplified-nested-if/main.js000066400000000000000000000011421415504077600246600ustar00rootroot00000000000000export 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-2.61.1/test/function/samples/simplify-arrow-expression-with-object/000077500000000000000000000000001415504077600267755ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/simplify-arrow-expression-with-object/_config.js000066400000000000000000000004661415504077600307450ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/simplify-arrow-expression-with-object/main.js000066400000000000000000000001721415504077600302570ustar00rootroot00000000000000export const logical = () => true && { x: 42, y: 43, }; export const conditional = () => true ? { x: 42, y: 43, } : null; rollup-2.61.1/test/function/samples/simplify-class-expression-assignment/000077500000000000000000000000001415504077600267015ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/simplify-class-expression-assignment/_config.js000066400000000000000000000001541415504077600306430ustar00rootroot00000000000000module.exports = { description: 'wraps class expressions in call expressions in simplified assignments' }; rollup-2.61.1/test/function/samples/simplify-class-expression-assignment/main.js000066400000000000000000000003521415504077600301630ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/simplify-function-expression-assignment/000077500000000000000000000000001415504077600274215ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/simplify-function-expression-assignment/_config.js000066400000000000000000000001571415504077600313660ustar00rootroot00000000000000module.exports = { description: 'wraps function expressions in call expressions in simplified assignments' }; rollup-2.61.1/test/function/samples/simplify-function-expression-assignment/main.js000066400000000000000000000003661415504077600307100ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/simplify-object-expression-assignment/000077500000000000000000000000001415504077600270425ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/simplify-object-expression-assignment/_config.js000066400000000000000000000001551415504077600310050ustar00rootroot00000000000000module.exports = { description: 'wraps object expressions in call expressions in simplified assignments' }; rollup-2.61.1/test/function/samples/simplify-object-expression-assignment/main.js000066400000000000000000000003341415504077600303240ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/simplify-sequence-expressions/000077500000000000000000000000001415504077600254215ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/simplify-sequence-expressions/_config.js000066400000000000000000000002051415504077600273600ustar00rootroot00000000000000module.exports = { description: 'correctly simplify sequence expressions if the new leading element would require parentheses' }; rollup-2.61.1/test/function/samples/simplify-sequence-expressions/main.js000066400000000000000000000013321415504077600267020ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/simplify-with-destructuring/000077500000000000000000000000001415504077600251045ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/simplify-with-destructuring/_config.js000066400000000000000000000001521415504077600270440ustar00rootroot00000000000000module.exports = { description: 'handle destructuring assignments in simplified sequence expressions' }; rollup-2.61.1/test/function/samples/simplify-with-destructuring/main.js000066400000000000000000000002641415504077600263700ustar00rootroot00000000000000let foo, unused; null, { foo } = { foo: 'bar' }; assert.strictEqual(foo, 'bar'); const assign = () => unused = { foo } = { foo: 'baz' }; assign(); assert.strictEqual(foo, 'baz'); rollup-2.61.1/test/function/samples/simplify-with-function-iife/000077500000000000000000000000001415504077600247415ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/simplify-with-function-iife/_config.js000066400000000000000000000001671415504077600267070ustar00rootroot00000000000000module.exports = { description: 'correctly uses parentheses when a simplification would put a function IIFE first' }; rollup-2.61.1/test/function/samples/simplify-with-function-iife/main.js000066400000000000000000000006501415504077600262240ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/sourcemapping-url-comment/000077500000000000000000000000001415504077600245135ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/sourcemapping-url-comment/_config.js000066400000000000000000000001341415504077600264530ustar00rootroot00000000000000module.exports = { description: 'only removes valid sourcemapping URL comments (#1132)' }; rollup-2.61.1/test/function/samples/sourcemapping-url-comment/main.js000066400000000000000000000001021415504077600257660ustar00rootroot00000000000000////# sourceMappingURL=foo var val = 42; assert.equal( val, 42 ); rollup-2.61.1/test/function/samples/sourcemapping-url-multiline/000077500000000000000000000000001415504077600250535ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/sourcemapping-url-multiline/_config.js000066400000000000000000000001521415504077600270130ustar00rootroot00000000000000module.exports = { description: 'does not mistakenly recognise sourceMappingURL comment with newline' }; rollup-2.61.1/test/function/samples/sourcemapping-url-multiline/main.js000066400000000000000000000001511415504077600263320ustar00rootroot00000000000000var sourceMappingURL; //# sourceMappingURL='something'; assert.equal( sourceMappingURL, 'something' ); rollup-2.61.1/test/function/samples/spread-arguments-unused/000077500000000000000000000000001415504077600241615ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/spread-arguments-unused/_config.js000066400000000000000000000002051415504077600261200ustar00rootroot00000000000000module.exports = { description: 'handles using the spread operator to add arguments when the first argument is unused (#3652)' }; rollup-2.61.1/test/function/samples/spread-arguments-unused/main.js000066400000000000000000000001411415504077600254370ustar00rootroot00000000000000function test(unused, used) { assert.strictEqual(used, 'used'); } test(...['unused', 'used']); rollup-2.61.1/test/function/samples/statement-order/000077500000000000000000000000001415504077600225145ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/statement-order/_config.js000066400000000000000000000003761415504077600244640ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'correct statement order is preserved even in weird edge cases', context: { getAnswer(obj) { return obj.answer; } }, exports(exports) { assert.equal(exports, 'right'); } }; rollup-2.61.1/test/function/samples/statement-order/answer.js000066400000000000000000000004051415504077600243500ustar00rootroot00000000000000var 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-2.61.1/test/function/samples/statement-order/main.js000066400000000000000000000001151415504077600237730ustar00rootroot00000000000000import answer from './answer'; var answer2 = answer; export default answer2; rollup-2.61.1/test/function/samples/switch-cases-are-deconflicted/000077500000000000000000000000001415504077600251625ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/switch-cases-are-deconflicted/_config.js000066400000000000000000000003511415504077600271230ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'deconflicts variables in switch cases (#1970)', exports(exports) { assert.equal(exports.fn1('1'), 'correct'); assert.equal(exports.fn2('2'), 'correct'); } }; rollup-2.61.1/test/function/samples/switch-cases-are-deconflicted/main.js000066400000000000000000000001021415504077600264350ustar00rootroot00000000000000export { fn1 } from './mod1.js'; export { fn2 } from './mod2.js'; rollup-2.61.1/test/function/samples/switch-cases-are-deconflicted/mod1.js000066400000000000000000000002241415504077600263560ustar00rootroot00000000000000const VALUE = '1'; export function fn1 ( value ) { switch ( value ) { case VALUE: return 'correct'; default: return 'not matched'; } } rollup-2.61.1/test/function/samples/switch-cases-are-deconflicted/mod2.js000066400000000000000000000002241415504077600263570ustar00rootroot00000000000000const VALUE = '2'; export function fn2 ( value ) { switch ( value ) { case VALUE: return 'correct'; default: return 'not matched'; } } rollup-2.61.1/test/function/samples/switch-statement-nested-continue/000077500000000000000000000000001415504077600260045ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/switch-statement-nested-continue/_config.js000066400000000000000000000001401415504077600277410ustar00rootroot00000000000000module.exports = { description: 'treats continue different from break in switch statements' }; rollup-2.61.1/test/function/samples/switch-statement-nested-continue/main.js000066400000000000000000000005321415504077600272660ustar00rootroot00000000000000function 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-2.61.1/test/function/samples/switch-statement-out-of-order-default/000077500000000000000000000000001415504077600266445ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/switch-statement-out-of-order-default/_config.js000066400000000000000000000001501415504077600306020ustar00rootroot00000000000000module.exports = { description: 'handles side-effects in non-ordered defaults of switch statements' }; rollup-2.61.1/test/function/samples/switch-statement-out-of-order-default/main.js000066400000000000000000000002771415504077600301340ustar00rootroot00000000000000function getSelectedValue(selector) { switch (selector) { default: case 'bar': return 'bar'; case 'foo': } return selector; } assert.strictEqual(getSelectedValue('foo'), 'foo'); rollup-2.61.1/test/function/samples/switch-statements-removed-default/000077500000000000000000000000001415504077600261465ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/switch-statements-removed-default/_config.js000066400000000000000000000001541415504077600301100ustar00rootroot00000000000000module.exports = { description: 'does not remove code after a switch statement that should be retained' }; rollup-2.61.1/test/function/samples/switch-statements-removed-default/main.js000066400000000000000000000002211415504077600274230ustar00rootroot00000000000000function performSwitch(value) { switch (value) { case 'foo': return false; default: } return true; } assert.ok(performSwitch('baz')); rollup-2.61.1/test/function/samples/symlink/000077500000000000000000000000001415504077600210655ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/symlink/_config.js000066400000000000000000000001341415504077600230250ustar00rootroot00000000000000module.exports = { skip: process.platform === 'win32', description: 'follows symlinks' }; rollup-2.61.1/test/function/samples/symlink/foo.js000077700000000000000000000000001415504077600253022symlinked/bar.jsustar00rootroot00000000000000rollup-2.61.1/test/function/samples/symlink/main.js000066400000000000000000000000701415504077600223440ustar00rootroot00000000000000import foo from './foo.js'; assert.equal( foo, 'BAZ' ); rollup-2.61.1/test/function/samples/symlink/symlinked/000077500000000000000000000000001415504077600230645ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/symlink/symlinked/bar.js000066400000000000000000000000621415504077600241640ustar00rootroot00000000000000import baz from './baz.js'; export default baz(); rollup-2.61.1/test/function/samples/symlink/symlinked/baz.js000066400000000000000000000000561415504077600241770ustar00rootroot00000000000000export default function () { return 'BAZ'; } rollup-2.61.1/test/function/samples/synthetic-named-exports-fallback-es2015/000077500000000000000000000000001415504077600266475ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/synthetic-named-exports-fallback-es2015/_config.js000066400000000000000000000004001415504077600306030ustar00rootroot00000000000000module.exports = { description: 'adds a fallback in case synthetic named exports are falsy', options: { output: { generatedCode: 'es2015' }, plugins: [ { transform() { return { syntheticNamedExports: '__synthetic' }; } } ] } }; rollup-2.61.1/test/function/samples/synthetic-named-exports-fallback-es2015/array.js000066400000000000000000000001001415504077600303120ustar00rootroot00000000000000export const foo = 'bar'; export const __synthetic = [1, 2, 3]; rollup-2.61.1/test/function/samples/synthetic-named-exports-fallback-es2015/inherited.js000066400000000000000000000001361415504077600311600ustar00rootroot00000000000000export const foo = 'bar'; export const __synthetic = Object.create({ inherited: 'ignored' }); rollup-2.61.1/test/function/samples/synthetic-named-exports-fallback-es2015/main.js000066400000000000000000000006651415504077600301400ustar00rootroot00000000000000import * 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-2.61.1/test/function/samples/synthetic-named-exports-fallback-es2015/null.js000066400000000000000000000000731415504077600301570ustar00rootroot00000000000000export const foo = 'bar'; export const __synthetic = null; rollup-2.61.1/test/function/samples/synthetic-named-exports-fallback-es2015/string.js000066400000000000000000000001041415504077600305060ustar00rootroot00000000000000export const foo = 'bar'; export const __synthetic = 'some string'; rollup-2.61.1/test/function/samples/synthetic-named-exports-fallback/000077500000000000000000000000001415504077600257325ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/synthetic-named-exports-fallback/_config.js000066400000000000000000000003311415504077600276710ustar00rootroot00000000000000module.exports = { description: 'adds a fallback in case synthetic named exports are falsy', options: { plugins: [ { transform() { return { syntheticNamedExports: '__synthetic' }; } } ] } }; rollup-2.61.1/test/function/samples/synthetic-named-exports-fallback/array.js000066400000000000000000000001001415504077600273750ustar00rootroot00000000000000export const foo = 'bar'; export const __synthetic = [1, 2, 3]; rollup-2.61.1/test/function/samples/synthetic-named-exports-fallback/inherited.js000066400000000000000000000001361415504077600302430ustar00rootroot00000000000000export const foo = 'bar'; export const __synthetic = Object.create({ inherited: 'ignored' }); rollup-2.61.1/test/function/samples/synthetic-named-exports-fallback/main.js000066400000000000000000000006651415504077600272230ustar00rootroot00000000000000import * 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-2.61.1/test/function/samples/synthetic-named-exports-fallback/null.js000066400000000000000000000000731415504077600272420ustar00rootroot00000000000000export const foo = 'bar'; export const __synthetic = null; rollup-2.61.1/test/function/samples/synthetic-named-exports-fallback/string.js000066400000000000000000000001041415504077600275710ustar00rootroot00000000000000export const foo = 'bar'; export const __synthetic = 'some string'; rollup-2.61.1/test/function/samples/synthetic-named-exports/000077500000000000000000000000001415504077600241755ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/synthetic-named-exports/circular-synthetic-exports/000077500000000000000000000000001415504077600315135ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/synthetic-named-exports/circular-synthetic-exports/_config.js000066400000000000000000000011651415504077600334600ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'handles circular synthetic exports', options: { plugins: [ { name: 'test', transform() { return { syntheticNamedExports: '__synthetic' }; } } ] }, error: { code: 'SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT', id: path.join(__dirname, 'main.js'), message: `Module "main.js" that is marked with 'syntheticNamedExports: "__synthetic"' needs an export named "__synthetic" that does not reexport an unresolved named export of the same module.`, watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'dep.js')] } }; rollup-2.61.1/test/function/samples/synthetic-named-exports/circular-synthetic-exports/dep.js000066400000000000000000000000541415504077600326200ustar00rootroot00000000000000export { foo as default } from './main.js'; rollup-2.61.1/test/function/samples/synthetic-named-exports/circular-synthetic-exports/main.js000066400000000000000000000000631415504077600327740ustar00rootroot00000000000000export { default as __synthetic } from './dep.js'; rollup-2.61.1/test/function/samples/synthetic-named-exports/circular-synthetic-exports2/000077500000000000000000000000001415504077600315755ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/synthetic-named-exports/circular-synthetic-exports2/_config.js000066400000000000000000000004101415504077600335320ustar00rootroot00000000000000module.exports = { description: 'handles circular synthetic exports', warnings: [ { code: 'CIRCULAR_DEPENDENCY', cycle: ['dep1.js', 'dep2.js', 'dep1.js'], importer: 'dep1.js', message: 'Circular dependency: dep1.js -> dep2.js -> dep1.js' } ] }; rollup-2.61.1/test/function/samples/synthetic-named-exports/circular-synthetic-exports2/dep1.js000066400000000000000000000000571415504077600327660ustar00rootroot00000000000000import dep2 from './dep2'; export default dep2;rollup-2.61.1/test/function/samples/synthetic-named-exports/circular-synthetic-exports2/dep2.js000066400000000000000000000000601415504077600327610ustar00rootroot00000000000000import dep1 from './dep1'; export default dep1; rollup-2.61.1/test/function/samples/synthetic-named-exports/circular-synthetic-exports2/main.js000066400000000000000000000001001415504077600330460ustar00rootroot00000000000000import dep1 from './dep1'; assert.strictEqual(dep1, undefined); rollup-2.61.1/test/function/samples/synthetic-named-exports/dynamic-import/000077500000000000000000000000001415504077600271315ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/synthetic-named-exports/dynamic-import/_config.js000066400000000000000000000013251415504077600310740ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'supports dynamically importing a module with synthetic named exports', options: { plugins: [ { 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-2.61.1/test/function/samples/synthetic-named-exports/dynamic-import/dep.js000066400000000000000000000000711415504077600302350ustar00rootroot00000000000000export default { foo: 'foo' }; export const bar = 'bar'; rollup-2.61.1/test/function/samples/synthetic-named-exports/dynamic-import/main.js000066400000000000000000000000431415504077600304100ustar00rootroot00000000000000export default import('./dep.js'); rollup-2.61.1/test/function/samples/synthetic-named-exports/entry/000077500000000000000000000000001415504077600253365ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/synthetic-named-exports/entry/_config.js000066400000000000000000000005601415504077600273010ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'does not expose the synthetic namespace if an entry point uses a string value', options: { plugins: [ { transform(code) { return { code, syntheticNamedExports: '__synthetic' }; } } ] }, exports(exports) { assert.deepStrictEqual(exports, { exists: 'exists' }); } }; rollup-2.61.1/test/function/samples/synthetic-named-exports/entry/main.js000066400000000000000000000001271415504077600266200ustar00rootroot00000000000000export const exists = 'exists'; export const __synthetic = { synthetic: 'synthetic' }; rollup-2.61.1/test/function/samples/synthetic-named-exports/external-synthetic-exports/000077500000000000000000000000001415504077600315315ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/synthetic-named-exports/external-synthetic-exports/_config.js000066400000000000000000000010001415504077600334620ustar00rootroot00000000000000module.exports = { description: 'external modules can not have syntheticNamedExports', options: { plugins: [ { resolveId(id) { if (id === 'dep') { return { id, external: true, syntheticNamedExports: true }; } } } ] }, warnings: [ { code: 'EXTERNAL_SYNTHETIC_EXPORTS', importer: 'main.js', source: 'dep', message: "External 'dep' can not have 'syntheticNamedExports' enabled." } ], context: { require() { return 1; } } }; rollup-2.61.1/test/function/samples/synthetic-named-exports/external-synthetic-exports/main.js000066400000000000000000000000401415504077600330050ustar00rootroot00000000000000import { foo } from 'dep'; foo; rollup-2.61.1/test/function/samples/synthetic-named-exports/namespace-object/000077500000000000000000000000001415504077600273755ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/synthetic-named-exports/namespace-object/_config.js000066400000000000000000000010171415504077600313360ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/synthetic-named-exports/namespace-object/main.js000066400000000000000000000000551415504077600306570ustar00rootroot00000000000000export * as synthetic from './synthetic.js'; rollup-2.61.1/test/function/samples/synthetic-named-exports/namespace-object/synthetic.js000066400000000000000000000001631415504077600317450ustar00rootroot00000000000000export default 'default'; export const __moduleExports = { foo: 'synthetic-foo', default: 'synthetic-default' }; rollup-2.61.1/test/function/samples/synthetic-named-exports/namespace-overrides/000077500000000000000000000000001415504077600301315ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/synthetic-named-exports/namespace-overrides/_config.js000066400000000000000000000015021415504077600320710ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/synthetic-named-exports/namespace-overrides/dep.js000066400000000000000000000002111415504077600312310ustar00rootroot00000000000000export * as synthetic from './synthetic.js'; export const bar = 'bar'; export default 'not-overwritten'; export * from './synthetic.js'; rollup-2.61.1/test/function/samples/synthetic-named-exports/namespace-overrides/main.js000066400000000000000000000000411415504077600314060ustar00rootroot00000000000000export * as dep from './dep.js'; rollup-2.61.1/test/function/samples/synthetic-named-exports/namespace-overrides/synthetic.js000066400000000000000000000002201415504077600324730ustar00rootroot00000000000000export default { foo: 'synthetic-foo', bar: 'synthetic-bar', baz: 'synthetic-baz', default: 'not-in-namespace' }; export const foo = 'foo'; rollup-2.61.1/test/function/samples/synthetic-named-exports/non-default-export/000077500000000000000000000000001415504077600277305ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/synthetic-named-exports/non-default-export/_config.js000066400000000000000000000011741415504077600316750ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'supports providing a named export to generate synthetic exports', options: { plugins: [ { 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-2.61.1/test/function/samples/synthetic-named-exports/non-default-export/dep.js000066400000000000000000000001531415504077600310350ustar00rootroot00000000000000export const exists = 'exists'; export const __synthetic = { synthetic: 'synthetic', default: 'default' }; rollup-2.61.1/test/function/samples/synthetic-named-exports/non-default-export/main.js000066400000000000000000000001111415504077600312030ustar00rootroot00000000000000export { exists, synthetic, doesNotExist, default as dep } from './dep'; rollup-2.61.1/test/function/samples/synthetic-named-exports/synthetic-exports-need-default/000077500000000000000000000000001415504077600322445ustar00rootroot00000000000000_config.js000066400000000000000000000011251415504077600341260ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/synthetic-named-exports/synthetic-exports-need-defaultconst path = require('path'); module.exports = { description: 'synthetic named exports modules need a default export', options: { plugins: [ { transform() { return { syntheticNamedExports: true }; } } ] }, error: { code: 'SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT', id: path.join(__dirname, 'dep.js'), 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.`, watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'dep.js')] } }; rollup-2.61.1/test/function/samples/synthetic-named-exports/synthetic-exports-need-default/dep.js000066400000000000000000000000251415504077600333470ustar00rootroot00000000000000export const foo = 1;rollup-2.61.1/test/function/samples/synthetic-named-exports/synthetic-exports-need-default/main.js000066400000000000000000000000611415504077600335230ustar00rootroot00000000000000import { a } from './dep.js'; a; console.log(a); rollup-2.61.1/test/function/samples/synthetic-named-exports/synthetic-exports-need-fallback-export/000077500000000000000000000000001415504077600336765ustar00rootroot00000000000000_config.js000066400000000000000000000012601415504077600355600ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/synthetic-named-exports/synthetic-exports-need-fallback-exportconst path = require('path'); const DEP_ID = path.join(__dirname, 'dep.js'); module.exports = { description: 'synthetic named exports modules need their fallback export', options: { plugins: [ { transform(code, id) { if (id.endsWith('dep.js')) { return { code, syntheticNamedExports: '__synthetic' }; } } } ] }, error: { code: 'SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT', id: DEP_ID, message: `Module "dep.js" that is marked with 'syntheticNamedExports: "__synthetic"' needs an export named "__synthetic" that does not reexport an unresolved named export of the same module.`, watchFiles: [path.join(__dirname, 'main.js'), DEP_ID] } }; dep.js000066400000000000000000000000261415504077600347230ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/synthetic-named-exports/synthetic-exports-need-fallback-exportexport const bar = 1; main.js000066400000000000000000000000401415504077600350730ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/synthetic-named-exports/synthetic-exports-need-fallback-exportexport { foo } from './dep.js'; rollup-2.61.1/test/function/samples/synthetic-named-exports/synthetic-named-export-as-default/000077500000000000000000000000001415504077600326335ustar00rootroot00000000000000_config.js000066400000000000000000000003261415504077600345170ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/synthetic-named-exports/synthetic-named-export-as-defaultmodule.exports = { description: 'makes sure default exports of synthetic named exports are snapshots', options: { plugins: { transform() { return { syntheticNamedExports: '__synthetic' }; } } } }; rollup-2.61.1/test/function/samples/synthetic-named-exports/synthetic-named-export-as-default/dep.js000066400000000000000000000000671415504077600337440ustar00rootroot00000000000000import { foo } from './synthetic'; export default foo; main.js000066400000000000000000000002241415504077600340340ustar00rootroot00000000000000rollup-2.61.1/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.js000066400000000000000000000001561415504077600351260ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/synthetic-named-exports/synthetic-named-export-as-defaultexport const __synthetic = { foo: 'original' }; export const update = () => (__synthetic.foo = 'reassigned'); rollup-2.61.1/test/function/samples/this-not-namespace/000077500000000000000000000000001415504077600230765ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/this-not-namespace/_config.js000066400000000000000000000003141415504077600250360ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'does not treat this.foo as a possible namespace (#1258)', exports: exports => { assert.equal(typeof exports.Foo, 'function'); } }; rollup-2.61.1/test/function/samples/this-not-namespace/main.js000066400000000000000000000001111415504077600243510ustar00rootroot00000000000000export class Foo { constructor ( name ) { this.name = undefined; } } rollup-2.61.1/test/function/samples/throws-not-found-module/000077500000000000000000000000001415504077600241175ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/throws-not-found-module/_config.js000066400000000000000000000003711415504077600260620ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'throws error if module is not found', error: { code: 'UNRESOLVED_IMPORT', message: `Could not resolve './mod' from main.js`, watchFiles: [path.join(__dirname, 'main.js')] } }; rollup-2.61.1/test/function/samples/throws-not-found-module/main.js000066400000000000000000000000171415504077600253770ustar00rootroot00000000000000import './mod';rollup-2.61.1/test/function/samples/top-level-arrow-function/000077500000000000000000000000001415504077600242615ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/top-level-arrow-function/_config.js000066400000000000000000000001611415504077600262210ustar00rootroot00000000000000module.exports = { description: 'handles naked return value from top-level arrow function expression (#403)' }; rollup-2.61.1/test/function/samples/top-level-arrow-function/main.js000066400000000000000000000000571415504077600255450ustar00rootroot00000000000000const f = a => a; assert.equal( f( 42 ), 42 ); rollup-2.61.1/test/function/samples/top-level-block/000077500000000000000000000000001415504077600223765ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/top-level-block/_config.js000066400000000000000000000000751415504077600243420ustar00rootroot00000000000000module.exports = { description: 'allows top-level block' }; rollup-2.61.1/test/function/samples/top-level-block/main.js000066400000000000000000000000371415504077600236600ustar00rootroot00000000000000{ assert.equal( 1 + 1, 2 ); } rollup-2.61.1/test/function/samples/top-level-side-effect-on-imported/000077500000000000000000000000001415504077600257155ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/top-level-side-effect-on-imported/_config.js000066400000000000000000000001151415504077600276540ustar00rootroot00000000000000module.exports = { description: 'top level function calls are preserved' }; rollup-2.61.1/test/function/samples/top-level-side-effect-on-imported/lib.js000066400000000000000000000001101415504077600270110ustar00rootroot00000000000000import obj from './obj'; obj.value = 'augmented'; export default obj; rollup-2.61.1/test/function/samples/top-level-side-effect-on-imported/main.js000066400000000000000000000001061415504077600271740ustar00rootroot00000000000000import lib from './lib'; assert.strictEqual(lib.value, 'augmented'); rollup-2.61.1/test/function/samples/top-level-side-effect-on-imported/obj.js000066400000000000000000000000461415504077600270250ustar00rootroot00000000000000export default { value: 'original' }; rollup-2.61.1/test/function/samples/top-level-side-effects-are-preserved/000077500000000000000000000000001415504077600264075ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/top-level-side-effects-are-preserved/_config.js000066400000000000000000000001131415504077600303440ustar00rootroot00000000000000module.exports = { description: 'top level side effects are preserved' }; rollup-2.61.1/test/function/samples/top-level-side-effects-are-preserved/asap.js000066400000000000000000000000431415504077600276660ustar00rootroot00000000000000export default function asap () {} rollup-2.61.1/test/function/samples/top-level-side-effects-are-preserved/config.js000066400000000000000000000000301415504077600302030ustar00rootroot00000000000000export var config = {}; rollup-2.61.1/test/function/samples/top-level-side-effects-are-preserved/defer.js000066400000000000000000000001321415504077600300260ustar00rootroot00000000000000import { config } from './config'; export default function defer () { config.async(); } rollup-2.61.1/test/function/samples/top-level-side-effects-are-preserved/main.js000066400000000000000000000000521415504077600276660ustar00rootroot00000000000000import { defer } from './rsvp'; defer(); rollup-2.61.1/test/function/samples/top-level-side-effects-are-preserved/rsvp.js000066400000000000000000000002041415504077600277330ustar00rootroot00000000000000import { config } from './config'; import asap from './asap'; import defer from './defer'; config.async = asap; export { defer }; rollup-2.61.1/test/function/samples/trace-inclusion-of-virtual-literals/000077500000000000000000000000001415504077600264015ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/trace-inclusion-of-virtual-literals/_config.js000066400000000000000000000001711415504077600303420ustar00rootroot00000000000000module.exports = { description: 'tracks the "included" state of virtual literals with regard to mutating oparations' }; rollup-2.61.1/test/function/samples/trace-inclusion-of-virtual-literals/main.js000066400000000000000000000000771415504077600276670ustar00rootroot00000000000000const foo = [].slice(); foo.push(1); assert.equal(foo[0], 1); rollup-2.61.1/test/function/samples/track-async-arrow-function-return-value/000077500000000000000000000000001415504077600272205ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/track-async-arrow-function-return-value/_config.js000066400000000000000000000004301415504077600311570ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/track-async-arrow-function-return-value/main.js000066400000000000000000000004771415504077600305120ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/track-async-function-return-value/000077500000000000000000000000001415504077600260705ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/track-async-function-return-value/_config.js000066400000000000000000000004221415504077600300300ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/track-async-function-return-value/main.js000066400000000000000000000004361415504077600273550ustar00rootroot00000000000000async 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-2.61.1/test/function/samples/track-awaited-object/000077500000000000000000000000001415504077600233635ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/track-awaited-object/_config.js000066400000000000000000000004001415504077600253170ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'tracks object mutations through await', async exports(exports) { assert.strictEqual(exports.toggled, false); await exports.test(); assert.strictEqual(exports.toggled, true); } }; rollup-2.61.1/test/function/samples/track-awaited-object/main.js000066400000000000000000000004301415504077600246420ustar00rootroot00000000000000function 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-2.61.1/test/function/samples/track-conditional-expression-return-reassignments/000077500000000000000000000000001415504077600313765ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/track-conditional-expression-return-reassignments/_config.js000066400000000000000000000001541415504077600333400ustar00rootroot00000000000000module.exports = { description: 'tracks reassignments of return expressions of conditional expressions' }; rollup-2.61.1/test/function/samples/track-conditional-expression-return-reassignments/main.js000066400000000000000000000004571415504077600326660ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/track-logical-expression-return-reassignments/000077500000000000000000000000001415504077600305055ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/track-logical-expression-return-reassignments/_config.js000066400000000000000000000001501415504077600324430ustar00rootroot00000000000000module.exports = { description: 'tracks reassignments of return expressions of logical expressions' }; rollup-2.61.1/test/function/samples/track-logical-expression-return-reassignments/main.js000066400000000000000000000002471415504077600317720ustar00rootroot00000000000000const obj1 = { x: false }, obj2 = { x: false }; ((() => obj1) || (() => obj2))().x = true; if (!obj1.x || obj2.x) { throw new Error('Reassignment not tracked'); } rollup-2.61.1/test/function/samples/track-multiple-return-expression-reassignments/000077500000000000000000000000001415504077600307265ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/track-multiple-return-expression-reassignments/_config.js000066400000000000000000000001601415504077600326650ustar00rootroot00000000000000module.exports = { description: 'tracks reassignments of return expressions of multiple return expressions' }; rollup-2.61.1/test/function/samples/track-multiple-return-expression-reassignments/main.js000066400000000000000000000010371415504077600322110ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/track-parameter-return-reassignments/000077500000000000000000000000001415504077600266565ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/track-parameter-return-reassignments/_config.js000066400000000000000000000001371415504077600306210ustar00rootroot00000000000000module.exports = { description: 'tracks reassignments of return expressions of parameters' }; rollup-2.61.1/test/function/samples/track-parameter-return-reassignments/main.js000066400000000000000000000011211415504077600301330ustar00rootroot00000000000000// 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-2.61.1/test/function/samples/track-reassigned-object-expression-return-reassignments/000077500000000000000000000000001415504077600324635ustar00rootroot00000000000000_config.js000066400000000000000000000001771415504077600343530ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/track-reassigned-object-expression-return-reassignmentsmodule.exports = { description: 'tracks reassignments of return expressions of members of reassigned object expressions' }; rollup-2.61.1/test/function/samples/track-reassigned-object-expression-return-reassignments/main.js000066400000000000000000000005571415504077600337540ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/tracks-alias-mutations-b/000077500000000000000000000000001415504077600242155ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/tracks-alias-mutations-b/_config.js000066400000000000000000000003001415504077600261500ustar00rootroot00000000000000const assert = require('assert'); const foo = {}; module.exports = { description: 'tracks mutations of aliased objects', context: { foo }, exports() { assert.equal(foo.x, 42); } }; rollup-2.61.1/test/function/samples/tracks-alias-mutations-b/main.js000066400000000000000000000000351415504077600254750ustar00rootroot00000000000000var _foo = foo; _foo.x = 42; rollup-2.61.1/test/function/samples/tracks-alias-mutations/000077500000000000000000000000001415504077600237765ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/tracks-alias-mutations/_config.js000066400000000000000000000001121415504077600257320ustar00rootroot00000000000000module.exports = { description: 'tracks mutations of aliased objects' }; rollup-2.61.1/test/function/samples/tracks-alias-mutations/bar.js000066400000000000000000000002431415504077600250770ustar00rootroot00000000000000import { foo } from './foo'; var f = Math.random() <= 1 ? foo : {}; var f2; f2 = Math.random() <= 1 ? f : {}; f2.wasMutated = true; export var bar = 'whatever'; rollup-2.61.1/test/function/samples/tracks-alias-mutations/foo.js000066400000000000000000000000251415504077600251140ustar00rootroot00000000000000export var foo = {}; rollup-2.61.1/test/function/samples/tracks-alias-mutations/main.js000066400000000000000000000001301415504077600252520ustar00rootroot00000000000000import { foo } from './foo'; import { bar } from './bar'; assert.ok( foo.wasMutated ); rollup-2.61.1/test/function/samples/transform-empty-string/000077500000000000000000000000001415504077600240525ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/transform-empty-string/_config.js000066400000000000000000000006261415504077600260200ustar00rootroot00000000000000const assert = require('assert'); const sideEffects = []; module.exports = { 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-2.61.1/test/function/samples/transform-empty-string/main.js000066400000000000000000000000761415504077600253370ustar00rootroot00000000000000import './transformed.js'; sideEffects.push('this happens'); rollup-2.61.1/test/function/samples/transform-empty-string/transformed.js000066400000000000000000000000471415504077600267350ustar00rootroot00000000000000sideEffects.push('should not happen'); rollup-2.61.1/test/function/samples/transform-without-code-warn-ast/000077500000000000000000000000001415504077600255555ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/transform-without-code-warn-ast/_config.js000066400000000000000000000006131415504077600275170ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/transform-without-code-warn-ast/main.js000066400000000000000000000000231415504077600270320ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/transform-without-code-warn-map/000077500000000000000000000000001415504077600255435ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/transform-without-code-warn-map/_config.js000066400000000000000000000006311415504077600275050ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/transform-without-code-warn-map/main.js000066400000000000000000000000231415504077600270200ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/transform-without-code/000077500000000000000000000000001415504077600240235ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/transform-without-code/_config.js000066400000000000000000000022001415504077600257570ustar00rootroot00000000000000const assert = require('assert'); const fs = require('fs'); const path = require('path'); const { SourceMapConsumer } = require('source-map'); module.exports = { 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].substr(column, 2), '42'); const smc = await new SourceMapConsumer(map); const originalLoc = smc.originalPositionFor({ line, column }); assert.notStrictEqual(originalLoc.line, null); const originalCode = fs.readFileSync(path.join(__dirname, 'main.js'), 'utf8'); assert.strictEqual( originalCode.split('\n')[originalLoc.line - 1].substr(originalLoc.column, 2), '42' ); for (const id of this.getModuleIds()) { assert.strictEqual(this.getModuleInfo(id).meta.test, true); } } }, output: { sourcemap: true } } }; rollup-2.61.1/test/function/samples/transform-without-code/main.js000066400000000000000000000000521415504077600253020ustar00rootroot00000000000000const removed = 'foo'; export default 42; rollup-2.61.1/test/function/samples/transformer-async/000077500000000000000000000000001415504077600230545ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/transformer-async/_config.js000066400000000000000000000005441415504077600250210ustar00rootroot00000000000000module.exports = { 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-2.61.1/test/function/samples/transformer-async/main.js000066400000000000000000000000261415504077600243340ustar00rootroot00000000000000assert.equal( x, 3 ); rollup-2.61.1/test/function/samples/transformer-multiple/000077500000000000000000000000001415504077600235725ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/transformer-multiple/_config.js000066400000000000000000000006331415504077600255360ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'accepts multiple transformer functions', options: { plugins: [ { transform(code) { return code.replace(/MAGIC_NUMBER/g, 3); } }, { transform(code) { return code.replace(/\d+/g, match => { return 2 * +match; }); } } ] }, exports(exports) { assert.equal(exports.magicNumber, 6); } }; rollup-2.61.1/test/function/samples/transformer-multiple/foo.js000066400000000000000000000000351415504077600247110ustar00rootroot00000000000000export default MAGIC_NUMBER; rollup-2.61.1/test/function/samples/transformer-multiple/main.js000066400000000000000000000000701415504077600250510ustar00rootroot00000000000000import foo from './foo'; export var magicNumber = foo; rollup-2.61.1/test/function/samples/transformer-single/000077500000000000000000000000001415504077600232205ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/transformer-single/_config.js000066400000000000000000000004441415504077600251640ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/transformer-single/foo.js000066400000000000000000000000351415504077600243370ustar00rootroot00000000000000export default MAGIC_NUMBER; rollup-2.61.1/test/function/samples/transformer-single/main.js000066400000000000000000000000701415504077600244770ustar00rootroot00000000000000import foo from './foo'; export var magicNumber = foo; rollup-2.61.1/test/function/samples/transparent-dynamic-inlining/000077500000000000000000000000001415504077600251675ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/transparent-dynamic-inlining/_config.js000066400000000000000000000005061415504077600271320ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'Dynamic import inlining when resolution id is a module in the bundle', code(code) { assert.equal(code.indexOf('import('), -1); assert.notEqual(code.indexOf('Promise.resolve('), -1); }, exports(exports) { assert.deepEqual(exports, { y: 42 }); } }; rollup-2.61.1/test/function/samples/transparent-dynamic-inlining/foo.js000066400000000000000000000002401415504077600263040ustar00rootroot00000000000000export var x = 42; import('./main').then(x => { const expected = { y: 42 }; Object.setPrototypeOf(expected, null); assert.deepStrictEqual(x, expected); }); rollup-2.61.1/test/function/samples/transparent-dynamic-inlining/main.js000066400000000000000000000000401415504077600264430ustar00rootroot00000000000000export { x as y } from './foo'; rollup-2.61.1/test/function/samples/tree-shake-object-expression-assignment/000077500000000000000000000000001415504077600272365ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/tree-shake-object-expression-assignment/_config.js000066400000000000000000000002041415504077600311740ustar00rootroot00000000000000module.exports = { description: 'renders valid code when the target of an object expression with side-effects is tree-shaken' }; rollup-2.61.1/test/function/samples/tree-shake-object-expression-assignment/main.js000066400000000000000000000001721415504077600305200ustar00rootroot00000000000000const result = {}; let foo; foo = { [(result.x = 1)]: (result.y = 2) }; assert.deepStrictEqual(result, { x: 1, y: 2 }); rollup-2.61.1/test/function/samples/tree-shake-variable-declarations-2/000077500000000000000000000000001415504077600260175ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/tree-shake-variable-declarations-2/_config.js000066400000000000000000000002761415504077600277660ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'remove unused variables from declarations (#1831)', code(code) { assert.ok(code.search(/var a = 'test'/) >= 0); } }; rollup-2.61.1/test/function/samples/tree-shake-variable-declarations-2/main.js000066400000000000000000000002241415504077600272770ustar00rootroot00000000000000class Test { constructor() { var testFn = function test(){}, //not used a = 'test'; // testFn(); console.log(a) } } export default Test rollup-2.61.1/test/function/samples/tree-shake-variable-declarations/000077500000000000000000000000001415504077600256605ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/tree-shake-variable-declarations/_config.js000066400000000000000000000002721415504077600276230ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'remove unused variables from declarations (#1937)', exports(exports) { assert.deepEqual(exports(), [0.07]); } }; rollup-2.61.1/test/function/samples/tree-shake-variable-declarations/main.js000066400000000000000000000003441415504077600271430ustar00rootroot00000000000000const 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-2.61.1/test/function/samples/trim-conditional-branches-in-exports/000077500000000000000000000000001415504077600265445ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/trim-conditional-branches-in-exports/_config.js000066400000000000000000000001371415504077600305070ustar00rootroot00000000000000module.exports = { description: 'trims conditional branches with a renamed default export' }; rollup-2.61.1/test/function/samples/trim-conditional-branches-in-exports/foo.js000066400000000000000000000000751415504077600276670ustar00rootroot00000000000000var foo = 0; export default Math.random() < 0.5 ? foo : foo; rollup-2.61.1/test/function/samples/trim-conditional-branches-in-exports/main.js000066400000000000000000000001131415504077600300210ustar00rootroot00000000000000import foo from './foo.js'; assert.equal(true ? (false ? foo : 0) : 1, 0); rollup-2.61.1/test/function/samples/try-catch-scoping/000077500000000000000000000000001415504077600227355ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/try-catch-scoping/_config.js000066400000000000000000000001321415504077600246730ustar00rootroot00000000000000module.exports = { description: 'error parameter in catch clause is correctly scoped' }; rollup-2.61.1/test/function/samples/try-catch-scoping/foo.js000066400000000000000000000001431415504077600240540ustar00rootroot00000000000000export default function foo () { try { return 42; } catch ( err ) { console.log( err ); } } rollup-2.61.1/test/function/samples/try-catch-scoping/main.js000066400000000000000000000000631415504077600242160ustar00rootroot00000000000000import foo from './foo'; assert.equal( foo(), 42 );rollup-2.61.1/test/function/samples/unknown-for-loop-variables/000077500000000000000000000000001415504077600245775ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/unknown-for-loop-variables/_config.js000066400000000000000000000001301415504077600265330ustar00rootroot00000000000000module.exports = { description: 'treat for-in and for-of loop variables as unknown' }; rollup-2.61.1/test/function/samples/unknown-for-loop-variables/main.js000066400000000000000000000005011415504077600260550ustar00rootroot00000000000000for (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-2.61.1/test/function/samples/unknown-generated-code-preset/000077500000000000000000000000001415504077600252425ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/unknown-generated-code-preset/_config.js000066400000000000000000000006231415504077600272050ustar00rootroot00000000000000module.exports = { description: 'throws for unknown presets for the generatedCode option', options: { output: { generatedCode: { 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/guide/en/#outputgeneratedcode' } }; rollup-2.61.1/test/function/samples/unknown-generated-code-preset/_expected.js000066400000000000000000000002061415504077600275360ustar00rootroot00000000000000console.log('dep'); console.log('main'); ({ get foo() { console.log('effect'); } }.foo); try { const noeffect = 1; } catch {} rollup-2.61.1/test/function/samples/unknown-generated-code-preset/main.js000066400000000000000000000000411415504077600265170ustar00rootroot00000000000000throw new Error('not executed'); rollup-2.61.1/test/function/samples/unknown-generated-code-value/000077500000000000000000000000001415504077600250545ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/unknown-generated-code-value/_config.js000066400000000000000000000007031415504077600270160ustar00rootroot00000000000000module.exports = { description: 'throws for unknown string values for the generatedCode option', options: { output: { 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/guide/en/#outputgeneratedcode' } }; rollup-2.61.1/test/function/samples/unknown-generated-code-value/_expected.js000066400000000000000000000002061415504077600273500ustar00rootroot00000000000000console.log('dep'); console.log('main'); ({ get foo() { console.log('effect'); } }.foo); try { const noeffect = 1; } catch {} rollup-2.61.1/test/function/samples/unknown-generated-code-value/main.js000066400000000000000000000000411415504077600263310ustar00rootroot00000000000000throw new Error('not executed'); rollup-2.61.1/test/function/samples/unknown-global-side-effects/000077500000000000000000000000001415504077600246735ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/unknown-global-side-effects/_config.js000066400000000000000000000004561415504077600266420ustar00rootroot00000000000000module.exports = { description: 'does not omit side-effects from unknown globals', exports(exports) { let error; try { exports.max(1, 2); } catch (err) { error = err; } if (!(error instanceof ReferenceError)) { throw new Error('Expected a ReferenceError to be thrown.'); } } }; rollup-2.61.1/test/function/samples/unknown-global-side-effects/main.js000066400000000000000000000001631415504077600261550ustar00rootroot00000000000000function myMax(a, b) { return Math.max(a, b); } export function max(a, b) { return myMax(a, b, doesNotExist); } rollup-2.61.1/test/function/samples/unknown-statement/000077500000000000000000000000001415504077600231005ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/unknown-statement/_config.js000066400000000000000000000001011415504077600250320ustar00rootroot00000000000000module.exports = { description: 'handles unknown statements' }; rollup-2.61.1/test/function/samples/unknown-statement/main.js000066400000000000000000000000561415504077600243630ustar00rootroot00000000000000debugger; if (true) debugger; else debugger; rollup-2.61.1/test/function/samples/unknown-treeshake-preset/000077500000000000000000000000001415504077600243475ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/unknown-treeshake-preset/_config.js000066400000000000000000000005611415504077600263130ustar00rootroot00000000000000module.exports = { description: 'throws for unknown presets for the treeshake option', options: { treeshake: { 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/guide/en/#treeshake' } }; rollup-2.61.1/test/function/samples/unknown-treeshake-preset/_expected.js000066400000000000000000000002061415504077600266430ustar00rootroot00000000000000console.log('dep'); console.log('main'); ({ get foo() { console.log('effect'); } }.foo); try { const noeffect = 1; } catch {} rollup-2.61.1/test/function/samples/unknown-treeshake-preset/main.js000066400000000000000000000000411415504077600256240ustar00rootroot00000000000000throw new Error('not executed'); rollup-2.61.1/test/function/samples/unknown-treeshake-value/000077500000000000000000000000001415504077600241615ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/unknown-treeshake-value/_config.js000066400000000000000000000006561415504077600261320ustar00rootroot00000000000000module.exports = { description: 'throws for unknown string values for the treeshake option', options: { 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/guide/en/#treeshake' } }; rollup-2.61.1/test/function/samples/unknown-treeshake-value/_expected.js000066400000000000000000000002061415504077600264550ustar00rootroot00000000000000console.log('dep'); console.log('main'); ({ get foo() { console.log('effect'); } }.foo); try { const noeffect = 1; } catch {} rollup-2.61.1/test/function/samples/unknown-treeshake-value/main.js000066400000000000000000000000411415504077600254360ustar00rootroot00000000000000throw new Error('not executed'); rollup-2.61.1/test/function/samples/unused-do-while-loop-declaration/000077500000000000000000000000001415504077600256425ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/unused-do-while-loop-declaration/_config.js000066400000000000000000000002041415504077600276000ustar00rootroot00000000000000module.exports = { description: 'does not partially tree-shake unused declarations with side-effects in do-while loop bodies' }; rollup-2.61.1/test/function/samples/unused-do-while-loop-declaration/main.js000066400000000000000000000002271415504077600271250ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/unused-for-in-loop-declaration/000077500000000000000000000000001415504077600253245ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/unused-for-in-loop-declaration/_config.js000066400000000000000000000002021415504077600272600ustar00rootroot00000000000000module.exports = { description: 'does not partially tree-shake unused declarations with side-effects in for-in loop bodies' }; rollup-2.61.1/test/function/samples/unused-for-in-loop-declaration/main.js000066400000000000000000000002451415504077600266070ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/unused-for-loop-body-declaration/000077500000000000000000000000001415504077600256535ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/unused-for-loop-body-declaration/_config.js000066400000000000000000000001771415504077600276220ustar00rootroot00000000000000module.exports = { description: 'does not partially tree-shake unused declarations with side-effects in for loop bodies' }; rollup-2.61.1/test/function/samples/unused-for-loop-body-declaration/main.js000066400000000000000000000002051415504077600271320ustar00rootroot00000000000000let result = 3; for (var a = 0; a < 3; a++) var b = a, unused = result--; assert.strictEqual(b, 2); assert.strictEqual(result, 0); rollup-2.61.1/test/function/samples/unused-for-loop-init-declaration/000077500000000000000000000000001415504077600256615ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/unused-for-loop-init-declaration/_config.js000066400000000000000000000001671415504077600276270ustar00rootroot00000000000000module.exports = { description: 'does not partially tree-shake unused declarations with side-effects in for loops' }; rollup-2.61.1/test/function/samples/unused-for-loop-init-declaration/main.js000066400000000000000000000003051415504077600271410ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/unused-for-of-loop-declaration/000077500000000000000000000000001415504077600253225ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/unused-for-of-loop-declaration/_config.js000066400000000000000000000002021415504077600272560ustar00rootroot00000000000000module.exports = { description: 'does not partially tree-shake unused declarations with side-effects in for-of loop bodies' }; rollup-2.61.1/test/function/samples/unused-for-of-loop-declaration/main.js000066400000000000000000000002331415504077600266020ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/unused-if-statement-declaration/000077500000000000000000000000001415504077600255635ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/unused-if-statement-declaration/_config.js000066400000000000000000000001671415504077600275310ustar00rootroot00000000000000module.exports = { description: 'does not partially tree-shake unused declarations with side-effects in for loops' }; rollup-2.61.1/test/function/samples/unused-if-statement-declaration/main.js000066400000000000000000000005031415504077600270430ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/unused-import/000077500000000000000000000000001415504077600222125ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/unused-import/_config.js000066400000000000000000000007341415504077600241600ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'warns on unused imports ([#595])', options: { external: ['external'] }, context: { require() { return {}; } }, warnings: [ { code: 'UNUSED_EXTERNAL_IMPORT', source: 'external', names: ['notused', 'neverused'], message: `"notused" and "neverused" are imported from external module "external" but never used in "main.js".`, sources: [path.resolve(__dirname, './main.js')] } ] }; rollup-2.61.1/test/function/samples/unused-import/main.js000066400000000000000000000001541415504077600234740ustar00rootroot00000000000000import { unused, notused, neverused as willnotuse } from 'external'; function alsoUnused () { unused(); } rollup-2.61.1/test/function/samples/unused-parameter-side-effects/000077500000000000000000000000001415504077600252175ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/unused-parameter-side-effects/_config.js000066400000000000000000000001711415504077600271600ustar00rootroot00000000000000module.exports = { description: 'does not tree-shake arguments where the corresponding parameters have side-effects' }; rollup-2.61.1/test/function/samples/unused-parameter-side-effects/main.js000066400000000000000000000001741415504077600265030ustar00rootroot00000000000000let sideEffects = 0; function destructured({}) { sideEffects++; } destructured({}); assert.strictEqual(sideEffects, 1); rollup-2.61.1/test/function/samples/unused-parenthesed-assignment/000077500000000000000000000000001415504077600253505ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/unused-parenthesed-assignment/_config.js000066400000000000000000000002431415504077600273110ustar00rootroot00000000000000module.exports = { description: 'correctly simplifies assignments with right-hand-sides in parentheses (#3924)', context: { someObject: { isTrue: true } } }; rollup-2.61.1/test/function/samples/unused-parenthesed-assignment/main.js000066400000000000000000000000731415504077600266320ustar00rootroot00000000000000let unused = false; unused = (someObject.isTrue === true); rollup-2.61.1/test/function/samples/unused-var-a/000077500000000000000000000000001415504077600217065ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/unused-var-a/_config.js000066400000000000000000000001071415504077600236460ustar00rootroot00000000000000module.exports = { description: 'omits unused var declaration (a)' }; rollup-2.61.1/test/function/samples/unused-var-a/foo.js000066400000000000000000000001061415504077600230240ustar00rootroot00000000000000var unused = 'unused', foo = 'foo', bar = 'bar'; export { foo, bar }; rollup-2.61.1/test/function/samples/unused-var-a/main.js000066400000000000000000000001331415504077600231650ustar00rootroot00000000000000import { foo, bar } from './foo'; assert.equal( foo, 'foo' ); assert.equal( bar, 'bar' ); rollup-2.61.1/test/function/samples/unused-var-b/000077500000000000000000000000001415504077600217075ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/unused-var-b/_config.js000066400000000000000000000001071415504077600236470ustar00rootroot00000000000000module.exports = { description: 'omits unused var declaration (b)' }; rollup-2.61.1/test/function/samples/unused-var-b/foo.js000066400000000000000000000001061415504077600230250ustar00rootroot00000000000000var foo = 'foo', unused = 'unused', bar = 'bar'; export { foo, bar }; rollup-2.61.1/test/function/samples/unused-var-b/main.js000066400000000000000000000001331415504077600231660ustar00rootroot00000000000000import { foo, bar } from './foo'; assert.equal( foo, 'foo' ); assert.equal( bar, 'bar' ); rollup-2.61.1/test/function/samples/unused-var-c/000077500000000000000000000000001415504077600217105ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/unused-var-c/_config.js000066400000000000000000000001071415504077600236500ustar00rootroot00000000000000module.exports = { description: 'omits unused var declaration (c)' }; rollup-2.61.1/test/function/samples/unused-var-c/foo.js000066400000000000000000000001061415504077600230260ustar00rootroot00000000000000var foo = 'foo', bar = 'bar', unused = 'unused'; export { foo, bar }; rollup-2.61.1/test/function/samples/unused-var-c/main.js000066400000000000000000000001331415504077600231670ustar00rootroot00000000000000import { foo, bar } from './foo'; assert.equal( foo, 'foo' ); assert.equal( bar, 'bar' ); rollup-2.61.1/test/function/samples/unused-var-d/000077500000000000000000000000001415504077600217115ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/unused-var-d/_config.js000066400000000000000000000001071415504077600236510ustar00rootroot00000000000000module.exports = { description: 'omits unused var declaration (d)' }; rollup-2.61.1/test/function/samples/unused-var-d/foo.js000066400000000000000000000001541415504077600230320ustar00rootroot00000000000000var unused_a = 'a', unused_b = 'b'; var unused_c = 'c'; var foo = 'foo', bar = 'bar'; export { foo, bar }; rollup-2.61.1/test/function/samples/unused-var-d/main.js000066400000000000000000000001331415504077600231700ustar00rootroot00000000000000import { foo, bar } from './foo'; assert.equal( foo, 'foo' ); assert.equal( bar, 'bar' ); rollup-2.61.1/test/function/samples/unused-while-loop-declaration/000077500000000000000000000000001415504077600252425ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/unused-while-loop-declaration/_config.js000066400000000000000000000002011415504077600271750ustar00rootroot00000000000000module.exports = { description: 'does not partially tree-shake unused declarations with side-effects in while loop bodies' }; rollup-2.61.1/test/function/samples/unused-while-loop-declaration/main.js000066400000000000000000000002231415504077600265210ustar00rootroot00000000000000let 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-2.61.1/test/function/samples/update-expression-of-import-fails/000077500000000000000000000000001415504077600260645ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/update-expression-of-import-fails/_config.js000066400000000000000000000011511415504077600300240ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'disallows updates to imported bindings', error: { code: 'ILLEGAL_REASSIGNMENT', message: `Illegal reassignment to import 'a'`, id: path.join(__dirname, 'main.js'), pos: 28, watchFiles: [path.join(__dirname, 'main.js'), path.join(__dirname, 'foo.js')], loc: { file: path.join(__dirname, 'main.js'), line: 3, column: 0 }, frame: ` 1: import { a } from './foo'; 2: 3: a++; ^ ` } }; // test copied from https://github.com/esnext/es6-module-transpiler/tree/master/test/examples/update-expression-of-import-fails rollup-2.61.1/test/function/samples/update-expression-of-import-fails/foo.js000066400000000000000000000000221415504077600271770ustar00rootroot00000000000000export var a = 0; rollup-2.61.1/test/function/samples/update-expression-of-import-fails/main.js000066400000000000000000000000411415504077600273410ustar00rootroot00000000000000import { a } from './foo'; a++; rollup-2.61.1/test/function/samples/use-var-before-decl/000077500000000000000000000000001415504077600231265ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/use-var-before-decl/_config.js000066400000000000000000000001311415504077600250630ustar00rootroot00000000000000module.exports = { description: 'exercise `var` variables before their declarations' }; rollup-2.61.1/test/function/samples/use-var-before-decl/main.js000066400000000000000000000016111415504077600244070ustar00rootroot00000000000000var 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-2.61.1/test/function/samples/uses-supplied-ast/000077500000000000000000000000001415504077600227665ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/uses-supplied-ast/_config.js000066400000000000000000000015501415504077600247310ustar00rootroot00000000000000const 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 = { 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-2.61.1/test/function/samples/validate-output/000077500000000000000000000000001415504077600225265ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/validate-output/_config.js000066400000000000000000000006471415504077600244770ustar00rootroot00000000000000module.exports = { description: 'handles validate failure', options: { onwarn(warning) { throw warning; }, 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-2.61.1/test/function/samples/validate-output/main.js000066400000000000000000000000411415504077600240030ustar00rootroot00000000000000throw new Error('Not executed'); rollup-2.61.1/test/function/samples/vars-in-for-loop-head/000077500000000000000000000000001415504077600234105ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/vars-in-for-loop-head/_config.js000066400000000000000000000001211415504077600253440ustar00rootroot00000000000000module.exports = { description: 'does not break apart vars in for loop head' }; rollup-2.61.1/test/function/samples/vars-in-for-loop-head/main.js000066400000000000000000000003451415504077600246740ustar00rootroot00000000000000function 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-2.61.1/test/function/samples/vars-not-removed-in-if-block/000077500000000000000000000000001415504077600246775ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/vars-not-removed-in-if-block/_config.js000066400000000000000000000001261415504077600266400ustar00rootroot00000000000000module.exports = { description: 'preserves var declarations in if blocks (#1113)' }; rollup-2.61.1/test/function/samples/vars-not-removed-in-if-block/main.js000066400000000000000000000001261415504077600261600ustar00rootroot00000000000000if ( Math.random() <= 1 ) { var x = 1; } else { var x = 2; } assert.equal( x, 1 ); rollup-2.61.1/test/function/samples/vars-not-removed/000077500000000000000000000000001415504077600226075ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/vars-not-removed/_config.js000066400000000000000000000001401415504077600245440ustar00rootroot00000000000000module.exports = { description: 'does not erroneously remove var/let/const keywords (#390)' }; rollup-2.61.1/test/function/samples/vars-not-removed/bar.js000066400000000000000000000000551415504077600237110ustar00rootroot00000000000000var a = 2, b = 3; assert.equal( a + b, 5 ); rollup-2.61.1/test/function/samples/vars-not-removed/foo.js000066400000000000000000000000551415504077600237300ustar00rootroot00000000000000var a = 1, b = 2; assert.equal( a + b, 3 ); rollup-2.61.1/test/function/samples/vars-not-removed/main.js000066400000000000000000000000461415504077600240710ustar00rootroot00000000000000import './foo.js'; import './bar.js'; rollup-2.61.1/test/function/samples/vars-with-init-in-dead-branch/000077500000000000000000000000001415504077600250165ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/vars-with-init-in-dead-branch/_config.js000066400000000000000000000003131415504077600267550ustar00rootroot00000000000000module.exports = { description: 'handles vars with init in dead branch (#1198)', warnings: [ { chunkName: 'main', code: 'EMPTY_BUNDLE', message: 'Generated an empty chunk: "main"' } ] }; rollup-2.61.1/test/function/samples/vars-with-init-in-dead-branch/main.js000066400000000000000000000000761415504077600263030ustar00rootroot00000000000000if ( false ) { var foo = []; var bar = foo.concat( 'x' ); } rollup-2.61.1/test/function/samples/warn-implicit-cjs-auto/000077500000000000000000000000001415504077600237015ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/warn-implicit-cjs-auto/_config.js000066400000000000000000000014121415504077600256410ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'warns when using implicit default export mode in CommonJS', options: { output: { exports: undefined } }, warnings: [ { code: 'PREFER_NAMED_EXPORTS', id: path.join(__dirname, 'main.js'), message: 'Entry module "main.js" is implicitly using "default" export mode, which means for CommonJS output that its default export is assigned to "module.exports". For many tools, such CommonJS output will not be interchangeable with the original ES module. If this is intended, explicitly set "output.exports" to either "auto" or "default", otherwise you might want to consider changing the signature of "main.js" to use named exports only.', url: 'https://rollupjs.org/guide/en/#outputexports' } ] }; rollup-2.61.1/test/function/samples/warn-implicit-cjs-auto/main.js000066400000000000000000000000231415504077600251560ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/warn-missing-iife-name/000077500000000000000000000000001415504077600236455ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/warn-missing-iife-name/_config.js000066400000000000000000000004741415504077600256140ustar00rootroot00000000000000module.exports = { 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.' } ] }; rollup-2.61.1/test/function/samples/warn-missing-iife-name/main.js000066400000000000000000000000251415504077600251240ustar00rootroot00000000000000export const x = 42; rollup-2.61.1/test/function/samples/warn-on-auto-named-default-exports/000077500000000000000000000000001415504077600261345ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/warn-on-auto-named-default-exports/_config.js000066400000000000000000000010301415504077600300700ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'warns if default and named exports are used in auto mode', warnings: [ { code: 'MIXED_EXPORTS', id: path.join(__dirname, 'main.js'), 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/guide/en/#outputexports' } ] }; rollup-2.61.1/test/function/samples/warn-on-auto-named-default-exports/main.js000066400000000000000000000001741415504077600274200ustar00rootroot00000000000000function foo () { console.log( 'foo' ); } function bar () { console.log( 'bar' ); } export default foo; export { bar }; rollup-2.61.1/test/function/samples/warn-on-empty-bundle/000077500000000000000000000000001415504077600233635ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/warn-on-empty-bundle/_config.js000066400000000000000000000003101415504077600253170ustar00rootroot00000000000000module.exports = { description: 'warns if empty bundle is generated (#444)', warnings: [ { chunkName: 'main', code: 'EMPTY_BUNDLE', message: 'Generated an empty chunk: "main"' } ] }; rollup-2.61.1/test/function/samples/warn-on-empty-bundle/main.js000066400000000000000000000000341415504077600246420ustar00rootroot00000000000000function noop () {} noop(); rollup-2.61.1/test/function/samples/warn-on-eval/000077500000000000000000000000001415504077600217055ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/warn-on-eval/_config.js000066400000000000000000000010321415504077600236430ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'warns about use of eval', warnings: [ { code: 'EVAL', id: path.join(__dirname, 'main.js'), message: `Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification`, pos: 13, loc: { column: 13, file: require('path').resolve(__dirname, 'main.js'), line: 1 }, frame: ` 1: var result = eval( '1 + 1' ); ^ `, url: 'https://rollupjs.org/guide/en/#avoiding-eval' } ] }; rollup-2.61.1/test/function/samples/warn-on-eval/main.js000066400000000000000000000000361415504077600231660ustar00rootroot00000000000000var result = eval( '1 + 1' ); rollup-2.61.1/test/function/samples/warn-on-namespace-conflict/000077500000000000000000000000001415504077600245115ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/warn-on-namespace-conflict/_config.js000066400000000000000000000006411415504077600264540ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'warns on duplicate export * from', warnings: [ { code: 'NAMESPACE_CONFLICT', name: 'foo', reexporter: path.join(__dirname, 'main.js'), sources: [path.join(__dirname, 'foo.js'), path.join(__dirname, 'deep.js')], message: `Conflicting namespaces: "main.js" re-exports "foo" from both "foo.js" and "deep.js" (will be ignored)` } ] }; rollup-2.61.1/test/function/samples/warn-on-namespace-conflict/bar.js000066400000000000000000000000321415504077600256060ustar00rootroot00000000000000export * from './deep.js';rollup-2.61.1/test/function/samples/warn-on-namespace-conflict/deep.js000066400000000000000000000000231415504077600257570ustar00rootroot00000000000000export var foo = 2;rollup-2.61.1/test/function/samples/warn-on-namespace-conflict/foo.js000066400000000000000000000000231415504077600256250ustar00rootroot00000000000000export var foo = 1;rollup-2.61.1/test/function/samples/warn-on-namespace-conflict/main.js000066400000000000000000000001161415504077600257710ustar00rootroot00000000000000export * from './foo.js'; export * from './bar.js'; export const retained = 1;rollup-2.61.1/test/function/samples/warn-on-top-level-this/000077500000000000000000000000001415504077600236325ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/warn-on-top-level-this/_config.js000066400000000000000000000014421415504077600255750ustar00rootroot00000000000000const path = require('path'); const { assertIncludes } = require('../../../utils.js'); module.exports = { 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/guide/en/#error-this-is-undefined` } ], runtimeError: err => { assertIncludes(err.message, 'Cannot set propert'); assertIncludes(err.message, "'foo'"); } }; rollup-2.61.1/test/function/samples/warn-on-top-level-this/main.js000066400000000000000000000001431415504077600251120ustar00rootroot00000000000000const someVariableJustToCheckOnCorrectLineNumber = true; // eslint-disable-line this.foo = 'bar'; rollup-2.61.1/test/function/samples/warn-on-unused-missing-imports/000077500000000000000000000000001415504077600254235ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/warn-on-unused-missing-imports/_config.js000066400000000000000000000010321415504077600273610ustar00rootroot00000000000000const path = require('path'); module.exports = { description: 'warns on missing (but unused) imports', warnings: [ { code: 'NON_EXISTENT_EXPORT', id: path.join(__dirname, 'main.js'), source: path.join(__dirname, 'foo.js'), name: 'b', message: `Non-existent export 'b' is imported from foo.js`, pos: 12, loc: { file: path.join(__dirname, 'main.js'), line: 1, column: 12 }, frame: ` 1: import { a, b } from './foo.js'; ^ 2: 3: assert.equal( a, 42 ); ` } ] }; rollup-2.61.1/test/function/samples/warn-on-unused-missing-imports/foo.js000066400000000000000000000000231415504077600265370ustar00rootroot00000000000000export var a = 42; rollup-2.61.1/test/function/samples/warn-on-unused-missing-imports/main.js000066400000000000000000000000711415504077600267030ustar00rootroot00000000000000import { a, b } from './foo.js'; assert.equal( a, 42 ); rollup-2.61.1/test/function/samples/warnings-to-string/000077500000000000000000000000001415504077600231535ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/warnings-to-string/_config.js000066400000000000000000000006751415504077600251250ustar00rootroot00000000000000const assert = require('assert'); module.exports = { 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-2.61.1/test/function/samples/warnings-to-string/main.js000066400000000000000000000000231415504077600244300ustar00rootroot00000000000000const removed = 1; rollup-2.61.1/test/function/samples/warns-for-invalid-options/000077500000000000000000000000001415504077600244325ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/warns-for-invalid-options/_config.js000066400000000000000000000007721415504077600264020ustar00rootroot00000000000000module.exports = { description: 'warns for invalid options', options: { myInvalidInputOption: true, output: { myInvalidOutputOption: true } }, warnings: [ { code: 'UNKNOWN_OPTION', message: 'Unknown input options: myInvalidInputOption. Allowed options: ' + require('../../../misc/optionList').input }, { code: 'UNKNOWN_OPTION', message: 'Unknown output options: myInvalidOutputOption. Allowed options: ' + require('../../../misc/optionList').output } ] }; rollup-2.61.1/test/function/samples/warns-for-invalid-options/main.js000066400000000000000000000000231415504077600257070ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/function/samples/watch-option/000077500000000000000000000000001415504077600220135ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/watch-option/_config.js000066400000000000000000000001271415504077600237550ustar00rootroot00000000000000module.exports = { description: 'expects watch option', options: { watch: {} } }; rollup-2.61.1/test/function/samples/watch-option/main.js000066400000000000000000000000201415504077600232650ustar00rootroot00000000000000assert.ok(true);rollup-2.61.1/test/function/samples/wraps-object-expressions-as-statements/000077500000000000000000000000001415504077600271455ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/wraps-object-expressions-as-statements/_config.js000066400000000000000000000001331415504077600311040ustar00rootroot00000000000000module.exports = { description: 'wraps object expressions that have become statements' }; rollup-2.61.1/test/function/samples/wraps-object-expressions-as-statements/main.js000066400000000000000000000002161415504077600304260ustar00rootroot00000000000000const foo = {}; // new parent is expression statement true && { a: foo.a = true, b: foo.a = true }; assert.ok(foo.a); export default foo; rollup-2.61.1/test/function/samples/wraps-simplified-expressions/000077500000000000000000000000001415504077600252365ustar00rootroot00000000000000rollup-2.61.1/test/function/samples/wraps-simplified-expressions/_config.js000066400000000000000000000003441415504077600272010ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'wraps simplified expressions that have become callees if necessary', warnings: warnings => warnings.forEach(warning => assert.equal(warning.code, 'EVAL')) }; rollup-2.61.1/test/function/samples/wraps-simplified-expressions/main.js000066400000000000000000000012761415504077600265260ustar00rootroot00000000000000const 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-2.61.1/test/hooks/000077500000000000000000000000001415504077600152315ustar00rootroot00000000000000rollup-2.61.1/test/hooks/index.js000066400000000000000000001040721415504077600167020ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const sander = require('sander'); const rollup = require('../../dist/rollup.js'); const { loader } = require('../utils.js'); const TEMP_DIR = path.join(__dirname, 'tmp'); describe('hooks', () => { it('allows to replace file with dir in the outputOptions hook', () => 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; } } ] }) .then(bundle => bundle.write({ file: path.join(TEMP_DIR, 'bundle.js'), format: 'es' }) ) .then(() => { const fileNames = sander.readdirSync(TEMP_DIR).sort(); assert.deepStrictEqual(fileNames, ['chunk.js', 'input.js']); return sander.rimraf(TEMP_DIR); })); 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(bundle => { assert.strictEqual(buildStartCnt, 1); assert.strictEqual(buildEndCnt, 1); return rollup.rollup({ input: 'input', plugins: [ loader({ input: `invalid_source - @#$%^&*` }), { buildStart() { buildStartCnt++; }, buildEnd() { buildEndCnt++; } } ] }); }) .catch(err => { assert.ok(err); }) .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('supports isExternal on plugin context', () => rollup.rollup({ input: 'input', external: ['test'], plugins: [ loader({ input: `alert('hello')` }), { buildStart() { assert.strictEqual(this.isExternal('test'), true); assert.strictEqual(this.isExternal('another'), false); } } ] })); it('supports resolveId on plugin context', () => rollup .rollup({ input: 'input', plugins: [ loader({ input: `import 'test'`, dep1: `import 'next'`, dep2: `alert('hello')` }), { resolveId(id) { if (id === 'test') return 'dep1'; if (id === 'next') return this.resolveId('final'); if (id === 'final') return 'dep2'; } } ] }) .then(bundle => bundle.generate({ format: 'es' })) .then(({ output: [output] }) => { assert.strictEqual(output.code, `alert('hello');\n`); })); 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-928cb70b.js', import.meta.url).href;\n\nexport { input as default };\n` ); assert.strictEqual(output[1].fileName, 'chunk-928cb70b.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-928cb70b.js', import.meta.url).href;\n\nexport { input as default };\n` ); assert.strictEqual(output[1].fileName, 'chunk-928cb70b.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-928cb70b.js', import.meta.url).href;\n\nexport { input as default };\n` ); assert.strictEqual(output[1].fileName, 'chunk-928cb70b.js'); assert.strictEqual(output[1].code, `console.log('chunk');\n`); }); }); it('does not overwrite files in other outputs when emitting assets during generate', () => { return 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-0a676135.ext', import.meta.url).href;\n\nexport { input as default };\n` ); assert.strictEqual(output[1].fileName, 'assets/test-0a676135.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-0a676135.ext', import.meta.url).href;\n\nexport { input as default };\n` ); assert.strictEqual(output[1].fileName, 'assets/test-0a676135.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-0a676135.ext', import.meta.url).href;\n\nexport { input as default };\n` ); assert.strictEqual(output[1].fileName, 'assets/test-0a676135.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-09aeb845.ext', import.meta.url).href;\n\n` + `export { input as default };\n` ); assert.strictEqual(output[1].fileName, 'assets/test-09aeb845.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-ce5fc71b.ext', import.meta.url).href;\n\n` + `export { input as default };\n` ); assert.strictEqual(output[1].fileName, 'assets/test-ce5fc71b.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-0a676135.ext', import.meta.url).href;\n\nexport { input as default };\n` ); assert.strictEqual(output[1].fileName, 'assets/test-0a676135.ext'); assert.strictEqual(output[1].source, 'hello world'); assert.strictEqual(output[1].fileName, 'assets/test-0a676135.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', () => { const file = path.join(TEMP_DIR, 'bundle.js'); let bundle; let callCount = 0; return 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) { bundle = outputBundle; assert.strictEqual(isWrite, true); } }, { writeBundle(options, outputBundle) { assert.deepStrictEqual(options.file, file); assert.deepStrictEqual(outputBundle, bundle); callCount++; } } ] }) .then(bundle => bundle.write({ format: 'es', file })) .then(() => { assert.strictEqual(callCount, 1); return sander.rimraf(TEMP_DIR); }); }); 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 i = 0; i < 5; i++) promise = promise.then(() => rollup.rollup({ cache: bundle.cache, input: 'input', experimentalCacheExpiry: 5, plugins: [ loader({ input: `alert('hello')` }), { name: 'x', buildStart() { if (i === 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 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(err => { assert.ok(err); }) .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(err => { watcher.close(); assert.strictEqual( err.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(err => { watcher.close(); assert.strictEqual( err.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(err => { watcher.close(); assert.strictEqual( err.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, options) { 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-c.js', imports: [], modules: ['c'] }, { fileName: 'generated-b.js', imports: ['generated-c.js'], modules: ['b'] } ]); }); }); 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(output => { assert.strictEqual(augmentChunkHashCalls, 1); }); }); it('passes bundle object to generateBundle hook', () => rollup .rollup({ input: 'input', plugins: [ loader({ input: `alert('hello')` }), { transform() { const assetId = this.emitAsset('test.ext', 'hello world'); return `export default import.meta.ROLLUP_ASSET_URL_${assetId};`; }, generateBundle(options, outputBundle, isWrite) { assert.strictEqual(outputBundle['assets/test-0a676135.ext'].source, 'hello world'); assert.strictEqual( outputBundle['input.js'].code, `var input = new URL('assets/test-0a676135.ext', import.meta.url).href;\n\nexport { input as default };\n` ); } } ] }) .then(bundle => bundle.generate({ format: 'es' }))); 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', () => { return rollup .rollup({ input: 'input.js', plugins: [ { resolveId: id => id, load: () => `export default 5` } ] }) .then(bundle => { return bundle.generate({ format: 'es', sanitizeFileName: false, entryFileNames: 'test:[name]' }); }) .then(({ output }) => { assert.strictEqual(output[0].fileName, 'test:input'); }); }); describe('deprecated', () => { 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_CHUNK_URL_${this.emitChunk('chunk')};`; } } } ] }) .then(bundle => { cache = bundle.cache; return bundle.generate({ format: 'es' }); }) .then(({ output }) => { assert.strictEqual( output[0].code, `var input = new URL('chunk-928cb70b.js', import.meta.url).href;\n\nexport { input as default };\n` ); assert.strictEqual(output[1].fileName, 'chunk-928cb70b.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-928cb70b.js', import.meta.url).href;\n\nexport { input as default };\n` ); assert.strictEqual(output[1].fileName, 'chunk-928cb70b.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-928cb70b.js', import.meta.url).href;\n\nexport { input as default };\n` ); assert.strictEqual(output[1].fileName, 'chunk-928cb70b.js'); assert.strictEqual(output[1].code, `console.log('chunk');\n`); }); }); it('caches asset emission in transform hook', () => { let cache; return rollup .rollup({ input: 'input', plugins: [ loader({ input: '' }), { transform() { const assetId = this.emitAsset('test.ext', 'hello world'); return `export default import.meta.ROLLUP_ASSET_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-0a676135.ext', import.meta.url).href;\n\nexport { input as default };\n` ); assert.strictEqual(output[1].fileName, 'assets/test-0a676135.ext'); assert.strictEqual(output[1].source, 'hello world'); assert.strictEqual(output[1].fileName, 'assets/test-0a676135.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-0a676135.ext', import.meta.url).href;\n\nexport { input as default };\n` ); assert.strictEqual(output[1].fileName, 'assets/test-0a676135.ext'); assert.strictEqual(output[1].source, 'hello world'); assert.strictEqual(output[1].fileName, 'assets/test-0a676135.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-0a676135.ext', import.meta.url).href;\n\nexport { input as default };\n` ); assert.strictEqual(output[1].fileName, 'assets/test-0a676135.ext'); assert.strictEqual(output[1].source, 'hello world'); assert.strictEqual(output[1].fileName, 'assets/test-0a676135.ext'); assert.strictEqual(output[1].source, 'hello world'); }); }); 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.emitAsset('test.ext', 'hello world'); return `export default import.meta.ROLLUP_ASSET_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-0a676135.ext', import.meta.url).href;\n\nexport { input as default };\n` ); assert.strictEqual(output[1].fileName, 'assets/test-0a676135.ext'); assert.strictEqual(output[1].source, 'hello world'); assert.strictEqual(output[1].fileName, 'assets/test-0a676135.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('allows setting asset source at generateBundle', () => { let assetId; return rollup .rollup({ input: 'input', plugins: [ loader({ input: `alert('hello')` }), { transform() { return ''; }, generateBundle() { assetId = this.emitAsset('test.ext'); this.setAssetSource(assetId, 'hello world'); } } ] }) .then(bundle => bundle.generate({ format: 'es' })) .then(({ output: [, output] }) => { assert.strictEqual(output.source, 'hello world'); }); }); it('allows setting asset source separately', () => { let assetId; return rollup .rollup({ input: 'input', plugins: [ loader({ input: `alert('hello')` }), { transform() { assetId = this.emitAsset('test.ext'); return ''; }, generateBundle() { this.setAssetSource(assetId, 'hello world'); } } ] }) .then(bundle => bundle.generate({ format: 'es' })) .then(({ output: [, output] }) => { assert.strictEqual(output.fileName, 'assets/test-0a676135.ext'); assert.strictEqual(output.source, 'hello world'); }); }); }); }); rollup-2.61.1/test/incremental/000077500000000000000000000000001415504077600164075ustar00rootroot00000000000000rollup-2.61.1/test/incremental/index.js000066400000000000000000000166101415504077600200600ustar00rootroot00000000000000const assert = require('assert'); const acorn = require('acorn'); const rollup = require('../../dist/rollup'); const { executeBundle } = require('../utils.js'); describe('incremental', () => { let resolveIdCalls; let transformCalls; let modules; const plugin = { resolveId: id => { resolveIdCalls++; return id === 'external' ? false : id; }, load: id => { return 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(bundle => { 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(() => { return 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(() => { return 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;`; 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(() => { return 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', () => { return rollup .rollup({ input: 'entry', plugins: [plugin] }) .then(bundle => { const asts = {}; bundle.cache.modules.forEach(module => { 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(err => { return cache; }); }) .then(cache => { modules.foo = `export default 42;`; return rollup .rollup({ input: 'entry', plugins: [plugin], cache }) .then(bundle => { return 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', external: false, meta: {}, moduleSideEffects: true, syntheticNamedExports: false }, external: { id: 'external', external: true, meta: {}, moduleSideEffects: true, 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) { assert.deepStrictEqual(this.getModuleInfo(id).meta, { test: { resolved: id } }); return { code: modules[id], meta: { test: { loaded: id } } }; }, transform(code, id) { transformCalls++; assert.deepStrictEqual(this.getModuleInfo(id).meta, { test: { loaded: id } }); return { code, meta: { test: { transformed: id } } }; }, moduleParsed({ id, meta }) { assert.deepStrictEqual(meta, { test: { transformed: id } }); moduleParsedCalls++; }, buildEnd() { assert.deepStrictEqual( [...this.getModuleIds()].map(id => ({ id, meta: this.getModuleInfo(id).meta })), [ { id: 'entry', meta: { test: { transformed: 'entry' } } }, { id: 'foo', meta: { test: { transformed: 'foo' } } } ] ); } }; 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 }); }); rollup-2.61.1/test/leak/000077500000000000000000000000001415504077600150225ustar00rootroot00000000000000rollup-2.61.1/test/leak/index.js000066400000000000000000000016651415504077600164770ustar00rootroot00000000000000const path = require('path'); const weak = require('weak-napi'); const rollup = require('../..'); var shouldCollect = false; var isCollected = false; function onCollect() { isCollected = true; } const wait = () => new Promise(resolve => setTimeout(resolve)); async function waitForGC() { const startTime = process.hrtime(); do { global.gc(); await wait(); } 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(err => { console.error(err.message); process.exit(1); }); rollup-2.61.1/test/leak/main.js000066400000000000000000000000211415504077600162750ustar00rootroot00000000000000console.log(42); rollup-2.61.1/test/load-config-file/000077500000000000000000000000001415504077600172055ustar00rootroot00000000000000rollup-2.61.1/test/load-config-file/index.js000066400000000000000000000012071415504077600206520ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const loadConfigFile = require('../../dist/loadConfigFile.js'); describe('loadConfigFile', () => { it('loads a config file', async () => { const { options, warnings } = await loadConfigFile( path.resolve(__dirname, 'samples/basic/rollup.config.js') ); assert.strictEqual(warnings.count, 0); assert.deepStrictEqual(JSON.parse(JSON.stringify(options)), [ { external: [], input: 'my-input', output: [ { file: 'my-file', format: 'es', plugins: [] } ], plugins: [ { name: 'stdin' } ] } ]); }); }); rollup-2.61.1/test/load-config-file/samples/000077500000000000000000000000001415504077600206515ustar00rootroot00000000000000rollup-2.61.1/test/load-config-file/samples/basic/000077500000000000000000000000001415504077600217325ustar00rootroot00000000000000rollup-2.61.1/test/load-config-file/samples/basic/rollup.config.js000066400000000000000000000001271415504077600250510ustar00rootroot00000000000000export default { input: 'my-input', output: { file: 'my-file', format: 'es' } } rollup-2.61.1/test/misc/000077500000000000000000000000001415504077600150415ustar00rootroot00000000000000rollup-2.61.1/test/misc/acorn-plugins.js000066400000000000000000000022771415504077600201700ustar00rootroot00000000000000const assert = require('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-2.61.1/test/misc/bundle-information.js000066400000000000000000000442751415504077600212070ustar00rootroot00000000000000const assert = require('assert'); const rollup = require('../../dist/rollup'); const { loader } = require('../utils.js'); describe('The bundle object', () => { it('contains information about the generated chunks', () => { return 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-ff0de9c1.js', 'input2-28dc81ee.js', 'generated-shared-c4fdd061.js'], 'fileName' ); assert.deepEqual( output.map(chunk => chunk.code), [ `import { u as used, s as shared } from './generated-shared-c4fdd061.js';\n\nconsole.log("input1", used, shared);const out = true;\n\nexport { out };\n`, `import './generated-shared-c4fdd061.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-c4fdd061.js'], ['generated-shared-c4fdd061.js'], []], 'imports' ); assert.deepEqual( output.map(chunk => chunk.importedBindings), [ { 'generated-shared-c4fdd061.js': ['u', 's'] }, { 'generated-shared-c4fdd061.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', () => { return 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', () => { return 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', () => { return 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', () => { return 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', () => { return 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', () => { return 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', () => { return rollup .rollup({ input: ['input', 'dynamic1'], preserveModules: true, 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' }) ) .then(({ output }) => { assert.deepEqual( output.map(chunk => chunk.fileName), [ '_virtual/input.js', '_virtual/dynamic1.js', '_virtual/other.js', '_virtual/dynamic2.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 other = "other";\n\nexport { other };\n', 'const dynamic2 = "dynamic2";\n\nexport { dynamic2 };\n' ], 'code' ); assert.deepEqual( output.map(chunk => chunk.name), ['input', 'dynamic1', 'other', 'dynamic2'], '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'], ['other'], ['dynamic2']], '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: 141 } }, { dynamic1: { code: 'const dynamic1 = "dynamic1";', originalLength: 34, removedExports: [], renderedExports: ['dynamic1'], renderedLength: 28 } }, { other: { code: 'const other = "other";', originalLength: 28, removedExports: [], renderedExports: ['other'], renderedLength: 22 } }, { dynamic2: { code: 'const dynamic2 = "dynamic2";', originalLength: 34, removedExports: [], renderedExports: ['dynamic2'], renderedLength: 28 } } ], 'modules' ); assert.deepEqual( output.map(chunk => chunk.isDynamicEntry), [false, true, false, true], 'isDynamicEntry' ); assert.deepEqual( output.map(chunk => chunk.facadeModuleId), ['input', 'dynamic1', 'other', 'dynamic2'], 'facadeModuleId' ); }); }); it('contains correct information about rendered/removedExports when directly exporting items', () => { return 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', () => { return 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-2.61.1/test/misc/deprecations.js000066400000000000000000000007411415504077600200610ustar00rootroot00000000000000const assert = require('assert'); const rollup = require('../../dist/rollup'); const { loader } = require('../utils.js'); describe('deprecations', () => { it('supports es format alias', () => { return rollup .rollup({ input: 'x', plugins: [loader({ x: 'export const x = function () {}' })] }) .then(bundle => bundle.generate({ format: 'es' })) .then(({ output: [{ code }] }) => { assert.equal(code, 'const x = function () {};\n\nexport { x };\n'); }); }); }); rollup-2.61.1/test/misc/iife.js000066400000000000000000000110271415504077600163140ustar00rootroot00000000000000const assert = require('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 fn = new Function(globalKeys, code); fn.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.indexOf('@') === -1 ? `${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((currentVar, nextKey) => currentVar[nextKey] || {}, global); } return {}; } function getIifeCode(inputCode, outputOptions) { return rollup .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') ); }); } ['bundle', '@my.@nested/value.bundle'].forEach(name => [false, true].forEach(compact => 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".' }) )); 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".' }) )); 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' + "\tObject.defineProperty(exports, '__esModule', { value: true });\n" + '\n' + '})(this["my=name"] = this["my=name"] || {});\n' ) )); }); rollup-2.61.1/test/misc/in-memory-sourcemaps.js000066400000000000000000000016151415504077600214750ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const { getLocator } = require('locate-character'); 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 = 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-2.61.1/test/misc/index.js000066400000000000000000000003171415504077600165070ustar00rootroot00000000000000require('./acorn-plugins'); require('./bundle-information'); require('./deprecations'); require('./iife'); require('./in-memory-sourcemaps'); require('./misc'); require('./sanity-checks'); require('./umd'); rollup-2.61.1/test/misc/misc.js000066400000000000000000000160261415504077600163370ustar00rootroot00000000000000const assert = require('assert'); const rollup = require('../../dist/rollup'); const { assertIncludes, 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/snowpackjs/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', guess: '_', message: "No name was provided for external module 'lodash' in output.globals – guessing '_'", source: 'lodash' } ]); }); }); 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-f8bec8a7.js', 'dyndep-b0a9ee12.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', () => { return 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' }, 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");' }) ] }); const { output: [main, feature, subfeature] } = await bundle.generate({ entryFileNames: `[name]`, chunkFileNames: `[name]`, format: 'es' }); assert.strictEqual(main.fileName, 'base/main'); assert.ok(main.code.startsWith('function fn')); 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'")); }); it('throws the proper error on max call stack exception', async () => { const count = 10000; let source = ''; for (let i = 0; i < count; i++) { source += `if (foo) {`; } for (let i = 0; i < count; i++) { source += '}'; } try { await rollup.rollup({ input: { input: 'input' }, plugins: [ loader({ input: source }) ] }); } catch (err) { assert.notDeepStrictEqual(err.message, 'Maximum call stack size exceeded'); assert.strictEqual(err.name, 'Error'); } }); }); rollup-2.61.1/test/misc/optionList.js000066400000000000000000000035201415504077600175430ustar00rootroot00000000000000exports.input = 'acorn, acornInjectPlugins, cache, context, experimentalCacheExpiry, external, inlineDynamicImports, input, makeAbsoluteExternalsRelative, manualChunks, maxParallelFileReads, moduleContext, onwarn, perf, plugins, preserveEntrySignatures, preserveModules, preserveSymlinks, shimMissingExports, strictDeprecations, treeshake, watch'; exports.flags = 'acorn, acornInjectPlugins, amd, assetFileNames, banner, c, cache, chunkFileNames, compact, config, configPlugin, context, d, dir, dynamicImportFunction, e, entryFileNames, environment, esModule, experimentalCacheExpiry, exports, extend, external, externalLiveBindings, f, failAfterWarnings, file, footer, format, freeze, g, generatedCode, globals, h, hoistTransitiveImports, i, indent, inlineDynamicImports, input, interop, intro, m, makeAbsoluteExternalsRelative, manualChunks, maxParallelFileReads, minifyInternalExports, moduleContext, n, name, namespaceToStringTag, noConflict, o, onwarn, outro, p, paths, perf, plugin, plugins, preferConst, preserveEntrySignatures, preserveModules, preserveModulesRoot, preserveSymlinks, sanitizeFileName, shimMissingExports, silent, sourcemap, sourcemapExcludeSources, sourcemapFile, stdin, strict, strictDeprecations, systemNullSetters, treeshake, v, validate, w, waitForBundleInput, watch'; exports.output = 'amd, assetFileNames, banner, chunkFileNames, compact, dir, dynamicImportFunction, entryFileNames, esModule, exports, extend, 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, sourcemapExcludeSources, sourcemapFile, sourcemapPathTransform, strict, systemNullSetters, validate'; rollup-2.61.1/test/misc/sanity-checks.js000066400000000000000000000204451415504077600201510ustar00rootroot00000000000000const assert = require('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 args; await rollup.rollup({ input: 'x', plugins: [loader({ x: `eval(42);` })], onwarn(warning, onwarn) { args = [warning, onwarn]; } }); assert.equal(args[0].code, 'EVAL'); assert.equal( args[0].message, 'Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification' ); assert.equal(typeof args[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, 'You must specify "output.format", which can be one of "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', inlineDynamicImports: true, plugins: [loader({ x: 'console.log( "x" );import("y");', y: 'console.log( "y" );' })] }); await bundle.generate({ file: 'x', format: 'es' }); }); 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-2.61.1/test/misc/umd.js000066400000000000000000000137301415504077600161700ustar00rootroot00000000000000const assert = require('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 fn = new Function(globalKeys, code); fn.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, outputOptions) { let defineArgs; function define(...args) { defineArgs = args; } define.amd = true; runTestCode(code, undefined, { define }); if (typeof defineArgs[0] === 'function') { return defineArgs[0]() || {}; } const module = { exports: {} }; const result = defineArgs[1]( ...defineArgs[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 defineArgs[0].indexOf('exports') === -1 ? result : module.exports; } 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((currentVar, nextKey) => currentVar[nextKey] || {}, global); } return {}; } async function getUmdCode(inputCode, outputOptions) { const bundle = await rollup.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)); } [ { 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 } ].forEach(({ environmentName, runTest }) => it(`works in ${environmentName} environment`, async () => { assert.deepEqual( runTest(await getUmdCodePromise(), outputOptions), expectedExports, 'expected exports are returned' ); }) ); } ['bundle', 'my.@nested/value.bundle'].forEach(name => [false, true].forEach(compact => [false, true].forEach(noConflict => 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-2.61.1/test/node_modules/000077500000000000000000000000001415504077600165635ustar00rootroot00000000000000rollup-2.61.1/test/node_modules/external.js000066400000000000000000000000461415504077600207430ustar00rootroot00000000000000module.exports = { external: true }; rollup-2.61.1/test/sourcemaps/000077500000000000000000000000001415504077600162675ustar00rootroot00000000000000rollup-2.61.1/test/sourcemaps/getLocation.js000066400000000000000000000010221415504077600210700ustar00rootroot00000000000000module.exports = function getLocation(source, search) { var lines = source.split('\n'); var len = lines.length; var lineStart = 0; var i; const charIndex = typeof search === 'number' ? search : source.indexOf(search); for (i = 0; i < len; i += 1) { var line = lines[i]; var lineEnd = lineStart + line.length + 1; // +1 for newline if (lineEnd > charIndex) { return { line: i + 1, column: charIndex - lineStart }; } lineStart = lineEnd; } throw new Error('Could not determine location of character'); }; rollup-2.61.1/test/sourcemaps/index.js000066400000000000000000000034541415504077600177420ustar00rootroot00000000000000const path = require('path'); const rollup = require('../../dist/rollup'); const { compareWarnings, runTestSuiteWithSamples } = require('../utils.js'); const FORMATS = ['amd', 'cjs', 'system', 'es', 'iife', 'umd']; runTestSuiteWithSamples('sourcemaps', path.resolve(__dirname, 'samples'), (dir, config) => { (config.skip ? describe.skip : config.solo ? describe.only : describe)( path.basename(dir) + ': ' + config.description, () => { for (const format of config.formats || FORMATS) { it('generates ' + format, async () => { process.chdir(dir); const warnings = []; const inputOptions = { input: dir + '/main.js', onwarn: warning => warnings.push(warning), strictDeprecations: true, ...(config.options || {}) }; const outputOptions = { exports: 'auto', file: dir + '/_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) { await bundle.write(outputOptions); if (config.warnings) { compareWarnings(warnings, config.warnings); } else if (warnings.length) { throw new Error(`Unexpected warnings`); } if (config.test) { const { output: [{ code, map }] } = await bundle.generate(outputOptions); await config.test(code, map, { format }); } } rollup-2.61.1/test/sourcemaps/samples/000077500000000000000000000000001415504077600177335ustar00rootroot00000000000000rollup-2.61.1/test/sourcemaps/samples/basic-support/000077500000000000000000000000001415504077600225265ustar00rootroot00000000000000rollup-2.61.1/test/sourcemaps/samples/basic-support/_config.js000066400000000000000000000023401415504077600244670ustar00rootroot00000000000000const assert = require('assert'); const { SourceMapConsumer } = require('source-map'); const getLocation = require('../../getLocation'); module.exports = { 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-2.61.1/test/sourcemaps/samples/basic-support/bar.js000066400000000000000000000001101415504077600236200ustar00rootroot00000000000000export default function bar () { console.log( 'hello from bar.js' ); } rollup-2.61.1/test/sourcemaps/samples/basic-support/foo.js000066400000000000000000000001101415504077600236370ustar00rootroot00000000000000export default function foo () { console.log( 'hello from foo.js' ); } rollup-2.61.1/test/sourcemaps/samples/basic-support/main.js000066400000000000000000000001471415504077600240120ustar00rootroot00000000000000import foo from './foo'; import bar from './bar'; console.log( 'hello from main.js' ); foo(); bar(); rollup-2.61.1/test/sourcemaps/samples/combined-sourcemap-with-loader/000077500000000000000000000000001415504077600257245ustar00rootroot00000000000000rollup-2.61.1/test/sourcemaps/samples/combined-sourcemap-with-loader/_config.js000066400000000000000000000047251415504077600276760ustar00rootroot00000000000000const assert = require('assert'); const fs = require('fs'); const buble = require('buble'); const MagicString = require('magic-string'); const { SourceMapConsumer } = require('source-map'); const getLocation = require('../../getLocation'); module.exports = { description: 'get combined sourcemap in transforming with loader', options: { plugins: [ { load(id) { const code = fs.readFileSync(id, 'utf-8'); const out = buble.transform(code, { transforms: { modules: false }, sourceMap: true, source: id }); return { code: out.code, map: out.map }; } }, { 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 }) }; } }, { 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-2.61.1/test/sourcemaps/samples/combined-sourcemap-with-loader/foo.js000066400000000000000000000000351415504077600270430ustar00rootroot00000000000000export const foo = () => 42; rollup-2.61.1/test/sourcemaps/samples/combined-sourcemap-with-loader/main.js000066400000000000000000000001101415504077600271760ustar00rootroot00000000000000import { foo } from './foo'; console.info( `the answer is ${foo()}` ); rollup-2.61.1/test/sourcemaps/samples/combined-sourcemap/000077500000000000000000000000001415504077600235075ustar00rootroot00000000000000rollup-2.61.1/test/sourcemaps/samples/combined-sourcemap/_config.js000066400000000000000000000042201415504077600254470ustar00rootroot00000000000000const assert = require('assert'); const MagicString = require('magic-string'); const { SourceMapConsumer } = require('source-map'); const getLocation = require('../../getLocation'); module.exports = { description: 'get combined sourcemap in transforming', options: { plugins: [ { 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 }) }; } }, { 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-2.61.1/test/sourcemaps/samples/combined-sourcemap/foo.js000066400000000000000000000000351415504077600246260ustar00rootroot00000000000000export const foo = () => 42; rollup-2.61.1/test/sourcemaps/samples/combined-sourcemap/main.js000066400000000000000000000001101415504077600247610ustar00rootroot00000000000000import { foo } from './foo'; console.info( `the answer is ${foo()}` ); rollup-2.61.1/test/sourcemaps/samples/excludes-plugin-helpers/000077500000000000000000000000001415504077600245035ustar00rootroot00000000000000rollup-2.61.1/test/sourcemaps/samples/excludes-plugin-helpers/_config.js000066400000000000000000000011511415504077600264430ustar00rootroot00000000000000const assert = require('assert'); const fs = require('fs'); const path = require('path'); const HELPER = '\0helper'; module.exports = { description: 'excludes plugin helpers from sources', options: { output: { format: 'cjs' }, plugins: [ { resolveId(id) { if (id === HELPER) return id; }, load(id) { if (id === HELPER) { return fs.readFileSync(path.join(__dirname, 'helper.js'), 'utf-8'); } } } ] }, test: (code, map) => { assert.equal(map.sources.length, 1); assert.equal(map.sourcesContent.length, 1); assert.ok(/main/.test(map.sources[0])); } }; rollup-2.61.1/test/sourcemaps/samples/excludes-plugin-helpers/helper.js000066400000000000000000000001061415504077600263150ustar00rootroot00000000000000export default function foo ( input ) { assert.equal( input, 42 ); } rollup-2.61.1/test/sourcemaps/samples/excludes-plugin-helpers/main.js000066400000000000000000000000501415504077600257600ustar00rootroot00000000000000import foo from '\0helper'; foo( 42 ); rollup-2.61.1/test/sourcemaps/samples/existing-external-sourcemaps-combined/000077500000000000000000000000001415504077600273425ustar00rootroot00000000000000rollup-2.61.1/test/sourcemaps/samples/existing-external-sourcemaps-combined/_config.js000066400000000000000000000002701415504077600313030ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'removes sourcemap comments', async test(code) { assert.strictEqual(code.indexOf('sourceMappingURL'), -1); } }; rollup-2.61.1/test/sourcemaps/samples/existing-external-sourcemaps-combined/main.js000066400000000000000000000001521415504077600306220ustar00rootroot00000000000000import value from "./other"; const s = `other: ${value}`; console.log(s); //# sourceMappingURL=main.js.maprollup-2.61.1/test/sourcemaps/samples/existing-external-sourcemaps-combined/main.js.map000066400000000000000000000003141415504077600313760ustar00rootroot00000000000000{"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-2.61.1/test/sourcemaps/samples/existing-external-sourcemaps-combined/other.js000066400000000000000000000001041415504077600310140ustar00rootroot00000000000000const x = "foo"; export default x; //# sourceMappingURL=other.js.maprollup-2.61.1/test/sourcemaps/samples/existing-external-sourcemaps-combined/other.js.map000066400000000000000000000002211415504077600315700ustar00rootroot00000000000000{"version":3,"file":"other.js","sourceRoot":"","sources":["other.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,GAAW,KAAK,CAAC;AACxB,eAAe,CAAC,CAAC"}rollup-2.61.1/test/sourcemaps/samples/existing-inline-sourcemaps-combined/000077500000000000000000000000001415504077600267765ustar00rootroot00000000000000rollup-2.61.1/test/sourcemaps/samples/existing-inline-sourcemaps-combined/_config.js000066400000000000000000000003001415504077600307310ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'removes existing inline sourcemaps', async test(code) { assert.strictEqual(code.indexOf('sourceMappingURL'), -1); } }; rollup-2.61.1/test/sourcemaps/samples/existing-inline-sourcemaps-combined/main.js000066400000000000000000000006141415504077600302610ustar00rootroot00000000000000import value from "./other"; const s = `other: ${value}`; console.log(s); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIm1haW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE1BQU0sU0FBUyxDQUFDO0FBRTVCLE1BQU0sQ0FBQyxHQUFXLFVBQVUsS0FBSyxFQUFFLENBQUM7QUFFcEMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsQ0FBQyJ9rollup-2.61.1/test/sourcemaps/samples/existing-inline-sourcemaps-combined/other.js000066400000000000000000000004311415504077600304530ustar00rootroot00000000000000const x = "foo"; export default x; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3RoZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJvdGhlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQUMsR0FBVyxLQUFLLENBQUM7QUFDeEIsZUFBZSxDQUFDLENBQUMifQ==rollup-2.61.1/test/sourcemaps/samples/loaders/000077500000000000000000000000001415504077600213645ustar00rootroot00000000000000rollup-2.61.1/test/sourcemaps/samples/loaders/_config.js000066400000000000000000000034751415504077600233370ustar00rootroot00000000000000const assert = require('assert'); const fs = require('fs'); const buble = require('buble'); const { SourceMapConsumer } = require('source-map'); const getLocation = require('../../getLocation'); module.exports = { 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 = fs.readFileSync(id, 'utf-8'); 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-2.61.1/test/sourcemaps/samples/loaders/bar.js000066400000000000000000000000511415504077600224620ustar00rootroot00000000000000/*misalign*/export const foo = () => 20; rollup-2.61.1/test/sourcemaps/samples/loaders/foo.js000066400000000000000000000000441415504077600225030ustar00rootroot00000000000000/*the*/export const bar = () => 22; rollup-2.61.1/test/sourcemaps/samples/loaders/main.js000066400000000000000000000001671415504077600226520ustar00rootroot00000000000000import { foo } from './foo'; import { bar } from './bar'; /*columns*/console.log( `the answer is ${foo() + bar()}` ); rollup-2.61.1/test/sourcemaps/samples/names-transformed-render-chunk/000077500000000000000000000000001415504077600257435ustar00rootroot00000000000000rollup-2.61.1/test/sourcemaps/samples/names-transformed-render-chunk/_config.js000066400000000000000000000026101415504077600277040ustar00rootroot00000000000000const assert = require('assert'); const MagicString = require('magic-string'); const { SourceMapConsumer } = require('source-map'); const terser = require('terser'); const getLocation = require('../../getLocation'); module.exports = { 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-2.61.1/test/sourcemaps/samples/names-transformed-render-chunk/a.js000066400000000000000000000001771415504077600265260ustar00rootroot00000000000000var mangleMe = "this string should not be inlined".toLowerCase(); export default function () { assert.equal( mangleMe, 1 ); } rollup-2.61.1/test/sourcemaps/samples/names-transformed-render-chunk/b.js000066400000000000000000000001611415504077600265200ustar00rootroot00000000000000var mangleMe = "nor should this one".toLowerCase(); export default function () { assert.equal( mangleMe, 2 ); } rollup-2.61.1/test/sourcemaps/samples/names-transformed-render-chunk/main.js000066400000000000000000000000731415504077600272250ustar00rootroot00000000000000import a from './a.js'; import b from './b.js'; a(); b(); rollup-2.61.1/test/sourcemaps/samples/names/000077500000000000000000000000001415504077600210365ustar00rootroot00000000000000rollup-2.61.1/test/sourcemaps/samples/names/_config.js000066400000000000000000000015511415504077600230020ustar00rootroot00000000000000const assert = require('assert'); const { SourceMapConsumer } = require('source-map'); const getLocation = require('../../getLocation'); module.exports = { 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$\d]+)\.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$\d]+)/; match = pattern.exec(code); generatedLoc = getLocation(code, match.index + 'function '.length); original = smc.originalPositionFor(generatedLoc); assert.equal(original.name, 'Foo'); } }; rollup-2.61.1/test/sourcemaps/samples/names/bar.js000066400000000000000000000000421415504077600221340ustar00rootroot00000000000000export default function Foo () {} rollup-2.61.1/test/sourcemaps/samples/names/foo.js000066400000000000000000000001551415504077600221600ustar00rootroot00000000000000import Bar from './bar'; export default function Foo () {} Foo.prototype = Object.create( Bar.prototype ); rollup-2.61.1/test/sourcemaps/samples/names/main.js000066400000000000000000000000501415504077600223130ustar00rootroot00000000000000export { default as Foo } from './foo'; rollup-2.61.1/test/sourcemaps/samples/reified-namespace/000077500000000000000000000000001415504077600232745ustar00rootroot00000000000000rollup-2.61.1/test/sourcemaps/samples/reified-namespace/_config.js000066400000000000000000000013471415504077600252430ustar00rootroot00000000000000const assert = require('assert'); const fs = require('fs'); const path = require('path'); const { SourceMapConsumer } = require('source-map'); const getLocation = require('../../getLocation'); module.exports = { description: 'generates correct sourcemap with reified namespace (#668)', async test(code, map) { const smc = await new SourceMapConsumer(map); const main = fs.readFileSync(path.join(__dirname, 'main.js'), 'utf-8'); 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-2.61.1/test/sourcemaps/samples/reified-namespace/foo.js000066400000000000000000000000251415504077600244120ustar00rootroot00000000000000export var bar = 42; rollup-2.61.1/test/sourcemaps/samples/reified-namespace/main.js000066400000000000000000000001071415504077600245540ustar00rootroot00000000000000import * as foo from './foo.js'; assert.deepEqual( foo, { bar: 42 }); rollup-2.61.1/test/sourcemaps/samples/relative-paths/000077500000000000000000000000001415504077600226635ustar00rootroot00000000000000rollup-2.61.1/test/sourcemaps/samples/relative-paths/_config.js000066400000000000000000000005161415504077600246270ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { 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-2.61.1/test/sourcemaps/samples/relative-paths/main.js000066400000000000000000000000231415504077600241400ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/sourcemaps/samples/render-chunk-babili/000077500000000000000000000000001415504077600235405ustar00rootroot00000000000000rollup-2.61.1/test/sourcemaps/samples/render-chunk-babili/_config.js000066400000000000000000000017361415504077600255110ustar00rootroot00000000000000const assert = require('assert'); const { SourceMapConsumer } = require('source-map'); const getLocation = require('../../getLocation'); const babiliResults = require('./babili-results'); module.exports = { description: 'generates valid sourcemap when source could not be determined', options: { plugins: [ { 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-2.61.1/test/sourcemaps/samples/render-chunk-babili/babili-results.js000066400000000000000000000031701415504077600270200ustar00rootroot00000000000000exports.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-2.61.1/test/sourcemaps/samples/render-chunk-babili/main.js000066400000000000000000000000231415504077600250150ustar00rootroot00000000000000console.log( 42 ); rollup-2.61.1/test/sourcemaps/samples/render-chunk/000077500000000000000000000000001415504077600223205ustar00rootroot00000000000000rollup-2.61.1/test/sourcemaps/samples/render-chunk/_config.js000066400000000000000000000017411415504077600242650ustar00rootroot00000000000000const assert = require('assert'); const { SourceMapConsumer } = require('source-map'); const terser = require('terser'); const getLocation = require('../../getLocation'); module.exports = { description: 'preserves sourcemap chains when transforming', options: { plugins: [ { 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-2.61.1/test/sourcemaps/samples/render-chunk/main.js000066400000000000000000000000231415504077600235750ustar00rootroot00000000000000console.log( 42 ); rollup-2.61.1/test/sourcemaps/samples/single-length-segments/000077500000000000000000000000001415504077600243165ustar00rootroot00000000000000rollup-2.61.1/test/sourcemaps/samples/single-length-segments/_config.js000066400000000000000000000021151415504077600262570ustar00rootroot00000000000000const assert = require('assert'); const fs = require('fs'); const path = require('path'); const { SourceMapConsumer } = require('source-map'); const getLocation = require('../../getLocation'); const original = fs.readFileSync(path.resolve(__dirname, 'main.js'), 'utf-8'); module.exports = { description: 'handles single-length sourcemap segments', options: { plugins: [ { transform() { return { code: fs.readFileSync(path.resolve(__dirname, 'output.js'), 'utf-8'), map: fs.readFileSync(path.resolve(__dirname, 'output.js.map'), 'utf-8') }; } } ], output: { name: 'x' } }, async test(code, map) { const smc = await new SourceMapConsumer(map); ['Foo', 'log'].forEach(token => { 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-2.61.1/test/sourcemaps/samples/single-length-segments/main.js000066400000000000000000000001011415504077600255700ustar00rootroot00000000000000class Foo { bar () { console.log( 42 ); } } export { Foo }; rollup-2.61.1/test/sourcemaps/samples/single-length-segments/output.js000066400000000000000000000003431415504077600262140ustar00rootroot00000000000000var Foo = function () { function Foo() { babelHelpers.classCallCheck(this, Foo); } babelHelpers.createClass(Foo, [{ key: "bar", value: function bar() { console.log(42); } }]); return Foo; }(); export { Foo }; rollup-2.61.1/test/sourcemaps/samples/single-length-segments/output.js.map000066400000000000000000000004021415504077600267640ustar00rootroot00000000000000{ "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-2.61.1/test/sourcemaps/samples/sourcemap-file/000077500000000000000000000000001415504077600226465ustar00rootroot00000000000000rollup-2.61.1/test/sourcemaps/samples/sourcemap-file/_config.js000066400000000000000000000004761415504077600246170ustar00rootroot00000000000000const assert = require('assert'); module.exports = { description: 'populates file property of sourcemap when plugins are used (#986)', options: { plugins: [ { transform() { return null; } } ] }, test: (code, map, profile) => { assert.equal(map.file, `bundle.${profile.format}.js`); } }; rollup-2.61.1/test/sourcemaps/samples/sourcemap-file/main.js000066400000000000000000000000231415504077600241230ustar00rootroot00000000000000console.log( 42 ); rollup-2.61.1/test/sourcemaps/samples/transform-full-source-paths/000077500000000000000000000000001415504077600253215ustar00rootroot00000000000000rollup-2.61.1/test/sourcemaps/samples/transform-full-source-paths/_config.js000066400000000000000000000010061415504077600272600ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { 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-2.61.1/test/sourcemaps/samples/transform-full-source-paths/main.js000066400000000000000000000000231415504077600265760ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/sourcemaps/samples/transform-source-paths/000077500000000000000000000000001415504077600243615ustar00rootroot00000000000000rollup-2.61.1/test/sourcemaps/samples/transform-source-paths/_config.js000066400000000000000000000006411415504077600263240ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); module.exports = { 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-2.61.1/test/sourcemaps/samples/transform-source-paths/main.js000066400000000000000000000000231415504077600256360ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/sourcemaps/samples/transform-without-sourcemap-render-chunk/000077500000000000000000000000001415504077600300265ustar00rootroot00000000000000rollup-2.61.1/test/sourcemaps/samples/transform-without-sourcemap-render-chunk/_config.js000066400000000000000000000013351415504077600317720ustar00rootroot00000000000000module.exports = { 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 }; } } ] }, 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/guide/en/#warning-sourcemap-is-likely-to-be-incorrect` } ] }; rollup-2.61.1/test/sourcemaps/samples/transform-without-sourcemap-render-chunk/main.js000066400000000000000000000000231415504077600313030ustar00rootroot00000000000000console.log( 42 ); rollup-2.61.1/test/sourcemaps/samples/transforms/000077500000000000000000000000001415504077600221315ustar00rootroot00000000000000rollup-2.61.1/test/sourcemaps/samples/transforms/_config.js000066400000000000000000000023511415504077600240740ustar00rootroot00000000000000const assert = require('assert'); const buble = require('buble'); const MagicString = require('magic-string'); const { SourceMapConsumer } = require('source-map'); const getLocation = require('../../getLocation'); module.exports = { description: 'preserves sourcemap chains when transforming', options: { plugins: [ { transform(source) { return buble.transform(source, { transforms: { modules: false } }); } }, { 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-2.61.1/test/sourcemaps/samples/transforms/foo.js000066400000000000000000000000351415504077600232500ustar00rootroot00000000000000export const foo = () => 42; rollup-2.61.1/test/sourcemaps/samples/transforms/main.js000066400000000000000000000001071415504077600234110ustar00rootroot00000000000000import { foo } from './foo'; console.log( `the answer is ${foo()}` ); rollup-2.61.1/test/sourcemaps/samples/untransformed-modules/000077500000000000000000000000001415504077600242705ustar00rootroot00000000000000rollup-2.61.1/test/sourcemaps/samples/untransformed-modules/_config.js000066400000000000000000000010611415504077600262300ustar00rootroot00000000000000const assert = require('assert'); const MagicString = require('magic-string'); module.exports = { description: 'allows sourcemap chains with some untransformed modules (#404)', options: { plugins: [ { 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-2.61.1/test/sourcemaps/samples/untransformed-modules/foo.js000066400000000000000000000000241415504077600254050ustar00rootroot00000000000000export var foo = 1; rollup-2.61.1/test/sourcemaps/samples/untransformed-modules/main.js000066400000000000000000000000701415504077600255470ustar00rootroot00000000000000import { foo } from './foo.js'; assert.equal( foo, 2 ); rollup-2.61.1/test/test.js000066400000000000000000000007221415504077600154240ustar00rootroot00000000000000require('source-map-support').install(); describe('rollup', function () { this.timeout(30000); 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-2.61.1/test/typescript/000077500000000000000000000000001415504077600163145ustar00rootroot00000000000000rollup-2.61.1/test/typescript/index.ts000066400000000000000000000014151415504077600177740ustar00rootroot00000000000000import * 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' }; }; plugin(); plugin({ extensions: ['.js', 'json'] }); const amdOutputOptions: rollup.OutputOptions['amd'][] = [ {}, { id: 'a' }, { autoId: false, id: 'a' }, { autoId: true, basePath: 'a' }, { autoId: true }, { autoId: false }, { // @ts-expect-error autoId: false, basePath: '', // @ts-expect-error id: 'a' }, { // @ts-expect-error autoId: true, // @ts-expect-error id: 'a' }, { basePath: '', // @ts-expect-error id: 'a' }, // @ts-expect-error { basePath: '' } ]; rollup-2.61.1/test/typescript/tsconfig.json000066400000000000000000000002651415504077600210260ustar00rootroot00000000000000{ "compilerOptions": { "noEmit": true, "strict": true, "pretty": true, "lib": ["es2015"], "types": [] }, "include": ["./dist", "./typings"], "files": ["./index.ts"] } rollup-2.61.1/test/utils.js000066400000000000000000000132301415504077600156030ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const fixturify = require('fixturify'); const sander = require('sander'); exports.compareError = compareError; exports.compareWarnings = compareWarnings; exports.deindent = deindent; exports.executeBundle = executeBundle; exports.getObject = getObject; exports.loader = loader; exports.normaliseOutput = normaliseOutput; exports.runTestSuiteWithSamples = runTestSuiteWithSamples; exports.assertDirectoriesAreEqual = assertDirectoriesAreEqual; exports.assertFilesAreEqual = assertFilesAreEqual; exports.assertIncludes = assertIncludes; function normaliseError(error) { delete error.stack; delete error.toString; return { ...error, message: error.message }; } function compareError(actual, expected) { actual = normaliseError(actual); if (actual.parserError) { actual.parserError = normaliseError(actual.parserError); } if (actual.frame) { actual.frame = actual.frame.replace(/\s+$/gm, ''); } if (expected.frame) { expected.frame = deindent(expected.frame); } assert.deepEqual(actual, expected); } function compareWarnings(actual, expected) { assert.deepEqual( actual.map(warning => { const clone = { ...warning }; delete clone.toString; if (clone.frame) { clone.frame = clone.frame.replace(/\s+$/gm, ''); } return clone; }), expected.map(warning => { if (warning.frame) { warning.frame = deindent(warning.frame); } return warning; }) ); } function deindent(str) { return str.slice(1).replace(/^\t+/gm, '').replace(/\s+$/gm, '').trim(); } 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; } function getObject(entries) { const object = {}; for (const [key, value] of entries) { object[key] = value; } return object; } function loader(modules) { modules = Object.assign(Object.create(null), modules); return { resolveId(id) { return id in modules ? id : null; }, load(id) { return modules[id]; } }; } function normaliseOutput(code) { return code.toString().trim().replace(/\r\n/g, '\n'); } function runTestSuiteWithSamples(suiteName, samplesDir, runTest, onTeardown) { describe(suiteName, () => runSamples(samplesDir, runTest, onTeardown)); } // You can run only or skip certain kinds of tests by appending .only or .skip runTestSuiteWithSamples.only = function (suiteName, samplesDir, runTest, onTeardown) { describe.only(suiteName, () => runSamples(samplesDir, runTest, onTeardown)); }; runTestSuiteWithSamples.skip = function (suiteName) { describe.skip(suiteName, () => {}); }; function runSamples(samplesDir, runTest, onTeardown) { if (onTeardown) { afterEach(onTeardown); } sander .readdirSync(samplesDir) .filter(name => name[0] !== '.') .sort() .forEach(fileName => runTestsInDir(path.join(samplesDir, fileName), runTest)); } function runTestsInDir(dir, runTest) { const fileNames = getFileNamesAndRemoveOutput(dir); if (fileNames.indexOf('_config.js') >= 0) { loadConfigAndRunTest(dir, runTest); } else if (fileNames.length === 0) { console.warn(`Removing empty test directory ${dir}`); sander.rmdirSync(dir); } else { describe(path.basename(dir), () => { fileNames .filter(name => name[0] !== '.') .sort() .forEach(fileName => runTestsInDir(path.join(dir, fileName), runTest)); }); } } function getFileNamesAndRemoveOutput(dir) { try { return sander.readdirSync(dir).filter(fileName => { if (fileName === '_actual') { sander.rimrafSync(path.join(dir, '_actual')); return false; } if (fileName === '_actual.js') { sander.unlinkSync(path.join(dir, '_actual.js')); return false; } return true; }); } catch (error) { if (error.code === 'ENOTDIR') { throw new Error( `${dir} 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; } } function loadConfigAndRunTest(dir, runTest) { const configFile = path.join(dir, '_config.js'); const config = require(configFile); if (!config || !config.description) { throw new Error(`Found invalid config without description: ${configFile}`); } if ( (!config.skipIfWindows || process.platform !== 'win32') && (!config.onlyWindows || process.platform === 'win32') && (!config.minNodeVersion || config.minNodeVersion <= Number(/^v(\d+)/.exec(process.version)[1])) ) { runTest(dir, config); } } function assertDirectoriesAreEqual(actualDir, expectedDir) { const actualFiles = fixturify.readSync(actualDir); let expectedFiles; try { expectedFiles = fixturify.readSync(expectedDir); } catch (err) { expectedFiles = []; } assertFilesAreEqual(actualFiles, expectedFiles); } function assertFilesAreEqual(actualFiles, expectedFiles, dirs = []) { Object.keys({ ...actualFiles, ...expectedFiles }).forEach(fileName => { const pathSegments = dirs.concat(fileName); if (typeof actualFiles[fileName] === 'object' && typeof expectedFiles[fileName] === 'object') { return assertFilesAreEqual(actualFiles[fileName], expectedFiles[fileName], pathSegments); } const shortName = pathSegments.join('/'); assert.strictEqual( `${shortName}: ${actualFiles[fileName]}`, `${shortName}: ${expectedFiles[fileName]}` ); }); } function assertIncludes(actual, expected) { try { assert.ok( actual.includes(expected), `${JSON.stringify(actual)}\nincludes\n${JSON.stringify(expected)}` ); } catch (err) { err.actual = actual; err.expected = expected; throw err; } } rollup-2.61.1/test/watch/000077500000000000000000000000001415504077600152145ustar00rootroot00000000000000rollup-2.61.1/test/watch/index.js000066400000000000000000001300741415504077600166660ustar00rootroot00000000000000const assert = require('assert'); const path = require('path'); const sander = require('sander'); const rollup = require('../../dist/rollup'); const cwd = process.cwd(); function wait(ms) { return new Promise(fulfil => { setTimeout(fulfil, ms); }); } describe('rollup.watch', () => { let watcher; beforeEach(() => { process.chdir(cwd); return sander.rimraf('test/_tmp'); }); afterEach(() => { if (watcher) { watcher.close(); watcher = null; } }); function run(file) { const resolved = require.resolve(file); delete require.cache[resolved]; return require(resolved); } function sequence(watcher, events, timeout = 300) { return new Promise((fulfil, reject) => { function go(event) { const next = events.shift(); if (!next) { watcher.close(); fulfil(); } else if (typeof next === 'string') { watcher.once('event', event => { if (event.code !== next) { watcher.close(); if (event.code === 'ERROR') console.log(event.error); reject(new Error(`Expected ${next} event, got ${event.code}`)); } else { go(event); } }); } else { Promise.resolve() .then(() => wait(timeout)) // gah, this appears to be necessary to fix random errors .then(() => next(event)) .then(go) .catch(error => { watcher.close(); reject(error); }); } } go(); }).then(() => wait(100)); } function getTimeDiffInMs(previous) { const [seconds, nanoseconds] = process.hrtime(previous); return seconds * 1e3 + nanoseconds / 1e6; } it('watches a file and triggers reruns if necessary', () => { let triggerRestart = false; return sander .copydir('test/watch/samples/basic') .to('test/_tmp/input') .then(() => { watcher = rollup.watch({ input: 'test/_tmp/input/main.js', plugins: { options(options) { assert.strictEqual(this.meta.watchMode, true, 'watchMode in options'); }, transform(code) { assert.strictEqual(this.meta.watchMode, true, 'watchMode in transform'); if (triggerRestart) { triggerRestart = false; return wait(100) .then(() => sander.writeFileSync('test/_tmp/input/main.js', 'export default 44;')) .then(() => wait(100)) .then(() => 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; sander.writeFileSync('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('does not fail for virtual files', () => { return sander .copydir('test/watch/samples/basic') .to('test/_tmp/input') .then(() => { 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); sander.writeFileSync( '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 sander.copydir('test/watch/samples/basic').to('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, path.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); sander.writeFileSync('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); sander.writeFileSync('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); sander.writeFileSync('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 = path.resolve('test/_tmp/input/watched'); const events = []; let ids; const expectedIds = [WATCHED_ID, path.resolve('test/_tmp/input/main.js')]; await sander.copydir('test/watch/samples/watch-files').to('test/_tmp/input'); await sander.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' }, 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); sander.writeFileSync(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); sander.writeFileSync(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); sander.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 = path.resolve('test/_tmp/input/watched'); const MAIN_ID = path.resolve('test/_tmp/input/main.js'); let lastEvent = null; await sander.copydir('test/watch/samples/watch-files').to('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: 300, 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); sander.writeFileSync(WATCHED_ID, 'another'); await wait(100); sander.unlinkSync(WATCHED_ID); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', async () => { assert.strictEqual(lastEvent, 'delete'); lastEvent = null; sander.writeFileSync(WATCHED_ID, '123'); await wait(100); sander.unlinkSync(WATCHED_ID); // To ensure there is always another change to trigger a rebuild sander.writeFileSync(MAIN_ID, 'export default 43;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', async () => { assert.strictEqual(lastEvent, null); sander.writeFileSync(WATCHED_ID, '123'); await wait(100); sander.writeFileSync(WATCHED_ID, 'asd'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(lastEvent, 'create'); } ]); }).timeout(20000); it('calls closeWatcher plugin hook', () => { let calls = 0; let ctx1; let ctx2; return sander .copydir('test/watch/samples/basic') .to('test/_tmp/input') .then(() => { watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: { file: 'test/_tmp/output/bundle.js', format: 'cjs', exports: 'auto' }, plugins: [ { buildStart() { ctx1 = this; }, closeWatcher() { assert.strictEqual(ctx1, this); calls++; } }, { buildStart() { ctx2 = this; }, closeWatcher() { assert.strictEqual(ctx2, this); calls++; } } ] }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 42); assert.ok(ctx1); assert.ok(ctx2); watcher.once('close', () => { assert.strictEqual(calls, 2); }); watcher.close(); } ]); }); }); it('watches a file in code-splitting mode', () => { return sander .copydir('test/watch/samples/code-splitting') .to('test/_tmp/input') .then(() => { 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); sander.writeFileSync('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', () => { return sander .copydir('test/watch/samples/code-splitting') .to('test/_tmp/input') .then(() => { 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); sander.writeFileSync('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', () => { return sander .copydir('test/watch/samples/basic') .to('test/_tmp/input') .then(() => { 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); sander.writeFileSync('test/_tmp/input/main.js', 'export nope;'); }, 'START', 'BUNDLE_START', 'ERROR', () => { sander.writeFileSync('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', () => { return sander .copydir('test/watch/samples/error') .to('test/_tmp/input') .then(() => { 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', () => { assert.strictEqual(sander.existsSync('../_tmp/output/bundle.js'), false); sander.writeFileSync('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', () => { let count = 0; return sander .copydir('test/watch/samples/basic') .to('test/_tmp/input') .then(() => { 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', () => { assert.strictEqual(sander.existsSync('../_tmp/output/bundle.js'), false); sander.writeFileSync('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)', () => { return sander .copydir('test/watch/samples/basic') .to('test/_tmp/input') .then(() => { 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); sander.unlinkSync('test/_tmp/input/main.js'); sander.writeFileSync('test/_tmp/input/main.js', 'export nope;'); }, 'START', 'BUNDLE_START', 'ERROR', () => { sander.unlinkSync('test/_tmp/input/main.js'); sander.writeFileSync('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)', () => { return sander .copydir('test/watch/samples/dependency') .to('test/_tmp/input') .then(() => { 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); sander.unlinkSync('test/_tmp/input/dep.js'); sander.writeFileSync('test/_tmp/input/dep.js', 'export nope;'); }, 'START', 'BUNDLE_START', 'ERROR', () => { sander.unlinkSync('test/_tmp/input/dep.js'); sander.writeFileSync('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', () => { return sander .copydir('test/watch/samples/basic') .to('test/_tmp/input') .then(() => { 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', () => { sander.writeFileSync('test/_tmp/input/main.js', 'export default 44;'); return wait(400).then(() => assert.deepStrictEqual(events, ['START', 'BUNDLE_START'])); } ]); }); }); it('handles closing the watcher during a build even if an error occurred', () => { return sander .copydir('test/watch/samples/error') .to('test/_tmp/input') .then(() => { 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', () => { sander.writeFileSync('test/_tmp/input/main.js', 'export default 44;'); return wait(400).then(() => assert.deepStrictEqual(events, ['START', 'BUNDLE_START'])); } ]); }); }); it('stops watching files that are no longer part of the graph', () => { return sander .copydir('test/watch/samples/dependency') .to('test/_tmp/input') .then(() => { 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); sander.writeFileSync('test/_tmp/input/main.js', 'export default 42;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 42); let unexpectedEvent = false; watcher.once('event', event => { unexpectedEvent = event; }); sander.writeFileSync('test/_tmp/input/dep.js', '= invalid'); return wait(400).then(() => assert.strictEqual(unexpectedEvent, false)); } ]); }); }); it('refuses to watch the output file (#15)', () => { return sander .copydir('test/watch/samples/basic') .to('test/_tmp/input') .then(() => { 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); sander.writeFileSync('test/_tmp/input/main.js', `import '../output/bundle.js'`); }, 'START', 'BUNDLE_START', 'ERROR', event => { assert.strictEqual(event.error.message, 'Cannot import the generated bundle'); sander.writeFileSync('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', () => { return sander .copydir('test/watch/samples/ignored') .to('test/_tmp/input') .then(() => { 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' }); sander.writeFileSync('test/_tmp/input/foo.js', `export default 'foo-2';`); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.deepStrictEqual(run('../_tmp/output/bundle.js'), { foo: 'foo-2', bar: 'bar-1' }); let unexpectedEvent = false; watcher.once('event', event => { unexpectedEvent = event; }); sander.writeFileSync('test/_tmp/input/bar.js', "export default 'bar-2';"); return wait(400).then(() => { 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', () => { return sander .copydir('test/watch/samples/ignored') .to('test/_tmp/input') .then(() => { 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' }); sander.writeFileSync('test/_tmp/input/foo.js', `export default 'foo-2';`); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.deepStrictEqual(run('../_tmp/output/bundle.js'), { foo: 'foo-2', bar: 'bar-1' }); let unexpectedEvent = false; watcher.once('event', event => { unexpectedEvent = event; }); sander.writeFileSync('test/_tmp/input/bar.js', "export default 'bar-2';"); return wait(400).then(() => { assert.deepStrictEqual(run('../_tmp/output/bundle.js'), { foo: 'foo-2', bar: 'bar-1' }); assert.strictEqual(unexpectedEvent, false); }); } ]); }); }); it('only rebuilds the appropriate configs', () => { return sander .copydir('test/watch/samples/multiple') .to('test/_tmp/input') .then(() => wait(100)) .then(() => { 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); sander.writeFileSync('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', () => { return sander .copydir('test/watch/samples/multiple') .to('test/_tmp/input') .then(() => wait(100)) .then(() => { 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( sander.existsSync(path.resolve(__dirname, '../_tmp/output/bundle1.js')), false ); assert.strictEqual( sander.existsSync(path.resolve(__dirname, '../_tmp/output/bundle2.js')), true ); assert.deepStrictEqual(run('../_tmp/output/bundle2.js'), 43); } ]); }); }); it('respects output.globals', () => { return sander .copydir('test/watch/samples/globals') .to('test/_tmp/input') .then(() => { 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 = sander.readFileSync('test/_tmp/output/bundle.js', { encoding: 'utf-8' }); assert.ok(/jQuery/.test(generated)); } ]); }); }); it('treats filenames literally, not as globs', () => { return sander .copydir('test/watch/samples/non-glob') .to('test/_tmp/input') .then(() => { 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); sander.writeFileSync('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', () => { let dynamicName; let staticName; let chunkName; return sander .copydir('test/watch/samples/hashing') .to('test/_tmp/input') .then(() => { 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] = sander.readdirSync('test/_tmp/output').sort(); sander.rimrafSync('test/_tmp/output'); // this should only update the hash of that particular entry point sander.writeFileSync( 'test/_tmp/input/main-static.js', "import {value} from './shared';\nexport default 2 * value;" ); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { const [newDynamicName, newStaticName, newChunkName] = sander .readdirSync('test/_tmp/output') .sort(); sander.rimrafSync('test/_tmp/output'); assert.notEqual(newStaticName, staticName); assert.strictEqual(newDynamicName, dynamicName); assert.strictEqual(newChunkName, chunkName); staticName = newStaticName; // this should update all hashes sander.writeFileSync('test/_tmp/input/shared.js', 'export const value = 42;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { const [newDynamicName, newStaticName, newChunkName] = sander .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', () => { const brokenFiles = new Set(); const INITIAL_CONTENT = 'export default 42;'; sander.writeFileSync('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'); } else { 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); sander.writeFileSync('test/_tmp/input/main.js', 'export default "broken";'); }, 'START', 'BUNDLE_START', 'ERROR', () => { sander.writeFileSync('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', () => { let watchChangeCnt = 0; return sander .copydir('test/watch/samples/skip-writes') .to('test/_tmp/input') .then(() => { 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, path.resolve('test/_tmp/input/main.js')); } } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { watchChangeCnt = 0; assert.strictEqual(sander.existsSync('../_tmp/output/bundle.js'), false); sander.writeFileSync('test/_tmp/input/main.js', 'export default 43;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(sander.existsSync('../_tmp/output/bundle.js'), false); assert.strictEqual(watchChangeCnt, 1); sander.writeFileSync('test/_tmp/input/main.js', 'export default 43;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(sander.existsSync('../_tmp/output/bundle.js'), false); assert.strictEqual(watchChangeCnt, 2); sander.writeFileSync('test/_tmp/input/main.js', 'export default 43;'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', // 'END', evt => { assert.strictEqual(sander.existsSync('../_tmp/output/bundle.js'), false); assert.strictEqual(watchChangeCnt, 3); // still aware of its output destination assert.strictEqual(evt.output[0], path.resolve('test/_tmp/output/bundle.js')); } ]); }); }); it('rebuilds immediately by default', async () => { await sander.copydir('test/watch/samples/basic').to('test/_tmp/input'); 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); sander.writeFileSync('test/_tmp/input/main.js', 'export default 43;'); startTime = process.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 sander.copydir('test/watch/samples/basic').to('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); sander.writeFileSync('test/_tmp/input/main.js', 'export default 43;'); startTime = process.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', () => { const watchChangeIds = new Set(); const buildStartFile = path.resolve('test/_tmp/input/buildStart'); const loadFile = path.resolve('test/_tmp/input/load'); const resolveIdFile = path.resolve('test/_tmp/input/resolveId'); const transformFile = path.resolve('test/_tmp/input/transform'); const watchFiles = [buildStartFile, loadFile, resolveIdFile, transformFile]; return sander .copydir('test/watch/samples/basic') .to('test/_tmp/input') .then(() => { for (const file of watchFiles) sander.writeFileSync(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', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 42); // sometimes the watcher is triggered during the initial run watchChangeIds.clear(); for (const file of watchFiles) sander.writeFileSync(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', () => { const WATCHED_ID = path.resolve('test/_tmp/input/watched'); return sander .copydir('test/watch/samples/watch-files') .to('test/_tmp/input') .then(() => { 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 "${sander.readFileSync(WATCHED_ID).toString().trim()}"`; } } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 'initial'); sander.writeFileSync(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', () => { const WATCHED_ID = path.resolve('test/_tmp/input/watched'); let addWatchFile = true; return sander .copydir('test/watch/samples/watch-files') .to('test/_tmp/input') .then(() => { 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 = "${sander .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; sander.writeFileSync(WATCHED_ID, 'next'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), 'next'); sander.writeFileSync(WATCHED_ID, 'other'); events.length = 0; return wait(400).then(() => assert.deepStrictEqual(events, [])); } ]); }); }); it('respects changed watched modules that are already part of the graph in the transform hook', () => { return sander .copydir('test/watch/samples/dependencies') .to('test/_tmp/input') .then(() => { 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(path.resolve('test/_tmp/input/dep2.js')); const text = sander.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"` ); sander.writeFileSync('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', () => { const WATCHED_ID = path.resolve('test/_tmp/input/watched'); return sander .copydir('test/watch/samples/watch-files') .to('test/_tmp/input') .then(() => { 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 ${sander.existsSync(WATCHED_ID)}`; } } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), true); sander.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', () => { return sander .copydir('test/watch/samples/basic') .to('test/_tmp/input') .then(() => { 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 ${sander.existsSync('test/_tmp/input/dep')}`; } } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), false); sander.writeFileSync('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', () => { return sander .copydir('test/watch/samples/basic') .to('test/_tmp/input') .then(() => { sander.writeFileSync('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 ${sander.existsSync('test/_tmp/input/dep')}`; } } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), true); sander.unlinkSync('test/_tmp/input/dep'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(run('../_tmp/output/bundle.js'), false); sander.writeFileSync('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', () => { const WATCHED_ID = path.resolve('test/_tmp/input/watched'); let transformRuns = 0; return sander .copydir('test/watch/samples/watch-files') .to('test/_tmp/input') .then(() => wait(100)) .then(() => { sander.writeFileSync('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 "${sander.readFileSync(WATCHED_ID).toString().trim()}"`; } } }); return sequence(watcher, [ 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(transformRuns, 1); sander.writeFileSync('test/_tmp/input/alsoWatched', 'next'); }, 'START', 'BUNDLE_START', 'BUNDLE_END', 'END', () => { assert.strictEqual(transformRuns, 1); } ]); }); }); }); }).timeout(20000); rollup-2.61.1/test/watch/samples/000077500000000000000000000000001415504077600166605ustar00rootroot00000000000000rollup-2.61.1/test/watch/samples/basic/000077500000000000000000000000001415504077600177415ustar00rootroot00000000000000rollup-2.61.1/test/watch/samples/basic/main.js000066400000000000000000000000231415504077600212160ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/watch/samples/code-splitting/000077500000000000000000000000001415504077600216055ustar00rootroot00000000000000rollup-2.61.1/test/watch/samples/code-splitting/main1.js000066400000000000000000000000651415504077600231510ustar00rootroot00000000000000import {value} from './shared'; export default value;rollup-2.61.1/test/watch/samples/code-splitting/main2.js000066400000000000000000000000711415504077600231470ustar00rootroot00000000000000import {value} from './shared'; export default value * 2;rollup-2.61.1/test/watch/samples/code-splitting/shared.js000066400000000000000000000000301415504077600234020ustar00rootroot00000000000000export const value = 21;rollup-2.61.1/test/watch/samples/dependencies/000077500000000000000000000000001415504077600213065ustar00rootroot00000000000000rollup-2.61.1/test/watch/samples/dependencies/dep1.js000066400000000000000000000000271415504077600224740ustar00rootroot00000000000000export default 'dep1'; rollup-2.61.1/test/watch/samples/dependencies/dep2.js000066400000000000000000000000271415504077600224750ustar00rootroot00000000000000export default 'dep2'; rollup-2.61.1/test/watch/samples/dependencies/main.js000066400000000000000000000001571415504077600225730ustar00rootroot00000000000000import dep1 from './dep1.js'; import dep2 from './dep2.js'; export default `dep1: "${dep1}", dep2: "${dep2}"`; rollup-2.61.1/test/watch/samples/dependency/000077500000000000000000000000001415504077600207765ustar00rootroot00000000000000rollup-2.61.1/test/watch/samples/dependency/dep.js000066400000000000000000000000311415504077600220760ustar00rootroot00000000000000export const value = 42; rollup-2.61.1/test/watch/samples/dependency/main.js000066400000000000000000000000741415504077600222610ustar00rootroot00000000000000import { value } from './dep.js'; export default value + 1; rollup-2.61.1/test/watch/samples/error/000077500000000000000000000000001415504077600200115ustar00rootroot00000000000000rollup-2.61.1/test/watch/samples/error/main.js000066400000000000000000000000251415504077600212700ustar00rootroot00000000000000export default 42; = rollup-2.61.1/test/watch/samples/globals/000077500000000000000000000000001415504077600203035ustar00rootroot00000000000000rollup-2.61.1/test/watch/samples/globals/main.js000066400000000000000000000001011415504077600215550ustar00rootroot00000000000000import $ from 'jquery'; $('body').html('

Hello world!

');rollup-2.61.1/test/watch/samples/hashing/000077500000000000000000000000001415504077600203015ustar00rootroot00000000000000rollup-2.61.1/test/watch/samples/hashing/main-dynamic.js000066400000000000000000000000431415504077600232020ustar00rootroot00000000000000export default import('./shared'); rollup-2.61.1/test/watch/samples/hashing/main-static.js000066400000000000000000000000651415504077600230510ustar00rootroot00000000000000import {value} from './shared'; export default value;rollup-2.61.1/test/watch/samples/hashing/shared.js000066400000000000000000000000301415504077600220760ustar00rootroot00000000000000export const value = 21;rollup-2.61.1/test/watch/samples/ignored/000077500000000000000000000000001415504077600203075ustar00rootroot00000000000000rollup-2.61.1/test/watch/samples/ignored/bar.js000066400000000000000000000000271415504077600214100ustar00rootroot00000000000000export default 'bar-1';rollup-2.61.1/test/watch/samples/ignored/foo.js000066400000000000000000000000271415504077600214270ustar00rootroot00000000000000export default 'foo-1';rollup-2.61.1/test/watch/samples/ignored/main.js000066400000000000000000000001151415504077600215660ustar00rootroot00000000000000import foo from './foo.js'; import bar from './bar.js'; export { foo, bar };rollup-2.61.1/test/watch/samples/multiple/000077500000000000000000000000001415504077600205135ustar00rootroot00000000000000rollup-2.61.1/test/watch/samples/multiple/main1.js000066400000000000000000000000231415504077600220510ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/watch/samples/multiple/main2.js000066400000000000000000000000231415504077600220520ustar00rootroot00000000000000export default 43; rollup-2.61.1/test/watch/samples/non-glob/000077500000000000000000000000001415504077600203735ustar00rootroot00000000000000rollup-2.61.1/test/watch/samples/non-glob/[foo]/000077500000000000000000000000001415504077600214465ustar00rootroot00000000000000rollup-2.61.1/test/watch/samples/non-glob/[foo]/bar.js000066400000000000000000000000261415504077600225460ustar00rootroot00000000000000export const bar = 42;rollup-2.61.1/test/watch/samples/non-glob/main.js000066400000000000000000000000721415504077600216540ustar00rootroot00000000000000import { bar } from './[foo]/bar.js'; export default bar;rollup-2.61.1/test/watch/samples/skip-writes/000077500000000000000000000000001415504077600211415ustar00rootroot00000000000000rollup-2.61.1/test/watch/samples/skip-writes/main.js000066400000000000000000000000231415504077600224160ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/watch/samples/virtual/000077500000000000000000000000001415504077600203465ustar00rootroot00000000000000rollup-2.61.1/test/watch/samples/virtual/main.js000066400000000000000000000000541415504077600216270ustar00rootroot00000000000000export { value as default } from 'virtual'; rollup-2.61.1/test/watch/samples/watch-files/000077500000000000000000000000001415504077600210665ustar00rootroot00000000000000rollup-2.61.1/test/watch/samples/watch-files/main.js000066400000000000000000000000231415504077600223430ustar00rootroot00000000000000export default 42; rollup-2.61.1/test/watch/samples/watch-files/watched000066400000000000000000000000101415504077600224170ustar00rootroot00000000000000initial rollup-2.61.1/tsconfig.json000066400000000000000000000010541415504077600156360ustar00rootroot00000000000000{ "compilerOptions": { "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, "isolatedModules": true, "module": "ESNext", "moduleResolution": "Node", "noEmitOnError": true, "noUnusedLocals": true, "noUnusedParameters": true, "pretty": true, "resolveJsonModule": true, "skipLibCheck": true, "strict": true, "target": "ES2018", "useDefineForClassFields": false }, "include": ["typings/**/*.d.ts", "src", "cli", "browser", "rollup.config.ts"], "exclude": ["dist", "node_modules", "test/typescript"] } rollup-2.61.1/typings/000077500000000000000000000000001415504077600146245ustar00rootroot00000000000000rollup-2.61.1/typings/declarations.d.ts000066400000000000000000000136661415504077600201020ustar00rootroot00000000000000// internal declare module 'help.md' { const str: string; export default str; } // external libs declare module 'rollup-plugin-string' { export const string: import('rollup').PluginImpl; } declare module 'acorn-walk' { type WalkerCallback = (node: acorn.Node, state: TState) => void; type RecursiveWalkerFn = ( node: acorn.Node, state: TState, callback: WalkerCallback ) => void; export type BaseWalker = Record>; export const base: BaseWalker; } declare module 'is-reference' { export default function is_reference( node: NodeWithFieldDefinition, parent: NodeWithFieldDefinition ): boolean; export type Node = | import('estree').Identifier | import('estree').SimpleLiteral | import('estree').RegExpLiteral | import('estree').Program | import('estree').FunctionDeclaration | import('estree').FunctionExpression | import('estree').ArrowFunctionExpression | import('estree').SwitchCase | import('estree').CatchClause | import('estree').VariableDeclarator | import('estree').ExpressionStatement | import('estree').BlockStatement | import('estree').EmptyStatement | import('estree').DebuggerStatement | import('estree').WithStatement | import('estree').ReturnStatement | import('estree').LabeledStatement | import('estree').BreakStatement | import('estree').ContinueStatement | import('estree').IfStatement | import('estree').SwitchStatement | import('estree').ThrowStatement | import('estree').TryStatement | import('estree').WhileStatement | import('estree').DoWhileStatement | import('estree').ForStatement | import('estree').ForInStatement | import('estree').ForOfStatement | import('estree').VariableDeclaration | import('estree').ClassDeclaration | import('estree').ThisExpression | import('estree').ArrayExpression | import('estree').ObjectExpression | import('estree').YieldExpression | import('estree').UnaryExpression | import('estree').UpdateExpression | import('estree').BinaryExpression | import('estree').AssignmentExpression | import('estree').LogicalExpression | import('estree').MemberExpression | import('estree').ConditionalExpression | import('estree').SimpleCallExpression | import('estree').NewExpression | import('estree').SequenceExpression | import('estree').TemplateLiteral | import('estree').TaggedTemplateExpression | import('estree').ClassExpression | import('estree').MetaProperty | import('estree').AwaitExpression | import('estree').ImportExpression | import('estree').ChainExpression | import('estree').Property | import('estree').AssignmentProperty | import('estree').Super | import('estree').TemplateElement | import('estree').SpreadElement | import('estree').ObjectPattern | import('estree').ArrayPattern | import('estree').RestElement | import('estree').AssignmentPattern | import('estree').ClassBody | import('estree').MethodDefinition | import('estree').ImportDeclaration | import('estree').ExportNamedDeclaration | import('estree').ExportDefaultDeclaration | import('estree').ExportAllDeclaration | import('estree').ImportSpecifier | import('estree').ImportDefaultSpecifier | import('estree').ImportNamespaceSpecifier | import('estree').ExportSpecifier; export type NodeWithFieldDefinition = | import('estree').Identifier | import('estree').SimpleLiteral | import('estree').RegExpLiteral | import('estree').Program | import('estree').FunctionDeclaration | import('estree').FunctionExpression | import('estree').ArrowFunctionExpression | import('estree').SwitchCase | import('estree').CatchClause | import('estree').VariableDeclarator | import('estree').ExpressionStatement | import('estree').BlockStatement | import('estree').EmptyStatement | import('estree').DebuggerStatement | import('estree').WithStatement | import('estree').ReturnStatement | import('estree').LabeledStatement | import('estree').BreakStatement | import('estree').ContinueStatement | import('estree').IfStatement | import('estree').SwitchStatement | import('estree').ThrowStatement | import('estree').TryStatement | import('estree').WhileStatement | import('estree').DoWhileStatement | import('estree').ForStatement | import('estree').ForInStatement | import('estree').ForOfStatement | import('estree').VariableDeclaration | import('estree').ClassDeclaration | import('estree').ThisExpression | import('estree').ArrayExpression | import('estree').ObjectExpression | import('estree').YieldExpression | import('estree').UnaryExpression | import('estree').UpdateExpression | import('estree').BinaryExpression | import('estree').AssignmentExpression | import('estree').LogicalExpression | import('estree').MemberExpression | import('estree').ConditionalExpression | import('estree').SimpleCallExpression | import('estree').NewExpression | import('estree').SequenceExpression | import('estree').TemplateLiteral | import('estree').TaggedTemplateExpression | import('estree').ClassExpression | import('estree').MetaProperty | import('estree').AwaitExpression | import('estree').ImportExpression | import('estree').ChainExpression | import('estree').Property | import('estree').AssignmentProperty | import('estree').Super | import('estree').TemplateElement | import('estree').SpreadElement | import('estree').ObjectPattern | import('estree').ArrayPattern | import('estree').RestElement | import('estree').AssignmentPattern | import('estree').ClassBody | import('estree').MethodDefinition | import('estree').ImportDeclaration | import('estree').ExportNamedDeclaration | import('estree').ExportDefaultDeclaration | import('estree').ExportAllDeclaration | import('estree').ImportSpecifier | import('estree').ImportDefaultSpecifier | import('estree').ImportNamespaceSpecifier | import('estree').ExportSpecifier | { computed: boolean; type: 'FieldDefinition'; value: Node; }; } rollup-2.61.1/typings/hash.js.d.ts000066400000000000000000000002401415504077600167500ustar00rootroot00000000000000declare module 'hash.js/lib/hash/sha/256' { export default function sha256(): { digest: (format: string) => string; update: (data: unknown) => void; }; } rollup-2.61.1/typings/package.json.d.ts000066400000000000000000000000721415504077600177600ustar00rootroot00000000000000declare module 'package.json' { const version: string; }