Skip to content

Commit

Permalink
doc: 更新
Browse files Browse the repository at this point in the history
  • Loading branch information
fantian007 committed Sep 26, 2024
1 parent adb4513 commit 90f3ba1
Showing 1 changed file with 26 additions and 20 deletions.
46 changes: 26 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
# console important message with color tags
# console message with color tags
![示例](./images/[email protected])

## Usage
## rspack
```typescript
import { PrettyConsoleWebpackPlugin } from '@sprit/pretty-console-webpack-plugin';
rspack: (config, { appendPlugins, HtmlPlugin }) => {
appendPlugins(new ConsoleTagRspackPlugin({ HtmlPlugin }))
},
```

## configure
## webpack
```typescript

new PrettyConsoleWebpackPlugin({
git: {
branch: true,
hash: 7,
lastCommitDateTime: true
},
custom() {
return {
'构建版本': process.env.BUILD_VERSION // 环境变量
};
}
})
webpackChain(config, { HtmlPlugin }) {
config.plugin('tag').use(
new ConsoleTagWebpackPlugin(
{
HtmlPlugin,
git: {
branch: true,
hash: 7,
lastCommitDateTime: true,
},
custom() {
return {
构建版本: process.env.BUILD_VERSION ?? '-',
};
},
}
)
)
}
```

## Output(console)
![示例](./images/[email protected])

0 comments on commit 90f3ba1

Please sign in to comment.