prepack-webpack-plugin
prepack-webpack-plugin 介绍
prepack-webpack-plugin 使用 Prepack,一个JavaScript 局部执行器。它重写了可以在编译时完成的计算,从而加快了代码执行速度。
例子
import PrepackwebpackPlugin from 'prepack-webpack-plugin';
const configuration = {};
module.exports = {
// ...
plugins: [
new PrepackwebpackPlugin(configuration)
]
};
如果使用commonjs,则必须显式引用.default模块的属性,例如
const PrepackwebpackPlugin = require('prepack-webpack-plugin').default;
const configuration = {};
module.exports = {
// ...
plugins: [
new PrepackwebpackPlugin(configuration)
]
};
GitHub:https://github.com/gajus/prepack-webpack-plugin
网站描述:prepack的一个webpack插件