Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

<style src="./test.css"> does not work with css example #412

Open
manobi opened this issue Nov 5, 2020 · 5 comments
Open

<style src="./test.css"> does not work with css example #412

manobi opened this issue Nov 5, 2020 · 5 comments

Comments

@manobi
Copy link

manobi commented Nov 5, 2020

Version

6.0.0-beta.9

Reproduction link

Official rollup-plugin-vue css module example

Steps to reproduce

  1. Clone the structure in the link
  2. Add a test.css file
  3. Reference test.css in App.vue <style src="./test.css"></style>

What is expected?

$ rollup -c

App.vue → dist/app.js...
created dist/app.js in 602ms
✨  Done in 2.12s.

What is actually happening?

$ rollup -c

App.vue → dist/app.js...
[!] (plugin vue) Error: /private/tmp/vue/test.css is not parsed yet
test.css?vue&type=style&index=0&src&lang.css
Error: /private/tmp/vue/test.css is not parsed yet
    at getDescriptor (/private/tmp/vue/node_modules/rollup-plugin-vue/dist/index.js:261:11)
    at Object.transform (/private/tmp/vue/node_modules/rollup-plugin-vue/dist/index.js:94:36)
    at /private/tmp/vue/node_modules/rollup/dist/shared/rollup.js:18724:25
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

error Command failed with exit code 1.

After trying to make it work on my own project for hours, I've decided to reproduce in official css module example. The error appeared right in my first attempt, so far I've tracked error until the following function:
https://github.com/vuejs/rollup-plugin-vue/blob/next/src/index.ts#L383

@manobi
Copy link
Author

manobi commented Nov 5, 2020

The same error happens in the latest v6.0.0-beta.11 version.

Vite seems to support it, would it be possible to borrow the implementation?

@416377966
Copy link

same problem, <script lang="ts" src="./index/ts"></script> as well

@manobi
Copy link
Author

manobi commented Dec 22, 2020

same problem, <script lang="ts" src="./index/ts"></script> as well

@416377966 do you know if Vite supports it?

@416377966
Copy link

same problem, <script lang="ts" src="./index/ts"></script> as well

@416377966 do you know if Vite supports it?

yes, vite supports it. i wrote a rollup config,it doest not work

@manobi
Copy link
Author

manobi commented Dec 31, 2020

yes, vite supports it. i wrote a rollup config,it doest not work

I would love to know what part of code make it works in Vite and borrow it to my project.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants