Commit 0fc03e41 authored by Eduardo Sanz García's avatar Eduardo Sanz García Committed by Eduardo

Move babel.config.json to .babelrc

There are two other .babelrc in the project. I think it gives more
consistency and allows for comments.
parent 1dee188e
{
'use strict';
module.exports = {
"presets": [
[
"@babel/preset-react",
......@@ -28,6 +30,8 @@
{
"development": true,
"runtime": "automatic",
// Use `preact/compat/jsx-dev-runtime` which is an alias for `preact/jsx-runtime`.
// See https://github.com/preactjs/preact/issues/2974.
"importSource": "preact/compat"
}
]
......
'use strict';
const fs = require('fs');
const gulp = require('gulp');
const babel = require('gulp-babel');
const sourcemaps = require('gulp-sourcemaps');
......@@ -10,10 +8,8 @@ const { run } = require('./run');
const buildFrontendSharedJs = () => {
// There does not appear to be a simple way of forcing gulp-babel to use a config
// file. Load it up as JSON and pass it in manually.
const babelConfig = JSON.parse(
fs.readFileSync('./frontend-shared/babel.config.json')
);
// file. Load it up and pass it in manually.
const babelConfig = require('../../frontend-shared/.babelrc.cjs');
return (
gulp
......
......@@ -102,7 +102,7 @@ module.exports = function (config) {
// The existence of this preset option is due to a config issue with frontend-shared/
// where jsx modules are not transpiled to js.
// See https://github.com/hypothesis/client/issues/2929
presets: require('../frontend-shared/babel.config.json').presets,
presets: require('../frontend-shared/.babelrc.cjs').presets,
extensions: ['.js'],
plugins: [
'mockable-imports',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment