-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: use CssExtractRspackPlugin to extract CSS #1577
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
4a133a8
feat: use mini-css-extract
9aoy 46d6fc9
fix: update css plugin
9aoy a3e4b08
fix: merge conflict
9aoy 9e8e07d
fix: bump rspack
9aoy 08a7b22
fix: snapshot
9aoy 02568f5
fix: loader name
9aoy 5ca93fd
fix: update test case config
9aoy 83a518d
fix: resolve conflicts
9aoy 885d96e
fix: bump rspack
9aoy 94c99ca
Merge branch 'main' into feat/use-mini-css-extract
9aoy 263ad32
fix: resolve conflicts
9aoy 3515d63
fix: use rspack 0.5.7 canary
9aoy 59f070e
fix: bump rspack
9aoy b6e955a
fix: bump rspack
9aoy 0dd7269
fix: bump rspack
9aoy 5d23ea7
fix: merge conflict
9aoy 790e832
fix: add css-assets test case
9aoy fee5153
fix: bump rspack again
9aoy 7673a15
fix: merge conflict
9aoy 9813973
fix: newTreeshaking already default true
9aoy 387525a
fix: bump +11
9aoy 6f07c4e
fix: merge conflict
9aoy e8562d5
fix: merge confilct & namedExport test case
9aoy 41ff7ff
fix: lint
9aoy 637e63b
fix: snapshot
9aoy ab01984
fix: update rspack
9aoy 9bf4d5d
fix: update test case
9aoy 54df855
fix: bump rspack
9aoy 38a40d9
fix: use latest rspack
9aoy bc67f89
Merge branch 'main' into feat/use-mini-css-extract
9aoy e9b1d8f
Update package.json
9aoy ac3f082
Merge branch 'main' into feat/use-mini-css-extract
9aoy 7253ecf
fix: dynamic import mini-css-extract-plugin
9aoy 9b7251a
Merge branch 'main' into feat/use-mini-css-extract
chenjiahan 6e88d85
fix: update css assets
chenjiahan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import path from 'node:path'; | ||
import { build } from '@e2e/helper'; | ||
import { globContentJSON } from '@e2e/helper'; | ||
import { expect, test } from '@playwright/test'; | ||
|
||
test('should build CSS assets correctly', async () => { | ||
await expect( | ||
build({ | ||
cwd: __dirname, | ||
rsbuildConfig: {}, | ||
}), | ||
).resolves.toBeDefined(); | ||
|
||
const outputs = await globContentJSON(path.join(__dirname, 'dist')); | ||
const outputFiles = Object.keys(outputs); | ||
|
||
expect( | ||
outputFiles.find( | ||
(item) => item.includes('static/image/image') && item.endsWith('.jpeg'), | ||
), | ||
).toBeTruthy(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { defineConfig } from '@rsbuild/core'; | ||
import { pluginReact } from '@rsbuild/plugin-react'; | ||
|
||
export default defineConfig({ | ||
plugins: [pluginReact()], | ||
output: {} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
function load(key: string) { | ||
import(`./test/${key}`).then(res => { | ||
console.log('res', res); | ||
}) | ||
} | ||
|
||
load('a'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import styles from './index.module.less'; | ||
|
||
console.log('s', styles); | ||
|
||
export const a = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.header { | ||
background: url('@assets/image.jpeg') no-repeat; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { defineConfig } from '@rsbuild/core'; | ||
import { pluginReact } from '@rsbuild/plugin-react'; | ||
|
||
export default defineConfig({ | ||
plugins: [pluginReact()], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do we need to do to support this