将JS库与Laravel和Webpack一起使用

时间:2018-12-06 16:39:17

标签: javascript laravel webpack leaflet

我想知道如何在Laravel和webpack中使用传单插件。

目前,我有:

webpack.mix.js:

mix.js([
    'resources/assets/js/app.js',
    'resources/assets/js/main.js',

], 'public/js/app.js');

app.js:

require('./bootstrap');

bootstrap.js:

window._ = require('lodash');

try {
    window.$ = window.jQuery = require('jquery');

    window.Popper = require('popper.js').default; // default is very important.

    require('bootstrap');
} catch (e) {}

main.js:

let leaflet = require('./leaflet.js');
let GroupLayer = require('./grouplayer-leaflet.js');
let antPath = require('./leaflet-ant-path.js');

$(window).on('load', function() {
... my code

在./resources/assets/js/中,我有不同的文件

  • app.js
  • main.js
  • bootstrap.js
  • leaflet.js
  • grouplayer-leaflet.js
  • leaflet-ant-path.js

但是我有一个错误:

  找不到./resources/assets/js/leaflet-ant-path.js模块中的

错误:   错误:无法解析“传单”

0 个答案:

没有答案