Ich habe meine Stylesheets erstellt und Javascript-Dateien mit Laravel Mix, Code ist unten angegeben:
Uncaught Reference: require ist nicht erforderlich definiert ('./ Bootstrap') Laravel Mix
const { mix } = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
// mix.js('resources/assets/js/app.js', 'public/js')
// .sass('resources/assets/sass/app.scss', 'public/css');
mix.babel([
'public/js/plugins/loaders/pace.min.js',
'resources/assets/js/app.js',
'public/js/plugins/loaders/blockui.min.js',
'public/js/plugins/ui/nicescroll.min.js',
'public/js/plugins/ui/drilldown.js',
'public/js/plugins/ui/fab.min.js',
'public/js/plugins/forms/selects/select2.min.js',
'public/js/plugins/forms/styling/uniform.min.js',
'public/js/plugins/ui/moment/moment.min.js',
'public/js/plugins/ui/fullcalendar/fullcalendar.min.js',
'public/js/core/app.js',
'public/js/pages/user_pages_profile.js',
] , 'public/js/app.js');
mix.styles([
'public/css/icons/icomoon/styles.css',
'resources/assets/sass/app.scss',
'public/css/core.css',
'public/css/components.css',
'public/css/colors.css',
],'public/css/app.css');
Nachfolgend finden mein app.js
/**
* First we will load all of this project's JavaScript dependencies which
* includes Vue and other libraries. It is a great starting point when
* building robust, powerful web applications using Vue and Laravel.
*/
require('./bootstrap'); //complains on this line after compilation
/**
* Next, we will create a fresh Vue application instance and attach it to
* the page. Then, you may begin adding components to this application
* or customize the JavaScript scaffolding to fit your unique needs.
*/
Vue.component('example', require('./components/Example.vue'));
const app = new Vue({
el: '#app'
});
Es beschwert sich über die erforderlich,
Uncaught Reference: benötigen, ist nicht definiert app.js: 354, das der kompiliert wird app.js
I versucht:
1- mix.scripts
2- mix.babel (laut Dokumentation wird jeder ES2015-Code in Vanilla-JavaScript übersetzt, das alle Browser verstehen.)
Was fehlt mir hier?
Können Sie den genauen Fehler hinzufügen, den Sie erhalten? – TheFallen
Fehler wird in der Frage erwähnt, aber auch in der Beschreibung jetzt hinzugefügt. – awebartisan
Versuchen Sie, ** import ** statt ** require ** zu verwenden. – TheFallen