jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.27k stars 507 forks source link

Output JS doesn't see CSS module #756

Open MaTeMaTuK opened 4 years ago

MaTeMaTuK commented 4 years ago

Current Behavior

Webpack creates css file and css.map in dist folder. However JS don`t see styles in runtime. image

Expected behavior

Like there: https://github.com/formik/tsdx/issues/186#issuecomment-526548872

Your environment

tsdx.config.js

const postcss = require('rollup-plugin-postcss'); const autoprefixer = require('autoprefixer'); const cssnano = require('cssnano'); module.exports = { rollup(config, options) { config.plugins.push( postcss({ plugins: [ autoprefixer(), cssnano({ preset: 'default', }), ], modules: true, inject: false, extract: !!options.writeMeta, }) ); return config; }, };

image

Software Version(s)
TSDX v0.13.2
agilgur5 commented 4 years ago

There is an integration test for CSS, but not CSS modules specifically. Will need to create a failing test for that to investigate further