PSMedia90's avatar

Error with Rollup and Elixer

Hay Laracast

why would Elixir and rollup

giving me this error

Thank You PSMedia90

[psmedia90@psm-powerhouse carlospizza53]$ gulp [13:44:54] Using gulpfile /var/www/carlospizza53/gulpfile.js [13:44:54] Starting 'all'... [13:44:54] Starting 'sass'... [13:44:55] Finished 'sass' after 704 ms [13:44:55] Starting 'copy'... [13:44:55] Finished 'copy' after 30 ms [13:44:55] Starting 'copy'... [13:44:55] Finished 'copy' after 30 ms [13:44:55] Starting 'copy'... [13:44:55] Finished 'copy' after 1.76 ms [13:44:55] Starting 'copy'... [13:44:55] Finished 'copy' after 21 ms [13:44:55] Starting 'copy'... [13:44:55] Finished 'copy' after 11 ms [13:44:55] Starting 'rollup'... (node:21538) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Path must be a string. Received [ 'resources/assets/js/jquery/jquery.js', 'resources/assets/js/bootstrap/js/bootstrap.js', 'resources/assets/js/all.js' ] (node:21538) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. (node:21538) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1) { TypeError: Error transforming /var/www/carlospizza53/resources/assets/js/jquery/jquery.js with 'commonjs' plugin: Path must be a string. Received [ 'resources/assets/js/jquery/jquery.js', 'resources/assets/js/bootstrap/js/bootstrap.js', 'resources/assets/js/all.js' ] at assertPath (path.js:7:11) at Object.resolve (path.js:1146:7) at defaultResolver (/var/www/carlospizza53/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.cjs.js:49:71) at /var/www/carlospizza53/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.cjs.js:519:15 at process._tickDomainCallback (internal/process/next_tick.js:129:7) rollupTransform: true, id: '/var/www/carlospizza53/resources/assets/js/jquery/jquery.js', plugin: 'commonjs' } [psmedia90@psm-powerhouse carlospizza53]$

0 likes
2 replies
PSMedia90's avatar

Here is my gulpfile.js

i dont understand what is going on

`` const elixir = require('laravel-elixir'); require('laravel-elixir-vue-2');

/* |-------------------------------------------------------------------------- | Elixir Asset Management |-------------------------------------------------------------------------- | | Elixir provides a clean, fluent API for defining some basic Gulp tasks | for your Laravel application. By default, we are compiling the Sass | file for our application, as well as publishing vendor resources. | */

//elixir(mix => { // mix.sass('app.scss') // .webpack('app.js'); //});

elixir.config.publicDir = 'public_html'; elixir.config.publicPath = 'public_html'; elixir.config.cssOutput = 'public_html/css'; elixir.config.jsOutput = 'public_html/js';

var basePaths = { src: 'resources/assets/', dest: 'public/', npm: 'node_modules/', bower: 'resources/vendor/' };

var paths = {

images: {
    src: basePaths.src + 'images/',
    dest: basePaths.dest + 'images/'
},
scripts: {
    src: basePaths.src + 'js/',
    dest: basePaths.dest + 'js/'
},
styles: {
    src: basePaths.src + 'sass/',
    dest: basePaths.dest + 'css/'
}

};

var appFiles = { style: paths.styles.src + '/*.scss', scripts: [paths.scripts.src + 'app.js'], jQuery: [paths.scripts.src + 'jquery/jquery.js'], foundationJS: [paths.scripts.src + 'foundation/dist/foundation.js'] };

var vendorFiles = {

foundation: {
    scss: basePaths.npm + 'foundation-sites/scss/',
    js: basePaths.npm + 'foundation-sites/js/',
    jsDist: basePaths.npm + 'foundation-sites/dist/'
},

bootstrap: {
    scss: basePaths.npm + 'bootstrap/scss/',
    js: basePaths.npm + 'bootstrap/dist/js/'

},

fontAwesome: {
    scss: basePaths.npm + 'font-awesome/scss/',
    fonts: basePaths.npm + 'font-awesome/fonts/',
    styles: basePaths.npm + 'font-awesome/css/'
},

jQuery: {
    js: basePaths.npm + 'jquery/dist/'
}

};

elixir(mix => { mix.sass('app.scss');

// Copy files to Resources folder
mix.copy(vendorFiles.fontAwesome.fonts, basePaths.dest + 'fonts');
mix.copy(vendorFiles.jQuery.js, paths.scripts.src + 'jquery');
mix.copy(vendorFiles.bootstrap.scss, paths.styles.src + 'bootstrap/scss');
mix.copy(vendorFiles.bootstrap.js, paths.scripts.src + 'bootstrap/js');
mix.copy(vendorFiles.foundation.jsDist, paths.scripts.src + 'foundation/dist');
mix.copy(vendorFiles.fontAwesome.scss, paths.styles.src + 'font-awesome/scss');

mix.rollup([
    'jquery/jquery.js',
    'bootstrap/js/bootstrap.js',
    'app.js'
]);

mix.version([
    'css/app.css',
    'js/app.js'
]);

}); ``

Please or to participate in this conversation.