{"version":3,"file":"pre-offline.cjs","names":[],"sources":["../../src/pre-offline.ts"],"sourcesContent":["import { relative } from 'path';\nimport { assocPath } from 'ramda';\nimport { assertIsString } from './helper';\n\nimport type SwcServerlessPlugin from './index';\n\nexport function preOffline(this: SwcServerlessPlugin) {\n  assertIsString(this.buildDirPath);\n\n  // Set offline location automatically if not set manually\n  if (!this.serverless?.service?.custom?.['serverless-offline']?.location) {\n    const newServerless = assocPath(\n      ['service', 'custom', 'serverless-offline', 'location'],\n      relative(this.serviceDirPath, this.buildDirPath),\n      this.serverless\n    );\n\n    this.serverless.service.custom = newServerless.service.custom;\n  }\n}\n"],"mappings":";;;;;;;AAMA,SAAgB,aAAsC;AACpD,+BAAe,KAAK,aAAa;AAGjC,KAAI,CAAC,KAAK,YAAY,SAAS,SAAS,uBAAuB,UAAU;EACvE,MAAM,qCACJ;GAAC;GAAW;GAAU;GAAsB;GAAW,qBAC9C,KAAK,gBAAgB,KAAK,aAAa,EAChD,KAAK,WACN;AAED,OAAK,WAAW,QAAQ,SAAS,cAAc,QAAQ;;;;6BAfjB"}