首页 > 其他分享 >webpack——The top-level-await experiment is not enabled (set experiments.topLevelAwait: true to enabl

webpack——The top-level-await experiment is not enabled (set experiments.topLevelAwait: true to enabl

时间:2022-12-15 02:11:06浏览次数:81  
标签:set level enabled topLevelAwait webpack experiments true

前言

在搏皮中通过动态的引入CDN资源,来减少搏皮制品的大小,但是webpack没有开启topLevelAwait所以产生了报错;

experiments: https://webpack.docschina.org/configuration/experiments/

内容

!> 实验特性

const json5 = require('json5')
const miniCssExtractPlugin = require('mini-css-extract-plugin')


module.exports = {
    entry: './src/main.js',
    experiments: {
        topLevelAwait: true,
    },
}

标签:set,level,enabled,topLevelAwait,webpack,experiments,true
From: https://www.cnblogs.com/wangyang0210/p/16984125.html

相关文章