parcel-bundler / parcel

The zero configuration build tool for the web. πŸ“¦πŸš€
https://parceljs.org
MIT License
43.4k stars 2.26k forks source link

.babelrc & .browserslist not applied to node_modules with proper config #3389

Closed Yatekii closed 4 years ago

Yatekii commented 5 years ago

πŸ› bug report

See title ;)

πŸŽ› Configuration (.babelrc, package.json, cli command)

Our config:

{
  "name": "zigzag-web-frontend",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "scripts": {
    "start": "parcel index.html",
    "watch": "parcel watch index.html --public-url /static/",
    "build": "parcel build index.html --public-url /static/"
  },
  "files": [
    "dist/*"
  ],
  "source": true,
  "dependencies": {
    "@babel/plugin-proposal-object-rest-spread": "^7.5.5",
    "@fortawesome/fontawesome-svg-core": "^1.2.19",
    "@fortawesome/free-brands-svg-icons": "^5.9.0",
    "@fortawesome/free-solid-svg-icons": "^5.9.0",
    "@fortawesome/vue-fontawesome": "^0.1.6",
    "@svgdotjs/svg.js": "^3.0.13",
    "animejs": "^3.0.1",
    "app.vue": "^0.1.10",
    "axios": "^0.19.0",
    "bootstrap": "^4.3.1",
    "bootstrap-vue": "^2.0.0-rc.22",
    "charming": "^3.0.1",
    "chart.js": "^2.8.0",
    "input-range-scss": "^1.5.1",
    "lib": "^4.0.2",
    "seethru": "^4.0.0",
    "simplebar-vue": "^1.1.0",
    "stripe": "^7.3.0",
    "vue": "^2.6.10",
    "vue-chartjs": "^3.4.2",
    "vue-fragment": "^1.5.1",
    "vue-hot-reload-api": "^2.3.3",
    "vue-loop": "^0.2.6",
    "vue-matomo": "^3.9.1-2",
    "vue-property-decorator": "^8.1.1",
    "vue-router": "^3.0.6",
    "vue-scrollmagic": "^1.1.1"
  },
  "devDependencies": {
    "@babel/core": "^7.0.0-0",
    "@babel/preset-env": "^7.5.5",
    "@types/stripe": "^6.30.3",
    "@vue/component-compiler-utils": "^3.0.0",
    "less": "^3.9.0",
    "parcel-bundler": "^1.12.3",
    "parcel-plugin-imagemin": "^3.0.0",
    "sass": "^1.21.0",
    "typescript": "^3.5.2",
    "vue-template-compiler": "^2.6.10"
  }
}

svg.js config:

