Skip to content

Commit

Permalink
WIP: TEMP-FIX! manually copy payload.js to dist
Browse files Browse the repository at this point in the history
Problem: The `addDocketCounts` function specifies the name 'payload.js'
as the file that should be executed in the chrome tab when scraping
the page. However, when parcel builds the source files, the dist/ files
all have a unique hash added to them so the file becomes something
like 'payload.89274893.js'. I haven't figured out how to tell parcel
to update this filename though.

Solution: No idea. The problem is simiar to this issue, and
this might be an option, but it feels a little smelly to me:
parcel-bundler/parcel#1668

For now: I'm copying the file over manually so that the file is
available as expected. Seems hacky, but I think it's currently working.
  • Loading branch information
doub1ejack committed Mar 25, 2021
1 parent d5b054c commit 98b6fd4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extensionDirectory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"pretty-up": "npx prettier --write \"./**/*.{js,html,css}\"",
"pretty-check": "npx prettier --check \"./**/*.{js,html,css}\"",
"test": "echo \"Error: no test specified\" && exit 1",
"copy-assets": "cp -r {manifest.json,images,css} dist",
"copy-assets": "cp -r {manifest.json,images,css,src/payload.js} dist",
"watch": "rm -rf dist && mkdir dist && npm run copy-assets && parcel watch src/*.html src/background.js",
"build": "rm -rf dist && mkdir dist && npm run copy-assets && parcel build src/*.html src/background.js"
},
Expand Down

0 comments on commit 98b6fd4

Please sign in to comment.