Skip to content

Conversation

@underfin
Copy link
Member

@underfin underfin commented Dec 12, 2024

Description

I meet the error when enable the lib test at vite-plugin-vue. ref https://github.com/rolldown/vite-plugin-vue/actions/runs/12293389227/job/34305975962?pr=1

[plugin vite:esbuild-transpile] index.js.umd.cjs:1:16
Error: Transform failed with 1 error:
index.js.umd.cjs:1:16: ERROR: Expected ")" but found "__vite_style__"
Expected ")" but found "__vite_style__"
1  |  (function(glvar __vite_style__ = document.createElement('style');__vite_style__.textContent = ".card{padding:4rem}\n/*$vite$:1*/";document.head.appendChild(__vite_style__);obal, factory) {
   |                  ^
2  |    typeof exports === 'object' && typeof module !== 'undefined' ?  factory(exports) :
3  |    typeof define === 'function' && define.amd ? define([exports], factory) :

I debugger it and found the rolldown output doubleQuotesUseStruct at umd format, it make insert position error. Here i add a doubleQuotesUseStruct test and also preserve singleQuotesUseStruct to get more compatible, avoiding the rolldown of unintentional changes at future.

Here also add a specific error if not found insert position, it is more friendly to maintainer if something unexpected happened.

@sapphi-red sapphi-red changed the title fix: insert inline css fix(css): inline css insert for single quote use strict Dec 16, 2024
@sapphi-red sapphi-red merged commit ebd8db5 into rolldown-v6 Dec 16, 2024
14 of 15 checks passed
@sapphi-red sapphi-red deleted the insert-inline-css branch December 16, 2024 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants