mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 03:07:52 +01:00
* Specify exact versions in package.json * Bump @rails packages to 6.1.7-3 * Bump decode-uri-component from 0.2.0 to 0.2.2 (#176) Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2. - [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases) - [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2) --- updated-dependencies: - dependency-name: decode-uri-component dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump qs from 6.5.2 to 6.5.3 (#177) Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3. - [Release notes](https://github.com/ljharb/qs/releases) - [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md) - [Commits](https://github.com/ljharb/qs/compare/v6.5.2...v6.5.3) --- updated-dependencies: - dependency-name: qs dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump express from 4.17.1 to 4.18.2 (#178) Bumps [express](https://github.com/expressjs/express) from 4.17.1 to 4.18.2. - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](https://github.com/expressjs/express/compare/4.17.1...4.18.2) --- updated-dependencies: - dependency-name: express dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump json5 from 1.0.1 to 1.0.2 (#182) Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2. - [Release notes](https://github.com/json5/json5/releases) - [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md) - [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2) --- updated-dependencies: - dependency-name: json5 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump minimatch from 3.0.4 to 3.0.8 (#223) Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.0.8. - [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md) - [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.0.8) --- updated-dependencies: - dependency-name: minimatch dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @rails/webpacker to 5.1.0 * Fix translations import in application.js * Bump @rails/webpacker to 5.4.4 * Set some babel plugins loose=true to suppress warnings * Bump boostrap to 4.6.2 and popper.js to 1.16.1 * Fix CSS after bootstrap bump --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
105 lines
2.5 KiB
JavaScript
105 lines
2.5 KiB
JavaScript
module.exports = function(api) {
|
|
var validEnv = ['development', 'test', 'production']
|
|
var currentEnv = api.env()
|
|
var isDevelopmentEnv = api.env('development')
|
|
var isProductionEnv = api.env('production')
|
|
var isTestEnv = api.env('test')
|
|
|
|
if (!validEnv.includes(currentEnv)) {
|
|
throw new Error(
|
|
'Please specify a valid `NODE_ENV` or ' +
|
|
'`BABEL_ENV` environment variables. Valid values are "development", ' +
|
|
'"test", and "production". Instead, received: ' +
|
|
JSON.stringify(currentEnv) +
|
|
'.'
|
|
)
|
|
}
|
|
|
|
return {
|
|
presets: [
|
|
isTestEnv && [
|
|
require('@babel/preset-env').default,
|
|
{
|
|
targets: {
|
|
node: 'current'
|
|
}
|
|
}
|
|
],
|
|
(isProductionEnv || isDevelopmentEnv) && [
|
|
require('@babel/preset-env').default,
|
|
{
|
|
forceAllTransforms: true,
|
|
useBuiltIns: 'entry',
|
|
corejs: 3,
|
|
modules: false,
|
|
exclude: ['transform-typeof-symbol']
|
|
}
|
|
],
|
|
[
|
|
require('@babel/preset-react').default,
|
|
{
|
|
development: isDevelopmentEnv || isTestEnv,
|
|
useBuiltIns: true
|
|
}
|
|
],
|
|
[
|
|
'@babel/preset-typescript',
|
|
{
|
|
'allExtensions': true,
|
|
'isTSX': true
|
|
}
|
|
]
|
|
].filter(Boolean),
|
|
plugins: [
|
|
require('babel-plugin-macros'),
|
|
require('@babel/plugin-syntax-dynamic-import').default,
|
|
isTestEnv && require('babel-plugin-dynamic-import-node'),
|
|
require('@babel/plugin-transform-destructuring').default,
|
|
[
|
|
require('@babel/plugin-proposal-private-methods').default,
|
|
{
|
|
loose: true
|
|
}
|
|
],
|
|
[
|
|
require('@babel/plugin-proposal-private-property-in-object').default,
|
|
{
|
|
loose: true
|
|
}
|
|
],
|
|
[
|
|
require('@babel/plugin-proposal-class-properties').default,
|
|
{
|
|
loose: true
|
|
}
|
|
],
|
|
[
|
|
require('@babel/plugin-proposal-object-rest-spread').default,
|
|
{
|
|
useBuiltIns: true
|
|
}
|
|
],
|
|
[
|
|
require('@babel/plugin-transform-runtime').default,
|
|
{
|
|
helpers: false,
|
|
regenerator: true,
|
|
corejs: false
|
|
}
|
|
],
|
|
[
|
|
require('@babel/plugin-transform-regenerator').default,
|
|
{
|
|
async: false
|
|
}
|
|
],
|
|
isProductionEnv && [
|
|
require('babel-plugin-transform-react-remove-prop-types').default,
|
|
{
|
|
removeImport: true
|
|
}
|
|
]
|
|
].filter(Boolean)
|
|
}
|
|
}
|