rollup-plugin-ts icon indicating copy to clipboard operation
rollup-plugin-ts copied to clipboard

How do you develop this plugin locally?

Open NullVoxPopuli opened this issue 3 years ago • 4 comments

Question

I'm mostly wondering how to start rollup in watch mode.

As is, with a normal build, I get this error:

❯ pnpm build

> [email protected] build <repo>
> pnpm run prebuild && pnpm run rollup


> [email protected] prebuild <repo>
> pnpm run clean


> [email protected] clean <repo>
> rimraf dist


> [email protected] rollup <repo>
> ts-node --esm rollup.config.ts

<repo>/node_modules/.pnpm/[email protected]_vslk2fq76uzvudesky66pvr6g4/node_modules/ts-node/dist-raw/node-internal-modules-esm-get_format.js:92
        throw new ERR_UNKNOWN_FILE_EXTENSION(ext, fileURLToPath(url));
              ^
CustomError: ERR_UNKNOWN_FILE_EXTENSION .json <repo>/package.json
    at defaultGetFormat (<repo>/node_modules/.pnpm/[email protected]_vslk2fq76uzvudesky66pvr6g4/node_modules/ts-node/dist-raw/node-internal-modules-esm-get_format.js:92:15)
    at defer (<repo>/node_modules/.pnpm/[email protected]_vslk2fq76uzvudesky66pvr6g4/node_modules/ts-node/src/esm.ts:296:7)
    at entrypointFallback (<repo>/node_modules/.pnpm/[email protected]_vslk2fq76uzvudesky66pvr6g4/node_modules/ts-node/src/esm.ts:304:22)
    at getFormat (<repo>/node_modules/.pnpm/[email protected]_vslk2fq76uzvudesky66pvr6g4/node_modules/ts-node/src/esm.ts:338:26)
    at <repo>/node_modules/.pnpm/[email protected]_vslk2fq76uzvudesky66pvr6g4/node_modules/ts-node/src/esm.ts:245:17
    at addShortCircuitFlag (<repo>/node_modules/.pnpm/[email protected]_vslk2fq76uzvudesky66pvr6g4/node_modules/ts-node/src/esm.ts:409:21)
    at load (<repo>/node_modules/.pnpm/[email protected]_vslk2fq76uzvudesky66pvr6g4/node_modules/ts-node/src/esm.ts:239:12)
    at load (<repo>/node_modules/.pnpm/[email protected]_vslk2fq76uzvudesky66pvr6g4/node_modules/ts-node/src/child/child-loader.ts:18:36)
    at ESMLoader.load (node:internal/modules/esm/loader:407:26)
    at ESMLoader.moduleProvider (node:internal/modules/esm/loader:326:22)
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.}

I'm mostly wanting to figure out why setting browserslist: false seems to polyfill object spread and object own keys. My hope is that, when using babel + the typescript preset that I could opt out of all polyfilling, and tell consumers of my library to add whatever plugins they need if they're targeting old browsers.

at the moment, browserslist: ['last 1 firefox versions'] has less polyfilling than browserslist: false -- so I was hoping to get to the bottom of why. :upside_down_face:

Thanks!

NullVoxPopuli avatar Jul 01 '22 15:07 NullVoxPopuli

As for your primary question, try again with Node v18 👍

wessberg avatar Jul 01 '22 15:07 wessberg

ah! I only had v16 -- thanks!

NullVoxPopuli avatar Jul 01 '22 16:07 NullVoxPopuli

As for your primary question

do you happen to know something about this browserslist stuff? :sweat_smile:

NullVoxPopuli avatar Jul 01 '22 22:07 NullVoxPopuli

at the moment, browserslist: ['last 1 firefox versions'] has less polyfilling than browserslist: false -- so I was hoping to get to the bottom of why. 🙃

Probably duplicate of #189?

clemyan avatar Feb 28 '23 06:02 clemyan