Skip to content

Commit 20b20ba

Browse files
[#12] Fix lib for Vite Plugin Legacy (#13)
* Fix * 1.2.1
1 parent a0369a0 commit 20b20ba

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vite-plugin-css-injected-by-js",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "A Vite plugin that takes the CSS and adds it to the page through the JS. For those who want a single JS file.",
55
"main": "dist/plugin.js",
66
"scripts": {

src/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default function cssInjectedByJsPlugin({topExecutionPriority} = { topExec
4646

4747
const chunk = bundle[key];
4848

49-
if (chunk.type === 'chunk' && chunk.fileName.includes('.js')) {
49+
if (chunk.type === 'chunk' && chunk.fileName.includes('.js') && !chunk.fileName.includes('polyfill')) {
5050

5151
let topCode: string = '';
5252
let bottomCode: string = '';

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"compilerOptions": {
44
"declaration": true,
55
"esModuleInterop": true,
6-
"module": "esnext",
6+
"module": "commonjs",
77
"moduleResolution": "node",
88
"noUnusedLocals": true,
99
"outDir": "dist",
1010
"strict": true,
1111
"sourceMap": false,
12-
"target": "esnext"
12+
"target": "es2018"
1313
}
1414
}

0 commit comments

Comments
 (0)