Skip to content

Commit

Permalink
chore: upgrade rollup 3.20.0 (#12497)
Browse files Browse the repository at this point in the history
  • Loading branch information
sun0day authored Mar 21, 2023
1 parent e6337aa commit 7288a24
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 55 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"prompts": "^2.4.2",
"resolve": "^1.22.1",
"rimraf": "^4.1.2",
"rollup": "^3.18.0",
"rollup": "^3.20.0",
"semver": "^7.3.8",
"simple-git-hooks": "^2.8.1",
"tslib": "^2.5.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"esbuild": "^0.17.5",
"postcss": "^8.4.21",
"resolve": "^1.22.1",
"rollup": "^3.18.0"
"rollup": "^3.20.0"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { beforeEach, describe, expect, test } from 'vitest'
import { findAssetFile, isBuild, startDefaultServe } from '~utils'

beforeEach(async () => {
await startDefaultServe()
})

for (let i = 0; i < 5; i++) {
describe.runIf(isBuild)('css-codesplit build', () => {
test('should be consistent with same content', () => {
expect(findAssetFile(/style-.+\.css/)).toMatch('h2{color:#00f}')
expect(findAssetFile(/style2-.+\.css/)).toBe('')
})
})
}
2 changes: 1 addition & 1 deletion playground/css-codesplit/__tests__/css-codesplit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test('style order should be consistent when style tag is inserted by JS', async

describe.runIf(isBuild)('build', () => {
test('should remove empty chunk', async () => {
expect(findAssetFile(/style.*\.js$/)).toBe('')
expect(findAssetFile(/style-.*\.js$/)).toBe('')
expect(findAssetFile('main.*.js$')).toMatch(`/* empty css`)
expect(findAssetFile('other.*.js$')).toMatch(`/* empty css`)
expect(findAssetFile(/async.*\.js$/)).toBe('')
Expand Down
3 changes: 3 additions & 0 deletions playground/css-codesplit/style2.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
h2 {
color: blue;
}
1 change: 1 addition & 0 deletions playground/css-codesplit/style2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './style2.css'
1 change: 1 addition & 0 deletions playground/css-codesplit/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default defineConfig({
input: {
main: resolve(__dirname, './index.html'),
other: resolve(__dirname, './other.js'),
style2: resolve(__dirname, './style2.js'),
},
output: {
manualChunks(id) {
Expand Down
104 changes: 52 additions & 52 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7288a24

Please sign in to comment.