{
  "name": "@svgdotjs/svg.js",
  "version": "3.0.13",
  "description": "A lightweight library for manipulating and animating SVG.",
  "url": "https://svgdotjs.github.io/",
  "homepage": "https://svgdotjs.github.io/",
  "keywords": [
    "svg",
    "vector",
    "graphics",
    "animation"
  ],
  "author": "Wout Fierens <wout@mick-wout.com>",
  "main": "dist/svg.node.js",
  "unpkg": "dist/svg.min.js",
  "jsdelivr": "dist/svg.min.js",
  "browser": "src/main.js",
  "module": "src/main.js",
  "files": [
    "/dist",
    "/src",
    "/svg.js.d.ts"
  ],
  "maintainers": [
    {
      "name": "Wout Fierens",
      "email": "wout@mick-wout.com",
      "web": "https://svgdotjs.github.io/"
    },
    {
      "name": "Alex EwerlΓΆf",
      "email": "alex@userpixel.com",
      "web": "http://www.ewerlof.name"
    },
    {
      "name": "Ulrich-Matthias SchΓ€fer",
      "email": "ulima.ums@googlemail.com"
    },
    {
      "name": "Jon Ege Ronnenberg",
      "email": "jon@svgjs.com",
      "url": "https://keybase.io/dotnetcarpenter"
    }
  ],
  "licenses": [
    {
      "type": "MIT",
      "url": "http://www.opensource.org/licenses/mit-license.php"
    }
  ],
  "repository": {
    "type": "git",
    "url": "https://github.com/svgdotjs/svg.js.git"
  },
  "github": "https://github.com/svgdotjs/svg.js",
  "license": "MIT",
  "typings": "./svg.js.d.ts",
  "scripts": {
    "build": "npm run fix && npm run rollup",
    "build:polyfills": "npx rollup -c .config/rollup.polyfills.js",
    "build:tests": "npx rollup -c .config/rollup.tests.js",
    "fix": "npx eslint ./src --fix",
    "lint": "npx eslint ./src",
    "rollup": "npx rollup -c .config/rollup.config.js",
    "server": "npx http-server ./ -d",
    "demo": "run () { cd playgrounds; ../node_modules/.bin/webpack-dev-server --env=$1; }; run",
    "test": "npx karma start .config/karma.conf.js",
    "test:ci": "karma start .config/karma.conf.saucelabs.js",
    "test:svgdom": "node -r esm ./spec/runSVGDomTest.js || true",
    "test:es6": "npx karma start .config/karma.es6.js --single-run",
    "zip": "zip -j dist/svg.js.zip -- LICENSE.txt README.md CHANGELOG.md dist/svg.js dist/svg.js.map dist/svg.min.js dist/svg.min.js.map dist/polyfills.js dist/polyfillsIE.js",
    "prepublishOnly": "rm -rf ./dist && npm run build && npm run build:polyfills && npm test",
    "postpublish": "npm run zip"
  },
  "devDependencies": {
    "@babel/core": "^7.1.6",
    "@babel/plugin-external-helpers": "^7.0.0",
    "@babel/plugin-transform-runtime": "^7.1.0",
    "@babel/polyfill": "^7.0.0",
    "@babel/preset-env": "^7.1.6",
    "@babel/runtime": "^7.1.5",
    "@babel/runtime-corejs2": "^7.1.5",
    "@target/custom-event-polyfill": "github:Adobe-Marketing-Cloud/custom-event-polyfill",
    "babel-eslint": "^10.0.1",
    "core-js": "^2.5.7",
    "coveralls": "^3.0.2",
    "eslint": "^5.9.0",
    "eslint-config-standard": "^12.0.0",
    "eslint-plugin-import": "^2.14.0",
    "eslint-plugin-node": "^8.0.0",
    "eslint-plugin-promise": "^4.0.1",
    "eslint-plugin-standard": "^4.0.0",
    "esm": "^3.0.84",
    "http-server": "^0.11.1",
    "jasmine": "^3.3.0",
    "jasmine-core": "^3.3.0",
    "karma": "^3.1.3",
    "karma-chrome-launcher": "^2.2.0",
    "karma-coverage": "^1.1.2",
    "karma-firefox-launcher": "^1.1.0",
    "karma-jasmine": "^2.0.1",
    "karma-sauce-launcher": "^1.2.0",
    "rollup": "^0.67.4",
    "rollup-plugin-babel": "^4.0.3",
    "rollup-plugin-commonjs": "^9.2.0",
    "rollup-plugin-filesize": "^5.0.1",
    "rollup-plugin-multi-entry": "^2.0.2",
    "rollup-plugin-node-resolve": "^3.4.0",
    "rollup-plugin-terser": "^3.0.0",
    "rollup-plugin-uglify": "^6.0.0",
    "rollup-plugin-uglify-es": "0.0.1",
    "svgdom": "latest",
    "webpack": "^4.26.1",
    "webpack-cli": "^3.1.2",
    "webpack-dev-server": "^3.1.10",
    "yargs": "^12.0.5"
  },
  "browserslist": [
    "last 1 version",
    "> 0.25%",
    "not maintained node versions",
    "not dead"
  ]
}

πŸ€” Expected Behavior

The babel/browserslit config should apply to all packages specifyying it. This does not happen.

😯 Current Behavior

The transpilation does not take place or is exceuted in wrong manner.

When running the browserslit plugin on the svg.js config I get:

and_chr 75
and_ff 67
and_qq 1.2
and_uc 12.12
android 67
baidu 7.12
chrome 75
chrome 74
chrome 73
edge 18
edge 17
firefox 68
firefox 67
firefox 60
ie 11
ie_mob 11
ios_saf 12.2-12.3
ios_saf 12.0-12.1
ios_saf 11.3-11.4
kaios 2.5
op_mini all
op_mob 46
opera 62
opera 60
safari 12.1
safari 12
samsung 9.2
samsung 8.2

But the output from parcel.js contains spread operators which are 100% not supported by Edge 17 ... IE 11 that's in that list too (but I don't care about) does not work either fyi, because the output contains for loops.

πŸ’ Possible Solution

No idea, sorry.

πŸ”¦ Context

I cannot build my project compatible with Edge. I don't want to do this, but sadly there is still folks using that stuff.

🌍 Your Environment

Software Version(s)
Parcel 1.12.3
Node 12.4.0
Yarn 1.16.0
Operating System Windows 10, Ubuntu 19.04, Gentoo (bleeding edge)

Best, Yatekii

mischnic commented 4 years ago

Duplicate of https://github.com/parcel-bundler/parcel/issues/1655