Parcel: Build does not assign correct paths for relative URL

Created on 28 Mar 2018  路  3Comments  路  Source: parcel-bundler/parcel

Choose one: 馃悰 bug report

馃帥 Configuration (.babelrc, package.json, cli command)

Git repo to replicate issue:
https://github.com/taviroquai/ReactSemanticParcel

Build does not assign correct paths for relative URL using:

$ parcel build src/index.js --public-url ./

馃 Expected Behavior

Relative paths to build assets

馃槸 Current Behavior

index.html contains full paths:

<script src="/src.d37f3ef7.js"></script>

Also, when click to open semantic modal window, image gives 404 because of full path URL

馃拋 Possible Solution

I have no idea...

馃敠 Context

Testing React, Semantic UI and ParcelJS

馃捇 Code Sample

Git repo to replicate issue:
https://github.com/taviroquai/ReactSemanticParcel

馃實 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.7.0
| Node | 8.4.0
| npm/Yarn |npm 5.3.0
| Operating System | Ubuntu 16.04

Question

Most helpful comment

Your parcel build command should be pointing to src/index.html:

parcel build src/index.html --public-url ./

and delete your dist folder before running parcel build

looks ok for me

2018-03-29 at 12 17 38

All 3 comments

Your parcel build command should be pointing to src/index.html:

parcel build src/index.html --public-url ./

and delete your dist folder before running parcel build

looks ok for me

2018-03-29 at 12 17 38

@f-a-a Perfect! I thought I was doing something wrong :) Keep up the great work!

--public-url seems to be ignored in ^2.0.0-beta.1 completely. Regardless of what I provide, the script tag path looks like /client.3b43ab2b.js

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidnagli picture davidnagli  路  3Comments

humphd picture humphd  路  3Comments

philipodev picture philipodev  路  3Comments

mnn picture mnn  路  3Comments

dotdash picture dotdash  路  3Comments