Laravel 9混合:如何使用异步等待组成?
我在网络中没有发现任何人可以解释如何添加外科视图等待Laravel Mix的组成。
我的错误:
ERROR in ./resources/js/departements_search.js
Module parse failed: The top-level-await experiment is not enabled (set experiments.topLevelAwait: true to enabled it)
File was processed with these loaders:
* ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
我找到了这个:
module.exports = {
//...
experiments: {
asyncWebAssembly: true,
buildHttp: true,
layers: true,
lazyCompilation: true,
outputModule: true,
syncWebAssembly: true,
topLevelAwait: true,
},
};
但是我不明白如何设置?我的webpack.config似乎根本没有起作用。如何添加此功能,例如:
mix.webpackConfig({
// something here
});
谢谢。
I don't find anywere in the web someone to explain how to add exoperiment await componnent to laravel mix.
My error :
ERROR in ./resources/js/departements_search.js
Module parse failed: The top-level-await experiment is not enabled (set experiments.topLevelAwait: true to enabled it)
File was processed with these loaders:
* ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
I found this :
module.exports = {
//...
experiments: {
asyncWebAssembly: true,
buildHttp: true,
layers: true,
lazyCompilation: true,
outputModule: true,
syncWebAssembly: true,
topLevelAwait: true,
},
};
But I don't understand how to setup ? My webpack.config seem not working at all. How to add this feature like :
mix.webpackConfig({
// something here
});
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的
webpack.mix.js
中,添加以下内容:In your
webpack.mix.js
, add this: