Open ydnar opened 7 years ago
well I think it actually should set the target
to current
since it prevents from doing unnecessary transpiling during testing.
We need the target(s) preserved for integration tests, which run in both Node and the browser. Transpiling is necessary.
I'm not entirely sure so at least I think it's fine to allow overriding targets
in test
env. https://github.com/vuejs/babel-preset-vue-app/pull/13
Thanks!
We use AVA for testing our Vue app. Recently they released version 0.23 which sets
NODE_ENV=test
if not already set (see avajs/ava#1470 and avajs/ava#1523 for additional context).This change blew up our test builds. We traced it to this package (
babel-prest-vue-app
), which overrides targets ifNODE_ENV=test
, with no way to circumvent this via configuration. This breaks client-side code which is intended to run in a browser (we use Puppeteer to control chrome for integration tests).We’re currently using a workaround to explicitly set
process.env.BABEL_ENV = 'production'
before building. See example code below.Request: do not override targets if
NODE_ENV
==test
.