atk / solid-register

MIT License
18 stars 1 forks source link

Updating CSS handler #7

Closed SanichKotikov closed 2 years ago

SanichKotikov commented 2 years ago

I want to update compile-css.ts to handle next issues:

I'm not sure about single PR, maybe it will be several.

@atk any thoughts?

atk commented 2 years ago

The first two are basically no-brainers and can go into one PR; the second one is part of two larger topics:

  1. automatic configuration. I figured that we should be able to read the configuration of the project itself (e.g. vite.config) and detect the settings that we should use.
  2. plug-ins for things like extra babel-solid-plugins, CSS compilation (postcss [+ tailwind or similar], sass, less), testing-setup

I'd prefer keeping that separate until I had time to think about these topics.

atk commented 2 years ago

OK, 0.2.0 is out and CSS is now more configurable. Please check if this solves your issues.

SanichKotikov commented 2 years ago

So, how can I skip css at all?

atk commented 2 years ago

css: false should work now.

SanichKotikov commented 2 years ago

No, it does not:

Error: Transform failed with 1 error:
<stdin>:1:0: ERROR: Unexpected "@"
    at failureErrorWithLog (/project/node_modules/esbuild/lib/main.js:1600:15)
    at /project/node_modules/esbuild/lib/main.js:1389:29
    at /project/node_modules/esbuild/lib/main.js:663:9
    at handleIncomingPacket (/project/node_modules/esbuild/lib/main.js:760:9)
    at Socket.readFromStdout (/project/node_modules/esbuild/lib/main.js:629:7)
    at Socket.emit (events.js:376:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
    at Socket.Readable.push (internal/streams/readable.js:223:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)

Looks like esbuild still trying to process css files.

P.S. This is why I've created PR with 'skip' value.

atk commented 2 years ago

I'll have another look.

atk commented 2 years ago

Thanks for your patience. Version 0.2.1 should fix this and also has now an example/test case so this should never break again.

SanichKotikov commented 2 years ago

Looks like it works, thanks!

atk commented 2 years ago

Thanks for testing.