mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
chore(build): enable support for ts declare fields
This commit is contained in:
committed by
ErickSkrauch
parent
f7b0c10ba9
commit
79ff3b9410
@@ -21,6 +21,7 @@ const wp = require('@cypress/webpack-preprocessor');
|
||||
|
||||
// for some reason loader can not locate babel.config. So we load it manually
|
||||
const config = require('../../../babel.config');
|
||||
const babelEnvName = 'browser-development';
|
||||
|
||||
module.exports = (on) => {
|
||||
const options = {
|
||||
@@ -39,14 +40,31 @@ module.exports = (on) => {
|
||||
{
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
envName: 'webpack',
|
||||
envName: babelEnvName,
|
||||
cacheDirectory: true,
|
||||
// We don't have the webpack's API object, so just provide necessary methods
|
||||
...config({
|
||||
env() {
|
||||
return 'development';
|
||||
env(value) {
|
||||
// see @babel/core/lib/config/helpers/config-api.js
|
||||
switch (typeof value) {
|
||||
case 'string':
|
||||
return value === babelEnvName;
|
||||
case 'function':
|
||||
return value(babelEnvName);
|
||||
|
||||
case 'undefined':
|
||||
return babelEnvName;
|
||||
default:
|
||||
if (Array.isArray(value)) {
|
||||
throw new Error('Unimplemented env() argument');
|
||||
}
|
||||
|
||||
throw new Error('Invalid env() argument');
|
||||
}
|
||||
},
|
||||
cache: {
|
||||
using() {},
|
||||
},
|
||||
cache() {},
|
||||
}),
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user