Fil*_*rec 7 javascript jquery webpack-encore symfony4
我升级到Symfony 4.1并切换到Encore后面临一个问题.
Uncaught RangeError: Maximum call stack size exceeded
at _typeof (bundle.js?v=1.6565:3454)
at _typeof (bundle.js?v=1.6565:3454)
at _typeof (bundle.js?v=1.6565:3454)
at _typeof (bundle.js?v=1.6565:3454)
at _typeof (bundle.js?v=1.6565:3454)
at _typeof (bundle.js?v=1.6565:3454)
at _typeof (bundle.js?v=1.6565:3454)
at _typeof (bundle.js?v=1.6565:3454)
at _typeof (bundle.js?v=1.6565:3454)
at _typeof (bundle.js?v=1.6565:3454)
Run Code Online (Sandbox Code Playgroud)
我试图搜索问题的来源,并且只有在使用来自compose.js(和包含)的jquery include删除所有内容后,Error才会消失.但当然我需要jquery ......
一旦我从'jquery''或'Encore.autoProvidejQuery()'导入jQuery,就会发生错误
Webpack.config.js:
const Encore = require('@symfony/webpack-encore');
let publicPath = '/build/';
if (Encore.isProduction()) { // yarn run encore production
publicPath = '/****_symfony/build/';
}
Encore
.setOutputPath('public/build/')
.setPublicPath(publicPath)
.setManifestKeyPrefix('build/')
.cleanupOutputBeforeBuild()
.enableSourceMaps(!Encore.isProduction())
.addEntry('bundle', './assets/compose.js')
.enableStylusLoader()
.enableLessLoader()
.enableSassLoader()
;
const config = Encore.getWebpackConfig();
for (const rule of config.module.rules) {
if (rule.hasOwnProperty('use')) {
for (loader of rule.use) {
if (loader.loader === 'babel-loader') {
delete rule.exclude;
}
}
}
}
module.exports = config;
Run Code Online (Sandbox Code Playgroud)