Skip to content

Commit

Permalink
feat: one more judge
Browse files Browse the repository at this point in the history
  • Loading branch information
poyoho committed Aug 17, 2022
1 parent 7f49b78 commit 8422fbc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vite/src/node/plugins/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,9 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
`var ${style} = document.createElement('style');` +
`${style}.innerHTML = ${cssString};` +
`document.head.appendChild(${style});`
const wrapIdx = code.indexOf('System.register')
const insertMark = "'use strict';"
const insertIdx = code.indexOf(insertMark)
const insertIdx = code.indexOf(insertMark, wrapIdx)
const s = new MagicString(code)
s.appendLeft(insertIdx + insertMark.length, injectCode)
if (config.build.sourcemap) {
Expand Down

0 comments on commit 8422fbc

Please sign in to comment.