fix: server jsx

This commit is contained in:
cha0s 2021-03-23 16:05:39 -05:00
parent a72ee63045
commit 0c9111ff3a
4 changed files with 91 additions and 10 deletions

View File

@ -27,6 +27,7 @@
"@babel/plugin-proposal-optional-chaining": "^7.12.16",
"@babel/plugin-proposal-private-methods": "^7.12.13",
"@babel/plugin-syntax-jsx": "^7.12.13",
"@babel/preset-react": "^7.12.13",
"@neutrinojs/airbnb": "^9.4.0",
"@neutrinojs/banner": "^9.4.0",
"@neutrinojs/copy": "^9.4.0",

View File

@ -16,7 +16,17 @@ module.exports = (api) => {
},
],
];
const presets = [
[
'@babel/preset-react',
{
development: process.env.NODE_ENV !== 'production',
useSpread: true,
},
],
];
return {
plugins,
presets,
};
};

View File

@ -48,6 +48,13 @@
jsesc "^2.5.1"
source-map "^0.5.0"
"@babel/helper-annotate-as-pure@^7.10.4", "@babel/helper-annotate-as-pure@^7.12.13":
version "7.12.13"
resolved "http://npm.cha0sdev/@babel%2fhelper-annotate-as-pure/-/helper-annotate-as-pure-7.12.13.tgz#0f58e86dfc4bb3b1fcd7db806570e177d439b6ab"
integrity sha512-7YXfX5wQ5aYM/BOlbSccHDbuXXFPxeoUmfWtz8le2yTkTZc+BxsiEnENFoi2SlmA8ewDkG2LgIMIVzzn2h8kfw==
dependencies:
"@babel/types" "^7.12.13"
"@babel/helper-create-class-features-plugin@^7.12.13":
version "7.12.16"
resolved "http://npm.cha0sdev/@babel%2fhelper-create-class-features-plugin/-/helper-create-class-features-plugin-7.12.16.tgz#955d5099fd093e5afb05542190f8022105082c61"
@ -89,6 +96,13 @@
dependencies:
"@babel/types" "^7.12.13"
"@babel/helper-module-imports@^7.13.12":
version "7.13.12"
resolved "http://npm.cha0sdev/@babel%2fhelper-module-imports/-/helper-module-imports-7.13.12.tgz#c6a369a6f3621cb25da014078684da9196b61977"
integrity sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==
dependencies:
"@babel/types" "^7.13.12"
"@babel/helper-module-transforms@^7.12.13":
version "7.12.13"
resolved "http://npm.cha0sdev/@babel%2fhelper-module-transforms/-/helper-module-transforms-7.12.13.tgz#01afb052dcad2044289b7b20beb3fa8bd0265bea"
@ -111,6 +125,11 @@
dependencies:
"@babel/types" "^7.12.13"
"@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.13.0":
version "7.13.0"
resolved "http://npm.cha0sdev/@babel%2fhelper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz#806526ce125aed03373bc416a828321e3a6a33af"
integrity sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==
"@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.8.0":
version "7.12.13"
resolved "http://npm.cha0sdev/@babel%2fhelper-plugin-utils/-/helper-plugin-utils-7.12.13.tgz#174254d0f2424d8aefb4dd48057511247b0a9eeb"
@ -224,6 +243,50 @@
"@babel/helper-simple-access" "^7.12.13"
babel-plugin-dynamic-import-node "^2.3.3"
"@babel/plugin-transform-react-display-name@^7.12.13":
version "7.12.13"
resolved "http://npm.cha0sdev/@babel%2fplugin-transform-react-display-name/-/plugin-transform-react-display-name-7.12.13.tgz#c28effd771b276f4647411c9733dbb2d2da954bd"
integrity sha512-MprESJzI9O5VnJZrL7gg1MpdqmiFcUv41Jc7SahxYsNP2kDkFqClxxTZq+1Qv4AFCamm+GXMRDQINNn+qrxmiA==
dependencies:
"@babel/helper-plugin-utils" "^7.12.13"
"@babel/plugin-transform-react-jsx-development@^7.12.12":
version "7.12.17"
resolved "http://npm.cha0sdev/@babel%2fplugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.12.17.tgz#f510c0fa7cd7234153539f9a362ced41a5ca1447"
integrity sha512-BPjYV86SVuOaudFhsJR1zjgxxOhJDt6JHNoD48DxWEIxUCAMjV1ys6DYw4SDYZh0b1QsS2vfIA9t/ZsQGsDOUQ==
dependencies:
"@babel/plugin-transform-react-jsx" "^7.12.17"
"@babel/plugin-transform-react-jsx@^7.12.13", "@babel/plugin-transform-react-jsx@^7.12.17":
version "7.13.12"
resolved "http://npm.cha0sdev/@babel%2fplugin-transform-react-jsx/-/plugin-transform-react-jsx-7.13.12.tgz#1df5dfaf0f4b784b43e96da6f28d630e775f68b3"
integrity sha512-jcEI2UqIcpCqB5U5DRxIl0tQEProI2gcu+g8VTIqxLO5Iidojb4d77q+fwGseCvd8af/lJ9masp4QWzBXFE2xA==
dependencies:
"@babel/helper-annotate-as-pure" "^7.12.13"
"@babel/helper-module-imports" "^7.13.12"
"@babel/helper-plugin-utils" "^7.13.0"
"@babel/plugin-syntax-jsx" "^7.12.13"
"@babel/types" "^7.13.12"
"@babel/plugin-transform-react-pure-annotations@^7.12.1":
version "7.12.1"
resolved "http://npm.cha0sdev/@babel%2fplugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.12.1.tgz#05d46f0ab4d1339ac59adf20a1462c91b37a1a42"
integrity sha512-RqeaHiwZtphSIUZ5I85PEH19LOSzxfuEazoY7/pWASCAIBuATQzpSVD+eT6MebeeZT2F4eSL0u4vw6n4Nm0Mjg==
dependencies:
"@babel/helper-annotate-as-pure" "^7.10.4"
"@babel/helper-plugin-utils" "^7.10.4"
"@babel/preset-react@^7.12.13":
version "7.12.13"
resolved "http://npm.cha0sdev/@babel%2fpreset-react/-/preset-react-7.12.13.tgz#5f911b2eb24277fa686820d5bd81cad9a0602a0a"
integrity sha512-TYM0V9z6Abb6dj1K7i5NrEhA13oS5ujUYQYDfqIBXYHOc2c2VkFgc+q9kyssIyUfy4/hEwqrgSlJ/Qgv8zJLsA==
dependencies:
"@babel/helper-plugin-utils" "^7.12.13"
"@babel/plugin-transform-react-display-name" "^7.12.13"
"@babel/plugin-transform-react-jsx" "^7.12.13"
"@babel/plugin-transform-react-jsx-development" "^7.12.12"
"@babel/plugin-transform-react-pure-annotations" "^7.12.1"
"@babel/register@^7.12.10":
version "7.12.10"
resolved "http://npm.cha0sdev/@babel%2fregister/-/register-7.12.10.tgz#19b87143f17128af4dbe7af54c735663b3999f60"
@ -283,6 +346,15 @@
lodash "^4.17.19"
to-fast-properties "^2.0.0"
"@babel/types@^7.13.12":
version "7.13.12"
resolved "http://npm.cha0sdev/@babel%2ftypes/-/types-7.13.12.tgz#edbf99208ef48852acdff1c8a681a1e4ade580cd"
integrity sha512-K4nY2xFN4QMvQwkQ+zmBDp6ANMbVNw6BbxWmYA4qNjhR9W+Lj/8ky5MEY2Me5r+B2c6/v6F53oMndG+f9s3IiA==
dependencies:
"@babel/helper-validator-identifier" "^7.12.11"
lodash "^4.17.19"
to-fast-properties "^2.0.0"
"@neutrinojs/airbnb@^9.4.0":
version "9.5.0"
resolved "http://npm.cha0sdev/@neutrinojs%2fairbnb/-/airbnb-9.5.0.tgz#87cfc09c4237a2da632c80d7b91ad447a5e0b3f2"

View File

@ -61,6 +61,14 @@ export default (latus) => (neutrino) => {
latus.get(path),
]),
);
const babelOptions = neutrino.config.module
.rules.store.get('compile')
.uses.store.get('babel')
.store.get('options');
R('@babel/register')({
plugins: babelOptions.plugins,
presets: babelOptions.presets,
});
const paths = Object.keys(config)
.map((path) => Latus.runtimePath(path))
.filter((path) => !!path);
@ -91,16 +99,6 @@ export default (latus) => (neutrino) => {
.options({
source: source.join('\n'),
});
// const entries = Array.from(
// neutrino.config
// .entryPoints.store.get('index')
// .store
// );
// eslint-disable-next-line no-param-reassign
// neutrino.options.mains.index.entry = '@latus/core/start';
// neutrino.config
// .entry('index')
// .add('@latus/core/start');
const mocha = R('@neutrinojs/mocha');
mocha()(neutrino);
if (process.env.LATUS_LINTING) {