当前位置: 首页 > 工具软件 > Prepack > 使用案例 >

[Webpack] Configure Prepack with Webpack

寇和璧
2023-12-01

Great improvements and optimizations can be made to the output of bundled code. Prepack provides the ability to optimize code at build-time, producing run-time optimizations. In this lesson, we will look at configuring Prepack to use Webpack with the Prepack Webpack Plugin so we can enjoy extremely concise and optimized build scripts within our Webpack project.

 

install

yarn add prepack-webpack-plugin --dev

 

config:

const PrepackWebpackPlugin = require('prepack-webpack-plugin').default;

module.exports = { 
  entry: './entry.js',
  output: {
    path: __dirname,
    filename: 'bundle.js'
  },
  plugins: [
    new PrepackWebpackPlugin()
  ]
};

 

转载于:https://www.cnblogs.com/Answer1215/p/6814486.html

 类似资料: