how should looks like bolderplate project for react library with typescript and module css?
I don't know how rolloup.config.js should looks like for this case.
When I build project I'm getting error
semantic error TS2307: Cannot find module './MyComponent.module.css'.
I have something like this in rollup.config.js file
import typescript from 'rollup-plugin-typescript2'
import commonjs from 'rollup-plugin-commonjs'
import external from 'rollup-plugin-peer-deps-external'
import resolve from 'rollup-plugin-node-resolve'
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
import postcss from 'rollup-plugin-postcss';
import pkg from './package.json'
export default {
input: 'src/index.ts',
output: [
{
file: pkg.main,
format: 'cjs',
exports: 'named',
sourcemap: true
},
{
file: pkg.module,
format: 'es',
exports: 'named',
sourcemap: true
}
],
plugins: [
peerDepsExternal(),
postcss({
extract: false,
modules: true
}),
external(),
resolve(),
typescript({
rollupCommonJSResolveHack: true,
exclude: [
'**/__tests__/**',
'**/*.stories.tsx'
],
clean: true
}),
commonjs({
include: ['node_modules/**'],
namedExports: {
'node_modules/react/react.js': [
'Children',
'Component',
'PropTypes',
'createElement'
],
'node_modules/react-dom/index.js': ['render']
}
})
]
}
But it doesn't work. It would be great, if somone could create simple library project with Typescript and module css.