Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(addInitScript): support cjs modules when passing both path and arg #32240

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

dgozman
Copy link
Contributor

@dgozman dgozman commented Aug 21, 2024

This works with scripts bundled by:

  • esbuild entrypoint.ts --bundle --format=cjs --outfile=injected.js
  • webpack with a typical config
    module.exports = {
      entry: { 'injected': './entrypoint.js', },
      output: {
        path: require('path').resolve(__dirname),
        filename: '[name].js',
        libraryTarget: 'commonjs2',
      },
    };

… `arg`

This works with scripts bundled by:
- `esbuild entrypoint.ts --bundle --format=cjs --outfile=injected.js`
- webpack with a typical config
  ```js
  module.exports = {
    entry: {
      'injected': './entry.js',
    },
    output: {
      path: require('path').resolve(__dirname),
      filename: '[name].js',
      libraryTarget: 'commonjs2'
    },
  }
  ```
Copy link
Contributor

Test results for "tests 1"

3 failed
❌ [installation tests] › playwright-electron-should-work.spec.ts:44:5 › should work when wrapped inside @playwright/test and trace is enabled
❌ [webkit-library] › library/modernizr.spec.ts:33:3 › safari-14-1
❌ [webkit-library] › library/modernizr.spec.ts:83:3 › mobile-safari-14-1

1 flaky ⚠️ [chromium-library] › library/capabilities.spec.ts:141:3 › should not crash on showDirectoryPicker

30070 passed, 866 skipped
✔️✔️✔️

Merge workflow run.

@dgozman dgozman merged commit d5a7495 into microsoft:main Aug 21, 2024
28 of 30 checks passed
yury-s added a commit to yury-s/playwright that referenced this pull request Aug 28, 2024
yury-s added a commit that referenced this pull request Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants