`sources` y `generates` en el Taskfile considered harmful
actualmente, master
está roto porque entry.js
pide axe-core
, pero no está especificado en package.json
, entonces esbuild falla.
> ./node_modules/.bin/esbuild _packs/entry.js --analyze --bundle --minify --sourcemap --outdir=assets/js/ --entry-names=pack.[hash] --metafile=_data/manifest.json
✘ [ERROR] Could not resolve "@spree/storefront-api-v2-sdk"
_packs/entry.js:25:27:
25 │ import { makeClient } from "@spree/storefront-api-v2-sdk";
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can mark the path "@spree/storefront-api-v2-sdk" as external to exclude it from the bundle,
which will remove this error.
✘ [ERROR] Could not resolve "axe-core/locales/es.json"
_packs/entry.js:47:41:
47 │ window.axe.configure({ locale: require("axe-core/locales/es.json") });
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~
You can mark the path "axe-core/locales/es.json" as external to exclude it from the bundle, which
will remove this error. You can also surround this "require" call with a try/catch block to handle
this failure at run-time instead of bundle-time.
✘ [ERROR] Could not resolve "axios"
_packs/endpoints/sutty.js:1:18:
1 │ import Axios from "axios";
╵ ~~~~~~~
You can mark the path "axios" as external to exclude it from the bundle, which will remove this
error.
✘ [ERROR] Could not resolve "qs"
_packs/endpoints/sutty.js:2:20:
2 │ import * as qs from "qs";
╵ ~~~~
You can mark the path "qs" as external to exclude it from the bundle, which will remove this
error.
mi teoría es que este bug existe porque en el taskfile, solo se corre pnpm si el pnpm-lock/package.json cambió. creo que por estas restricciones, no se corrió pnpm install
cuando @fauno cambió a la rama de master para mergear esbuild, y al intentar compilar el código no falló.
también pasa con el bundle, que afecta cuando se actualiza ruby, ver #70.
por todo esto, creo que es mejor que borremos estas condiciones del taskfile y que siempre se corran las tareas no importa qué, para prevenir este tipo de problemas comunes.
¿opiniones?