比如 icon库,我只用了两三个icon 。其他的希望删掉。
[purgecss]插件打包后,样式很多不对。
我如何配置或哪儿出问题了?
const glob = require('glob-all')
const PurgecssPlugin = require('purgecss-webpack-plugin')
new PurgecssPlugin({
paths: glob.sync([
path.join(__dirname, '../src/*/*.vue'),
path.join(__dirname, '../src/App.vue'),
path.join(__dirname, '../ssr/app.js'),
path.join(__dirname, '../ssr/entry-client.js')
], { nodir: true }),
defaultExtractor (content) {
const contentWithoutStyleBlocks = content.replace(/<style[^]+?<\/style>/gi, '')
return contentWithoutStyleBlocks.match(/[A-Za-z0-9-_/:]*[A-Za-z0-9-_/]+/g) || []
},
rejected: true,
whitelist: [],
whitelistPatterns: [ /-(leave|enter|appear)(|-(to|from|active))$/, /^(?!(|.*?:)cursor-move).+-move$/, /^router-link(|-exact)-active$/, /data-v-.*/ ],
})