Can angular-cli remove unused css?

后端 未结 6 1461
时光说笑
时光说笑 2020-12-23 21:22

so far the smallest bundle I can create with angular cli is by running

ng build --aot true -prod

I was wondering if the build p

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-23 21:51

    module.export={
      plugins: [
        new ExtractTextPlugin('[name].[contenthash].css'),
        // Make sure this is after ExtractTextPlugin!
        new PurifyCSSPlugin({
          // Give paths to parse for rules. These should be absolute!
          paths: glob.sync(path.join(__dirname, 'app/*.html')),
        })
      ]
    
    };
    

    install purifycss webpack first

提交回复
热议问题