mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
dont use @swc/helpers in the server context as node support already modern syntax
This commit is contained in:
@@ -118,6 +118,7 @@ export default function (inMeteor = {}, argv = {}) {
|
||||
const isDev = !!Meteor.isDevelopment || !isProd;
|
||||
const isTest = !!Meteor.isTest;
|
||||
const isClient = !!Meteor.isClient;
|
||||
const isServer = !!Meteor.isServer;
|
||||
const isRun = !!Meteor.isRun;
|
||||
const isReactEnabled = !!Meteor.isReactEnabled;
|
||||
const isTestModule = !!Meteor.isTestModule;
|
||||
@@ -203,12 +204,13 @@ export default function (inMeteor = {}, argv = {}) {
|
||||
console.log('[i] Meteor flags:', Meteor);
|
||||
}
|
||||
|
||||
const enableSwcExternalHelpers = !isServer && swcExternalHelpers;
|
||||
const isDevEnvironment = isRun && isDev && !isTest && !isNative;
|
||||
const swcConfigRule = createSwcConfig({
|
||||
isTypescriptEnabled,
|
||||
isJsxEnabled,
|
||||
isTsxEnabled,
|
||||
externalHelpers: swcExternalHelpers,
|
||||
externalHelpers: enableSwcExternalHelpers,
|
||||
isDevEnvironment,
|
||||
});
|
||||
// Expose swc config to use in custom configs
|
||||
|
||||
@@ -281,7 +281,8 @@ BCp.processOneFileForTarget = function (inputFile, source) {
|
||||
const features = Object.assign({}, this.extraFeatures);
|
||||
const arch = inputFile.getArch();
|
||||
|
||||
if (arch.startsWith("os.")) {
|
||||
const isNodeTarget = arch.startsWith("os.");
|
||||
if (isNodeTarget) {
|
||||
// Start with a much simpler set of Babel presets and plugins if
|
||||
// we're compiling for Node 8.
|
||||
features.nodeMajorVersion = parseInt(process.versions.node, 10);
|
||||
@@ -355,6 +356,7 @@ BCp.processOneFileForTarget = function (inputFile, source) {
|
||||
tsx: hasTSXSupport,
|
||||
},
|
||||
...(hasSwcHelpersAvailable &&
|
||||
!isNodeTarget &&
|
||||
(packageName == null ||
|
||||
!['modules-runtime'].includes(packageName)) && {
|
||||
externalHelpers: true,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"visualize": "meteor --production --extra-packages bundle-visualizer"
|
||||
},
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.879.0",
|
||||
"@babel/runtime": "^7.23.5",
|
||||
"@modelcontextprotocol/sdk": "^1.17.3",
|
||||
"@swc/helpers": "^0.5.17",
|
||||
|
||||
@@ -4,8 +4,10 @@ import { LinksCollection } from '/imports/api/links';
|
||||
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
||||
import '@helper/alias';
|
||||
import ReactAlias from '@react/alias';
|
||||
import { S3Client } from '@aws-sdk/client-s3';
|
||||
|
||||
console.log('@react/alias loaded', ReactAlias.version);
|
||||
console.log('S3client loaded', !!S3Client);
|
||||
|
||||
async function insertLink({ title, url }) {
|
||||
await LinksCollection.insertAsync({ title, url, createdAt: new Date() });
|
||||
|
||||
Reference in New Issue
Block a user