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

[Treeshaking]: Parcel did not bundle core-js at all with explicit import #8755

Open
axetroy opened this issue Jan 6, 2023 · 2 comments
Open

Comments

@axetroy
Copy link

axetroy commented Jan 6, 2023

🐛 bug report

When I want to polyfill with core-js for older browser like this

// polyfill.js
export * from "core-js/stable";
export * from "core-js/es";
export * from "core-js/web/url";
export * from "core-js/web/url-search-params";
export * from "whatwg-fetch";

console.log("Hello polyfill");
// app.js
import * as polyfills from './polyfill'

console.log('polyfills', polyfills)

🎛 Configuration (.babelrc, package.json, cli command)

.parcelrc

{
  "extends": [
    "@parcel/config-default",
    "parcel-config-vue2"
  ],
  "reporters": [
    "...",
    "parcel-reporter-static-files-copy"
  ]
}

package.json

{
  "name": "preview_renderer",
  "version": "1.0.0",
  "description": "preview renderer",
  "browserslist": "> 0.5%, last 10 versions, not dead, IE 10",
  "scripts": {
    "dev": "parcel --no-source-maps --no-cache --port 1234 entry/*.html",
    "build": "rimraf ./dist && parcel build --no-source-maps --no-cache --dist-dir dist entry/*.html",
    "format": "prettier **/*.js **/*.css **/*.html **/*.vue --write",
    "lint": "rome check **/*.js --apply-suggested"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@parcel/transformer-less": "2.8.2",
    "@parcel/transformer-sass": "2.8.2",
    "@parcel/transformer-vue": "2.8.2",
    "buffer": "^5.5.0",
    "parcel": "^2.8.2",
    "parcel-config-vue2": "^0.1.3",
    "parcel-reporter-static-files-copy": "^1.4.0",
    "parcel-transformer-vue2": ">= 0.1.3",
    "prettier": "^2.8.1",
    "rimraf": "^3.0.2",
    "rome": "^11.0.0",
    "vue-hot-reload-api": "^2.3.4"
  },
  "dependencies": {
    "classnames": "^2.3.2",
    "core-js": "^3.26.1",
    "howler": "^2.2.3",
    "id3-parser": "^2.0.0",
    "less": "^4.1.3",
    "normalize.css": "^8.0.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-use": "^17.4.0",
    "uint8-to-base64": "^0.2.0",
    "v-viewer": "^1.6.4",
    "video.js": "^7.20.3",
    "vue": "2.7.14",
    "whatwg-fetch": "^3.6.2"
  },
  "targets": {
    "frontend": {
      "publicUrl": "."
    }
  }
}

🤔 Expected Behavior

The polyfill will bundle into the javascript file

😯 Current Behavior

I search the VSCODE

and I can not found any code of this in output javascript files

export * from "core-js/stable";
export * from "core-js/es";
export * from "core-js/web/url";
export * from "core-js/web/url-search-params";
export * from "whatwg-fetch";

💁 Possible Solution

None

🔦 Context

💻 Code Sample

🌍 Your Environment

Software Version(s)
Parcel 2.8.2
Node v14.8.1
npm/Yarn 1.12.19
Operating System Windows 10
@mischnic
Copy link
Member

mischnic commented Jan 6, 2023

Maybe related: #8282

@github-actions github-actions bot added the Stale Inactive issues label Nov 23, 2023
@parcel-bundler parcel-bundler deleted a comment from github-actions bot Nov 23, 2023
@mischnic mischnic removed the Stale Inactive issues label Nov 23, 2023
@github-actions github-actions bot added the Stale Inactive issues label May 21, 2024
@github-actions github-actions bot closed this as completed Jun 4, 2024
@parcel-bundler parcel-bundler deleted a comment from github-actions bot Jun 4, 2024
@mischnic mischnic reopened this Jun 4, 2024
@mischnic mischnic removed the Stale Inactive issues label Jun 4, 2024
@github-actions github-actions bot added the Stale Inactive issues label Dec 2, 2024
@axetroy
Copy link
Author

axetroy commented Dec 2, 2024

bump

@github-actions github-actions bot removed the Stale Inactive issues label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants