autifyhq / parcel-reporter-bundle-manifest Goto Github PK
View Code? Open in Web Editor NEWhttps://github.com/mugi-uno/parcel-plugin-bundle-manifest, but for Parcel 2
License: MIT License
https://github.com/mugi-uno/parcel-plugin-bundle-manifest, but for Parcel 2
License: MIT License
TypeError [ERR_INVALID_ARG_TYPE]: The "from" argument must be of type string. Received undefined
at validateString (internal/validators.js:124:11)
at Object.relative (path.js:1167:5)
at Object.report (/usr/src/app/node_modules/parcel-reporter-bundle-manifest/lib/BundleManifestReporter.js:1:577)
at ReporterRunner.report (/usr/src/app/node_modules/@parcel/core/lib/ReporterRunner.js:105:33)
at async Parcel._build (/usr/src/app/node_modules/@parcel/core/lib/Parcel.js:449:7)
at async Parcel._startNextBuild (/usr/src/app/node_modules/@parcel/core/lib/Parcel.js:301:24)
at async PromiseQueue._runFn (/usr/src/app/node_modules/@parcel/utils/lib/PromiseQueue.js:88:7)
at async PromiseQueue._next (/usr/src/app/node_modules/@parcel/utils/lib/PromiseQueue.js:75:5) {
code: 'ERR_INVALID_ARG_TYPE'
}
Just ran an npm update, and parcel doesn't want to build anymore. I flushed .parcel-cache
, dist
, and node_modules
"parcel": "^2.0.0-rc.0",
"parcel-reporter-bundle-manifest": "^0.3.3"
The TODO
is at
When using browserslist / browsers directive to add support for old browsers, parcel 2 generates a legacy script tag with nomodule
:
Example html file generated by parcel for my legacy target (parcel build):
<!doctype html>
<html lang="nl">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="/index.48ec94f5.css" type="text/css">
</head>
<body>
<script src="/index.1400586f.js" type="module"></script>
<script src="/index.b99f7985.js" nomodule="" defer></script>
</body>
</html>
in parcel-manifest.json, only index.1400586f.js
is referenced, but not index.b99f7985.js
.
I'd like to have an option where an additional parcel-manifest.legacy.json
is generated where only the fallback urls are referenced.
package.json
{
[...]
"scripts": {
"build": "parcel build index.html",
},
"targets": {
"modern": {
"engines": {}
},
"legacy": {
"engines": {
"browsers": "> 0.5%, last 2 versions, not dead, IE 11"
}
}
},
[...]
}
src index.html:
<!doctype html>
<html lang="nl">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="site.scss" type="text/css"/>
</head>
<body>
<script src="site.js" type="module"></script>
</body>
</html>
Hi!
We are serving a Symfony PHP application with Caddy, and Symfony reads this manifest file and serves the correct assets, this works perfectly!
But, in development, I would love to serve the assets directly with parcel on its own port, and not trough Caddy, but parcel-reporter-bundle-manifest doesnt include the schema/host/port when using parcel serve.
This is different than webpack dev-server works, would you accept a PR to include this information?
I found parcel-reporter-bundle-manifest
generates multiple manifest files in the project which has multiple entries.
Parcel provides the way to handle one or more entries.
https://parceljs.org/features/targets/
When using package.json#targets
I found parcel-reporter-bundle-manifest
generates the number of entries in parcel build
.
parcel serve
generates one manifest file.
$ cat package.json
{
...
"targets": {
"a": {
"source": "a.js"
},
"b": {
"source": "b.js"
}
},
}
$ yarn run parcel serve
$ cat dist/parcel-manifest.json
{"a.js":"/a.js","b.js":"/b.js"}
$ yarn run parcel build
$ cat dist/a/parcel-manifest.json
{"a.js":"/a.js"}
$ cat dist/b/parcel-manifest.json
{"b.js":"/b.js"}
It is not occured while using package.json#source
to give multiple entries to parcel.
It is In My Opinion, but it should be generated one manifest.json
file.
Reproduce code↓
https://github.com/mtgto/example-multi-entry-parcel-reporter-bundle-manifest
the publicUrl can be an url with protocol, for example, http://hostname.com
but the function normalisePath doesn't handle this situation
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.