parcel-plugin-web-extension icon indicating copy to clipboard operation
parcel-plugin-web-extension copied to clipboard

invalid parcel entry points in the manifest.json file are deleted in the dist/ output

Open jthegedus opened this issue 6 years ago • 5 comments

I have a manifest file which has this field

  "web_accessible_resources": ["*.woff2"],

The generated output is:

  "web_accessible_resources": [],

The woff2 files are output by Parcel from an import in one of my .css files as expected, so I just want this value carried across to the output manifest.json

Importing the font files directly in web_accessible_resources does not work since they are included in node_modules and the output directory is a mess:

"web_accessible_resources": ["../node_modules/file-icons-js/fonts/fontawesome.woff2"]

results in the output dir:

dist/__/node_modules/file-icons-js/fonts/fontawesome.woff2

the double underscore throws an error in Chrome as _ prefixed dirs are reserved.

My proposed solution here would be to validate the values before using them as parcel entry points and not remove them if they are invalid entry points.

jthegedus avatar Sep 20 '18 07:09 jthegedus

Hey, thanks for filing an issue. I'll have a look soon. If you have a minimal project to reproduce this behaviour, it'd greatly help!

kevincharm avatar Sep 20 '18 10:09 kevincharm

Here is an example repo demonstrating the generated output being removed https://github.com/jthegedus/parcel-plugin-web-extension-test

jthegedus avatar Sep 23 '18 01:09 jthegedus

Thanks! Will take a look at this soon :)

kevincharm avatar Sep 23 '18 10:09 kevincharm

I have the same problem. And found a nice workaround. (well nice-ish. Definitely only a workaround).

I'm now placing symlinks in my assets directory. src/assets/bootstrap points to ../node_modules/bootstrap This way, I don't have to commit any foreign code to my repo. And if npm makes an update, it gets pulled in automatically.

Parcel seems to work perfectly with those links :)

lhk avatar Oct 25 '18 18:10 lhk

@lhk interesting, cheers for the temp fix.

jthegedus avatar Oct 26 '18 02:10 jthegedus