Pretty print assets tree.
When writing DEMO, it need to print files from webpack build in the form of a tree, but Webpack only provides file arrays and cannot output well.
# use npm
$ npm install --dev @dumlj/pretty-assets-tree-webpack-plugin
# use yarn
$ yarn add --dev @dumlj/pretty-assets-tree-webpack-plugin
# use pnpm
$ pnpm add @dumlj/pretty-assets-tree-webpack-plugin -D
import { PrettyAssetsTreeWebpackPlugin } from '@dumlj/pretty-assets-tree-webpack-plugin'
export default {
mode: 'production',
plugins: [
new PrettyAssetsTreeWebpackPlugin({
banner: chalk.whiteBright.bold('The following files are artifacts.'),
include: ['**/*.d.ts'],
}),
],
}
In the demo, the files is output to the memory, please check the console
.
Or remove the comment writeToDisk: true
from the MemfsWebpackPlugin
in webpack.config.ts
and run yarn build
.
@dumlj/pretty-assets-tree-webpack-plugin ├─┬ @dumlj/seed-webpack-plugin │ ├─┬─ @dumlj/feature-updater │ │ ├─── @dumlj/shell-lib │ │ ├─── @dumlj/util-lib │ │ └─── @dumlj/mock-libPRIVATE │ └─── @dumlj/mock-libPRIVATE ├── @dumlj/util-lib └── @dumlj/mock-libPRIVATE