bankai: Babelify config for Browserify does not work with rc10

I use the following Browserify config:

"browserify": {
	"transform": [
		[
			"babelify",
			{
				"presets": [
					"env"
				]
			}
		]
	]
}

And Bankai can’t parse the import syntax:

Failed while processing 'scripts'.

 --> index.js:2:1
  |
2 | import { html, render } from 'lit-html';
  | ^ Syntax Error

Hmmm. We're having trouble parsing a file.

The necessary modules are installed.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (10 by maintainers)

Most upvoted comments

Works-a like-a deh charm-a! (Mario voice)

🙏 thanks y’allz are super.

We have tree shaking, bundle flattening, and soon code splitting too (in #266). Would we be missing anything? (:

Oh, well don’t mind me then, that sounds perfect 😄 .

Passing "global": true to the babelify transform options should also make it run globally, im 80% sure

On 14 November 2017 14:58:06 CET, Yoshua Wuyts notifications@github.com wrote:

Oh, no yeah think I figured it out — I think the transform needs to be global because lit-html uses the export keyword, and locally defined transforms don’t operate globally. Alright, let’s get Babel support into core! @kahlil any presets you generally use?

– You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/choojs/bankai/issues/329#issuecomment-344266769

– Sent from mobile. Please excuse my brevity.

Thanks Yosh.