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

1.12.0 Invalid File Imports paths for mp3, mp4 and png #2764

Closed
Cerlancism opened this issue Mar 11, 2019 · 1 comment
Closed

1.12.0 Invalid File Imports paths for mp3, mp4 and png #2764

Cerlancism opened this issue Mar 11, 2019 · 1 comment
Labels

Comments

@Cerlancism
Copy link

Cerlancism commented Mar 11, 2019

🐛 bug report

Probably related to: #2736
Relative/Absolute files imports with single or glob patterns return invalid file paths with weird characters. In both serve and production mode.

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

package.json

{
  "name": "phaser-ce-parceljs",
  "version": "1.1.1",
  "description": "Phaser CE boilerplate with typescript, babel and parcel bundler.",
  "scripts": {
    "start": "parcel serve src/index.html --out-dir dev/",
    "build": "parcel build src/index.html --out-dir build/ --public-url ./",
    "deploy": "parcel build src/index.html --out-dir .deploy/ --public-url ./ --no-source-maps"
  },
  "keywords": [
    "phaser",
    "phaser-ce",
    "phaser2",
    "parceljs",
    "typescript",
    "babel"
  ],
  "author": "Cerlancism",
  "repository": {
    "type": "git",
    "url": "https://github.com/Cerlancism/Phaser-CE-TypeScript-ParcelJS.git"
  },
  "license": "MIT",
  "devDependencies": {
    "@babel/core": "^7.3.4",
    "@babel/plugin-transform-runtime": "^7.3.4",
    "@babel/preset-env": "^7.3.4",
    "@types/parcel-env": "^0.0",
    "parcel": "^1.12.0",
    "cssnano": "^4.1.10",
    "typescript": "^3.3"
  },
  "dependencies": {
    "@babel/polyfill": "^7.2.5",
    "@babel/runtime": "^7.3.4",
    "phaser-ce": "^2.12.0"
  }
}

.babelrc

{
  "plugins": [
    [
      "@babel/plugin-transform-runtime"
    ]
  ],
  "presets": [
    [
      "@babel/preset-env",
      {
        "useBuiltIns": "entry",
        "targets": {
          "ie": "9"
        }
      }
    ]
  ]
}

🤔 Expected Behavior

import * as UI from './ui/*.png'
import background from './ui/background.png'

console.log(UI)
console.log(background)

/*
Object
background: "/background.ce1ef1bd.png"
default:
background: "/background.ce1ef1bd.png"
__proto__: Object
*/

/*
"/background.ce1ef1bd.png"
*/

😯 Current Behavior

/*
Object
background: "/....�ackground.ce1ef1bd.png"
default:
background: "/....�ackground.ce1ef1bd.png"
__proto__: Object
*/

/*
"/....�ackground.ce1ef1bd.png"
*/

💁 Possible Solution

Revert to 1.11 works again.

🔦 Context

💻 Code Sample

https://github.com/Cerlancism/Phaser-CE-TypeScript-ParcelJS.git
Works in parcel 1.11, breaks parcel in 1.12

🌍 Your Environment

Software Version(s)
Parcel 1.12.0
Node 10.14.1
npm/Yarn 6.4.1
Operating System Windows 10.0.17134 Build 17134
@mischnic
Copy link
Member

Duplicate of #2736 and now fixed by #2740

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants