@senojs/rollup-plugin-style-inject
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -6,2 +6,13 @@ # Change Log | ||
## [0.2.1](https://github.com/senoteam/vite-plugin/compare/@senojs/rollup-plugin-style-inject@0.2.0...@senojs/rollup-plugin-style-inject@0.2.1) (2022-12-08) | ||
### Performance Improvements | ||
* 🧊 fixed output order of css ([585e739](https://github.com/senoteam/vite-plugin/commit/585e739379ba9dacd297de802e9196d2204f8501)) | ||
# [0.2.0](https://github.com/senoteam/vite-plugin/compare/@senojs/rollup-plugin-style-inject@0.1.1...@senojs/rollup-plugin-style-inject@0.2.0) (2022-11-18) | ||
@@ -8,0 +19,0 @@ |
10
index.js
@@ -19,3 +19,3 @@ import path from 'node:path' | ||
export default ({ insertAt = 'top' } = {}) => { | ||
const cssCodes = [] | ||
const cssCodes = {} | ||
const cssLangs = ['.css', '.less'] | ||
@@ -28,3 +28,3 @@ return { | ||
if (isCSS) { | ||
cssCodes.push(code) | ||
cssCodes[id] = code | ||
return { code: '', map: null } | ||
@@ -36,5 +36,7 @@ } | ||
if (chunk.isEntry) { | ||
const cssString = cssCodes | ||
const cssIDs = Object.keys(cssCodes).sort() | ||
const cssString = cssIDs | ||
.map((id) => cssCodes[id]) | ||
.join('') | ||
.replace(/ *\\9/g, '') | ||
.replace(/ *\\9/g, '') // remove hack code for IE9 | ||
.replace(/\\(\d+)/g, '0o$1') | ||
@@ -41,0 +43,0 @@ const injections = `injectStyle(\`${cssString}\`, '${insertAt}')` |
{ | ||
"name": "@senojs/rollup-plugin-style-inject", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "rollup-plugin-style-inject", | ||
@@ -32,3 +32,3 @@ "type": "module", | ||
}, | ||
"gitHead": "408e3c6866fe482fab8880ce8647bba6945a85a0" | ||
"gitHead": "132f7b5998d6d07222d06ca748f0e27021e0e7bf" | ||
} |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
4918
43
1