无法找到变量:webpackJsonp和webpack构建的项目

时间:2018-03-27 13:32:19

标签: webpack webpacker

这是我的配置(我使用带有Rails的webpacker)

environment.entry['jquery-uls'] = [
  './node_modules/@bower_components/jquery/dist/jquery.js',
  './node_modules/@bower_components/lodash/lodash.js',
  './node_modules/@bower_components/jquery.uls/src/jquery.uls.data.js',
  './node_modules/@bower_components/jquery.uls/src/jquery.uls.data.utils.js',
  './node_modules/@bower_components/jquery.uls/src/jquery.uls.lcd.js',
  './node_modules/@bower_components/jquery.uls/src/jquery.uls.languagefilter.js',
  './node_modules/@bower_components/jquery.uls/src/jquery.uls.core.js',
];

environment.plugins.append(
  'CommonChunks',
  new webpack.optimize.CommonsChunkPlugin({
    name: 'jquery-uls',
    minChunks: Infinity,
  })
);

我在浏览器中遇到的错误是:

ReferenceError: webpackJsonp is not defined
ReferenceError: Raven is not defined
ReferenceError: webpackJsonp is not defined

在对此的研究中,我理解问题可能是由于事物的排序不正确引起的,所以这里是DOM树的相关部分。

<script src="/packs/raven-80435354a02573d42db2.js"></script>
<!-- / Sentry logging -->
<script>
Raven.config(SentryDsn).install();
Raven.setExtraContext(currentUser);
</script>
<script src="/assets/javascripts/jquery-uls.js"></script>
<script src="/packs/main-e5d1eff17ae48e5067be.js"></script>

<meta name="csrf-param" content="authenticity_token">
<meta name="csrf-token" content="7YxjpYGr1Q/foPI+v4DHrSLAq9ZeD6Mfthvv6BGwG1Sq5FWReguDQdtUxW48CRbRSVinUpmKW1vHkS0tY9UobQ==">

有什么想法吗?

0 个答案:

没有答案