Use esbuild instead of Parcel. (#131)
This replaces Parcel with [esbuild][]. esbuild has a number of advantages over Parcel: * It is much, much, *much* faster. A Parcel build takes several seconds on my system, while esbuild takes 60-70 _milliseconds_. * Parcel hard-crashes when I switch branches on Windows, esbuild doesn't. The one disadvantage is that, as far as I can tell, esbuild doesn't support any kind of auto-reloading in the browser when you change things. IMO this isn't that big a deal and the benefits outweigh this minor inconvenience (and anyways, auto-reload has historically backfired so many times that I usually have been manually reloading the page whenever I make changes). [esbuild]: https://esbuild.github.io/pull/133/head
rodzic
f3ab28f70d
commit
d13c892f3d
|
@ -1,7 +1,7 @@
|
|||
node_modules
|
||||
dist
|
||||
dist-watch
|
||||
.cache
|
||||
lib/_svg-vocabulary-pretty-printed.json
|
||||
lib/_svg-vocabulary.ts
|
||||
lib/**/*.avsc.ts
|
||||
dist/browser-main.js
|
||||
dist/browser-main.js.map
|
||||
|
|
|
@ -174,4 +174,4 @@ ul.navbar li:last-child {
|
|||
<p>Alas, you need JavaScript to peruse this page.</p>
|
||||
</noscript>
|
||||
<div id="app" className="app"></div>
|
||||
<script src="lib/browser-main.tsx"></script>
|
||||
<script src="browser-main.js"></script>
|
|
@ -0,0 +1,5 @@
|
|||
import * as buf from "buffer/";
|
||||
|
||||
export let process = { env: {} };
|
||||
|
||||
export let Buffer = buf.Buffer;
|
Plik diff jest za duży
Load Diff
22
package.json
22
package.json
|
@ -10,16 +10,18 @@
|
|||
"typecheck": "tsc --noemit",
|
||||
"test:watch": "jest --watch",
|
||||
"test": "jest",
|
||||
"esbuild": "esbuild lib/browser-main.tsx --bundle --outfile=dist/browser-main.js --external:stylus --define:global=window --inject:./lib/esbuild-shims.js --target=es2018 --sourcemap",
|
||||
"esbuild:build": "npm run esbuild -- --define:process.env.NODE_ENV=\\\"production\\\" --minify",
|
||||
"esbuild:serve": "npm run esbuild -- --servedir=dist --serve=1234",
|
||||
"build-prereqs": "node build-vocabulary.js && node build-avro-typescript.js",
|
||||
"build": "npm run build-prereqs && rimraf dist && parcel build index.html -d dist --public-url .",
|
||||
"watch": "npm run build-prereqs && parcel index.html -d dist-watch"
|
||||
"build": "npm run build-prereqs && npm run esbuild:build",
|
||||
"watch": "npm run build-prereqs && npm run esbuild:serve"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"jest": {
|
||||
"testPathIgnorePatterns": [
|
||||
"dist",
|
||||
"dist-watch",
|
||||
".cache"
|
||||
]
|
||||
},
|
||||
|
@ -37,24 +39,20 @@
|
|||
"avro-js": "^1.10.2",
|
||||
"avro-typescript": "^1.1.0",
|
||||
"babel-jest": "^26.6.3",
|
||||
"buffer": "^6.0.3",
|
||||
"cheerio": "^1.0.0-rc.5",
|
||||
"classnames": "^2.3.1",
|
||||
"colorspaces": "^0.1.5",
|
||||
"esbuild": "^0.12.5",
|
||||
"gh-pages": "^3.1.0",
|
||||
"hsluv": "^0.1.0",
|
||||
"jest": "^26.6.3",
|
||||
"parcel-bundler": "^1.12.4",
|
||||
"parcel-plugin-static-files-copy": "^2.6.0",
|
||||
"prettier": "^2.2.1",
|
||||
"react": "^17.0.1",
|
||||
"react-dom": "^17.0.1",
|
||||
"toml": "^3.0.0",
|
||||
"typescript": "^4.1.3"
|
||||
"typescript": "^4.1.3",
|
||||
"util": "^0.12.3"
|
||||
},
|
||||
"browserslist": [
|
||||
"since 2017-06"
|
||||
],
|
||||
"devDependencies": {
|
||||
"rimraf": "^3.0.2"
|
||||
}
|
||||
"devDependencies": {}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
"exclude": [
|
||||
"dist",
|
||||
"dist-watch",
|
||||
"vendor/**/*.js",
|
||||
],
|
||||
"compilerOptions": {
|
||||
|
|
Ładowanie…
Reference in New Issue