mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: remove "module" from @puppeteer/browsers (#10986)
This commit is contained in:
parent
4ca36454c3
commit
86c28edadd
2
.github/workflows/issue-analyzer.yml
vendored
2
.github/workflows/issue-analyzer.yml
vendored
@ -94,7 +94,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
YARN_ENABLE_IMMUTABLE_INSTALLS: false
|
YARN_ENABLE_IMMUTABLE_INSTALLS: false
|
||||||
- name: Install dependencies Firefox
|
- name: Install dependencies Firefox
|
||||||
run: node ./node_modules/puppeteer/install.js
|
run: node ./node_modules/puppeteer/install.mjs
|
||||||
env:
|
env:
|
||||||
PUPPETEER_PRODUCT: firefox
|
PUPPETEER_PRODUCT: firefox
|
||||||
- name: Verify issue
|
- name: Verify issue
|
||||||
|
1
package-lock.json
generated
1
package-lock.json
generated
@ -11015,6 +11015,7 @@
|
|||||||
"license": "Apache-2.0"
|
"license": "Apache-2.0"
|
||||||
},
|
},
|
||||||
"tools/mocha-runner": {
|
"tools/mocha-runner": {
|
||||||
|
"name": "@puppeteer/mocha-runner",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
@ -8,15 +8,12 @@
|
|||||||
"clean": "../../tools/clean.js",
|
"clean": "../../tools/clean.js",
|
||||||
"test": "wireit"
|
"test": "wireit"
|
||||||
},
|
},
|
||||||
|
"type": "commonjs",
|
||||||
"bin": "lib/cjs/main-cli.js",
|
"bin": "lib/cjs/main-cli.js",
|
||||||
"main": "./lib/cjs/main.js",
|
"main": "./lib/cjs/main.js",
|
||||||
"module": "./lib/esm/main.js",
|
|
||||||
"type": "commonjs",
|
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
|
||||||
"import": "./lib/esm/main.js",
|
"import": "./lib/esm/main.js",
|
||||||
"require": "./lib/cjs/main.js"
|
"require": "./lib/cjs/main.js"
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"wireit": {
|
"wireit": {
|
||||||
"build": {
|
"build": {
|
||||||
|
20
packages/puppeteer/install.js → packages/puppeteer/install.mjs
Normal file → Executable file
20
packages/puppeteer/install.js → packages/puppeteer/install.mjs
Normal file → Executable file
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright 2017 Google Inc. All rights reserved.
|
* Copyright 2017 Google Inc. All rights reserved.
|
||||||
*
|
*
|
||||||
@ -24,20 +26,18 @@
|
|||||||
* necessary.
|
* necessary.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const fs = require('fs');
|
try {
|
||||||
const path = require('path');
|
const {downloadBrowser} = await (async () => {
|
||||||
|
try {
|
||||||
// Need to ensure TS is compiled before loading the installer
|
return await import('puppeteer/internal/node/install.js');
|
||||||
if (!fs.existsSync(path.join(__dirname, 'lib'))) {
|
} catch {
|
||||||
console.warn(
|
console.warn(
|
||||||
'Skipping browser installation because the Puppeteer build is not available. Run `npm install` again after you have re-built Puppeteer.'
|
'Skipping browser installation because the Puppeteer build is not available. Run `npm install` again after you have re-built Puppeteer.'
|
||||||
);
|
);
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
}
|
}
|
||||||
|
})();
|
||||||
try {
|
|
||||||
const {downloadBrowser} = require('puppeteer/internal/node/install.js');
|
|
||||||
downloadBrowser();
|
downloadBrowser();
|
||||||
} catch (err) {
|
} catch (error) {
|
||||||
console.warn('Browser download failed', err);
|
console.warn('Browser download failed', error);
|
||||||
}
|
}
|
@ -37,7 +37,7 @@
|
|||||||
"build:docs": "wireit",
|
"build:docs": "wireit",
|
||||||
"build": "wireit",
|
"build": "wireit",
|
||||||
"clean": "../../tools/clean.js",
|
"clean": "../../tools/clean.js",
|
||||||
"postinstall": "node install.js",
|
"postinstall": "node install.mjs",
|
||||||
"prepack": "wireit"
|
"prepack": "wireit"
|
||||||
},
|
},
|
||||||
"wireit": {
|
"wireit": {
|
||||||
@ -111,7 +111,7 @@
|
|||||||
"files": [
|
"files": [
|
||||||
"lib",
|
"lib",
|
||||||
"src",
|
"src",
|
||||||
"install.js",
|
"install.mjs",
|
||||||
"!*.test.js",
|
"!*.test.js",
|
||||||
"!*.test.d.ts",
|
"!*.test.d.ts",
|
||||||
"!*.test.js.map",
|
"!*.test.js.map",
|
||||||
|
Loading…
Reference in New Issue
Block a user