JeffreyWay / laravel-elixir-webpack-official

88 stars 28 forks source link

Can't run "gulp --production" when bundling webpacked module #25

Closed talvbansal closed 8 years ago

talvbansal commented 8 years ago

I'm trying to use webpack to bundle a project that has already been "webpacked" along with my additional assets, with Vue 1.x projects this would work fine however since upgrading to Vue 2.x i get the following error ONLY when running gulp --production:

{ [Error: ./vendor/talvbansal/media-manager/public/js/media-manager.js
Module build failed: SyntaxError: 'with' in strict mode (10:30224)
    at Parser.pp$4.raise (/home/talv/Projects/sso/node_modules/acorn/dist/acorn.js:2221:15)
    at Parser.pp$1.parseWithStatement (/home/talv/Projects/sso/node_modules/acorn/dist/acorn.js:932:27)
    at Parser.pp$1.parseStatement (/home/talv/Projects/sso/node_modules/acorn/dist/acorn.js:708:32)
    at Parser.pp$1.parseBlock (/home/talv/Projects/sso/node_modules/acorn/dist/acorn.js:981:25)
    at Parser.pp$3.parseFunctionBody (/home/talv/Projects/sso/node_modules/acorn/dist/acorn.js:2105:24)
    at Parser.pp$1.parseFunction (/home/talv/Projects/sso/node_modules/acorn/dist/acorn.js:1065:10)
    at Parser.pp$3.parseExprAtom (/home/talv/Projects/sso/node_modules/acorn/dist/acorn.js:1810:19)
    at Parser.parseExprAtom (/home/talv/Projects/sso/node_modules/buble/dist/buble.umd.js:656:26)
    at Parser.pp$3.parseExprSubscripts (/home/talv/Projects/sso/node_modules/acorn/dist/acorn.js:1715:21)
    at Parser.pp$3.parseMaybeUnary (/home/talv/Projects/sso/node_modules/acorn/dist/acorn.js:1692:19)
 @ ./resources/assets/js/admin.js 4:0-77]
  message: './vendor/talvbansal/media-manager/public/js/media-manager.js\nModule build failed: SyntaxError: \'with\' in strict mode (10:30224)\n    at Parser.pp$4.raise (/home/talv/Projects/sso/node_modules/acorn/dist/acorn.js:2221:15)\n    at Parser.pp$1.parseWithStatement (/home/talv/Projects/sso/node_modules/acorn/dist/acorn.js:932:27)\n    at Parser.pp$1.parseStatement (/home/talv/Projects/sso/node_modules/acorn/dist/acorn.js:708:32)\n    at Parser.pp$1.parseBlock (/home/talv/Projects/sso/node_modules/acorn/dist/acorn.js:981:25)\n    at Parser.pp$3.parseFunctionBody (/home/talv/Projects/sso/node_modules/acorn/dist/acorn.js:2105:24)\n    at Parser.pp$1.parseFunction (/home/talv/Projects/sso/node_modules/acorn/dist/acorn.js:1065:10)\n    at Parser.pp$3.parseExprAtom (/home/talv/Projects/sso/node_modules/acorn/dist/acorn.js:1810:19)\n    at Parser.parseExprAtom (/home/talv/Projects/sso/node_modules/buble/dist/buble.umd.js:656:26)\n    at Parser.pp$3.parseExprSubscripts (/home/talv/Projects/sso/node_modules/acorn/dist/acorn.js:1715:21)\n    at Parser.pp$3.parseMaybeUnary (/home/talv/Projects/sso/node_modules/acorn/dist/acorn.js:1692:19)\n @ ./resources/assets/js/admin.js 4:0-77',
  showStack: false,
  showProperties: true,
  plugin: 'webpack-stream',
  __safety: { toString: [Function: bound ] } }

I've tried to isolate this as much as possible so ./resources/assets/js/admin.js referenced above only contains the following:

require('./../../../vendor/talvbansal/media-manager/public/js/media-manager');

Which is a valid path and the media-manager.js file does exist.

Any ideas at all what this might be? Running gulp by itself works fine however generates a huge file that isn't realistic to push out.