react-ts-lib
react-ts-lib copied to clipboard
Issue building after fresh clone/install
Node: 14.16.1
After cloning and installing node modules and running npm run build
I get the following error:
[!] Error: Cannot find module 'postcss'
Require stack:
- /Users/tmadison/Dev/react-ts-lib/node_modules/rollup-plugin-postcss/dist/index.js
- /Users/tmadison/Dev/react-ts-lib/rollup.config.js
- /Users/tmadison/Dev/react-ts-lib/node_modules/rollup/dist/shared/loadConfigFile.js
- /Users/tmadison/Dev/react-ts-lib/node_modules/rollup/dist/bin/rollup
i got same problem and checked the output of npm install, noticed that postcss plugin need peer dependency which need be installed manually
so after
npm install -D postcss tslib
(tslib is a peer denpendency of @rollup/plugin-typescript)
i built it but it seems like rollup did not process css file and no css file was bundled to dist dir
update
i checked bundled js file and found that imported css file was converted to a string variable in bundled js, so it works well
Even after installing missing packages the build fails on the last job of generating types:
src/index.ts → dist/cjs/index.js, dist/esm/index.js...
created dist/cjs/index.js, dist/esm/index.js in 896ms
dist/esm/types/index.d.ts → dist/index.d.ts...
[!] Error: Could not resolve entry module (dist/esm/types/index.d.ts).