asfktz / autodll-webpack-plugin

Webpack's DllPlugin without the boilerplate
MIT License
1.46k stars 81 forks source link

how to use this plugin with create-react-app & craco ? #151

Open littlee opened 3 years ago

littlee commented 3 years ago

create-react-app and craco are popular tools when developing react app, an integrate example with those tools would be nice.

I've tried the config below, but it doesn't works

// craco.config.js
const AutoDllPlugin = require('autodll-webpack-plugin');
const path = require('path');
module.exports = {
  webpack: {
    plugins: [
      new AutoDllPlugin({
        inject: true,
        filename: '[name]_[hash].js',
        context: path.join(__dirname, '..'),
        path: './dll',
        entry: {
          vendor: ['react', 'react-dom']
        }
      })
    ]
  }
};
blockmood commented 1 year ago