Skip to content

Commit

Permalink
docs: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework committed May 16, 2024
1 parent dbb02b0 commit 467e474
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
1 change: 0 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
- name: Publish to NPM
run: |
pnpm changeset publish
git push --follow-tags
- name: GitHub Release
run: pnpx changelogithub
Expand Down
30 changes: 17 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,26 +120,30 @@ The function should return the updated Rsbuild configuration.
Because Rspack temporarily does not support the `webpackInclude` magic comment, non-story files may be bundled, which could lead to build failures. These files can be ignored using `rspack.IgnorePlugin`.

```js
// .storybook/main.js
import { mergeRsbuildConfig } from '@rsbuild/core'

module.exports = {
export default {
framework: 'storybook-react-rsbuild',
async rsbuildFinal(config) {
return mergeRsbuildConfig(config, {
tools: {
rspack: (config, { addRules, appendPlugins, rspack, mergeConfig }) => {
appendPlugins([
new rspack.IgnorePlugin({
checkResource: (resource, context) => {
const absPathHasExt = extname(resource)
if (absPathHasExt === '.md') {
return true
}

return false
},
}),
])
return mergeConfig(config, {
plugins: [
new rspack.IgnorePlugin({
checkResource: (resource, context) => {
// for example, ignore all markdown files
const absPathHasExt = extname(resource)
if (absPathHasExt === '.md') {
return true
}

return false
},
}),
],
})
},
},
})
Expand Down

0 comments on commit 467e474

Please sign in to comment.