Skip to content

Don't create typings files for non-named imports #45

Open
@fourpastmidnight

Description

@fourpastmidnight

I'm using Semantic UI React along with their Semantic UI CSS styles.

App.tsx:

import 'semantic-ui-css/semantic.min.css';
import './App.css'
import MyComponent from './components';

export const App = () => <MyComponent />

export default App;

In the code above, both CSS imports cause a <filename>.css.d.ts file to be created. But this is problematic for the semantic.min.css file because it's not my file. It's one provided by a NPM library. And I'm using a mono-repo with Yarn and PnPJS, so there is no node_modules folder, but a cache of ZIP files with a require.resolve hook/interceptor to provide module resolution for node--i.e. the "node_modules" filesystem is "read-only". And so this loader fails:

D:/src/git/my-project/.yarn/cache/semantic-ui-css-npm-2.4.1-488d289b03-51eb2d50e7.zip/node_modules/semantic-ui-css/semantic.min.css (D:/src/git/my-project/.yarn/$$virtual/css-loader-virtual-73afbc880bb/0/cache/css-loader-npm-4.3.0-33464197c9-1f441ac567.zip/node_modules/css-loader/dist/cjs.js??ref--5-oneOf-4-1!D:/src/git/my-project/.yarn/cache/css-modules-typescript-loader-npm-4.0.1-393a7cad32-5af2583d4a.zip/node_modules/css-modules-typescript-loader!D:/src/git/my-project/.yarn/cache/postcss-loader-npm-3.0.0-f4ab99b685-50b2d8892d.zip/node_modules/postcss-loader/src?postcss!D:/src/git/my-project/.yarn/cache/semantic-ui-css-npm-2.4.1-488d289b03-51e2d50e7.zip/node_modules/semantic-ui-css/semantic.min.css)
Error: EROFS: read-only filesystem, open '/node_modules/semantic-ui-css-semantic.min.css.d.ts'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions