JeffreyWay / Laravel-Elixir-Rollup

Official Rollup extension for Laravel Elixir. (Includes support for .vue files).
29 stars 12 forks source link

Error transforming util.js with 'commonjs' plugin: Path must be a string. #12

Closed tttptd closed 7 years ago

tttptd commented 8 years ago
 TypeError: Error transforming [...]/public/components/util/util.js with 'commonjs' plugin: Path must be a string. Received [ 'public/components/util/util.js',
  'public/components/form/validator.js',
  'public/components/util/ajax.js',
  'public/site/scripts/services/router.js',
  'public/site/scripts/services/util.js',
  'public/site/scripts/services/form-validator.js',
  'public/site/scripts/services/form-ajax.js',
  'public/site/scripts/modules/page-module.js',
  'public/site/scripts/modules/form-module.js',
  'public/site/scripts/behaviour/page-modal.js',
  'public/site/scripts/behaviour/page-navigate.js',
  'public/site/scripts/app.js' ]
    at assertPath (path.js:7:11)
    at Object.resolve (path.js:1148:7)
    at defaultResolver ([...]/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.cjs.js:49:71)
    at [...]/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.cjs.js:519:15
    at process._tickCallback (internal/process/next_tick.js:103:7)
    at Module.runMain (module.js:577:11)
    at run (bootstrap_node.js:352:7)
    at startup (bootstrap_node.js:144:9)
    at bootstrap_node.js:467:3
  rollupTransform: true,
  id: '[...]/public/components/util/util.js',
  plugin: 'commonjs' }

Gulpfile:

    mix.rollup([
        '/components/util/util.js',
        '/components/form/validator.js',
        '/components/util/ajax.js',

        '/site/scripts/services/router.js',
        '/site/scripts/services/util.js',
        '/site/scripts/services/form-validator.js',
        '/site/scripts/services/form-ajax.js',

        '/site/scripts/modules/page-module.js',
        '/site/scripts/modules/form-module.js',

        '/site/scripts/behaviour/page-modal.js',
        '/site/scripts/behaviour/page-navigate.js',

        '/site/scripts/app.js',

    ], null, 'public');

I try to use two steps build:

mix.scripts([
        '/components/util/util.js',
        '/components/form/validator.js',
        '/components/util/ajax.js',

        '/site/scripts/services/router.js',
        '/site/scripts/services/util.js',
        '/site/scripts/services/form-validator.js',
        '/site/scripts/services/form-ajax.js',

        '/site/scripts/modules/page-module.js',
        '/site/scripts/modules/form-module.js',

        '/site/scripts/behaviour/page-modal.js',
        '/site/scripts/behaviour/page-navigate.js',

        '/site/scripts/app.js',

    ], 'public/bundle/all-es2015.js');

mix.rollup(
        'public/bundle/all-es2015.js',
        'public/bundle/all.js'
)

works fine, when i use gulp, but with --production it fails.

tttptd commented 8 years ago

I found #6, but error is still there. Maybe i do something wrong? laravel-elixir-rollup-official@1.1.0

rafapaulin commented 7 years ago

I am having the same issue as above.

mix.rollup([ '/components/util/util.js', '/components/form/validator.js', ]);

I need each file passed to process all its 'import' and compile into diferent files (on per entry).

I am doing this, now, calling .rollup() once for each entry, which results in a "Call max stack error" when using gulp watch.

any idea how to accomplish this?