Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

Loading static files with __dirname and path.resolve fails #39

Closed
trieloff opened this issue Jun 25, 2019 · 3 comments · Fixed by #47
Closed

Loading static files with __dirname and path.resolve fails #39

trieloff opened this issue Jun 25, 2019 · 3 comments · Fixed by #47
Assignees
Labels
bug Something isn't working released

Comments

@trieloff
Copy link
Contributor

See adobe/helix-publish#118

This might be a fix, but I'm not sure about the side effects: https://codeburst.io/use-webpack-with-dirname-correctly-4cad3b265a92

@trieloff
Copy link
Contributor Author

See https://github.com/adobe/helix-publish/pull/119/files for the workaround I had to apply

@trieloff trieloff added the bug Something isn't working label Jun 25, 2019
@tripodsan
Copy link
Collaborator

I think the problem is that the path calculated in:

  const vclfile = path.resolve(__dirname, '../../layouts/fastly/helix.vcl');

becomes wrong, after the javascript is bundled

@tripodsan tripodsan self-assigned this Jul 18, 2019
adobe-bot pushed a commit that referenced this issue Jul 18, 2019
## [1.1.3](v1.1.2...v1.1.3) (2019-07-18)

### Bug Fixes

* **build:** instruct webpack to use correct __dirname ([#47](#47)) ([36d9242](36d9242)), closes [#39](#39)
@adobe-bot
Copy link

🎉 This issue has been resolved in version 1.1.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

trieloff pushed a commit that referenced this issue Dec 11, 2020
# 1.0.0 (2020-12-10)

### Bug Fixes

* **aws:** do not init when no region has been set ([fa50b3e](adobe/helix-deploy@fa50b3e))
* **build:** fix module resolution order (fixes [#84](adobe/helix-deploy#84)) ([#85](adobe/helix-deploy#85)) ([8390a95](adobe/helix-deploy@8390a95))
* **build:** instruct webpack to use correct __dirname ([#47](adobe/helix-deploy#47)) ([36d9242](adobe/helix-deploy@36d9242)), closes [#39](adobe/helix-deploy#39)
* **build:** only validate bundle if it's built (fixes [#77](adobe/helix-deploy#77)) ([#79](adobe/helix-deploy#79)) ([3c62bfd](adobe/helix-deploy@3c62bfd))
* **build:** write all output to stderr and generate JSON to stdout. ([#72](adobe/helix-deploy#72)) ([44694c7](adobe/helix-deploy@44694c7)), closes [#35](adobe/helix-deploy#35) [#71](adobe/helix-deploy#71)
* **builder:** add namespace to __OW_NAMESPACE ([3e21357](adobe/helix-deploy@3e21357))
* **builder:** add option to specify specify link package name ([#66](adobe/helix-deploy#66)) ([c0ae740](adobe/helix-deploy@c0ae740))
* **builder:** add support for static file renaming and directories. ([bce8f31](adobe/helix-deploy@bce8f31)), closes [#6](adobe/helix-deploy#6)
* **builder:** correct output on deploy ([#118](adobe/helix-deploy#118)) ([380ff1a](adobe/helix-deploy@380ff1a)), closes [#113](adobe/helix-deploy#113)
* **builder:** ensure non 0 exit code with failed tests (fixes [#74](adobe/helix-deploy#74)) ([c496487](adobe/helix-deploy@c496487))
* **builder:** fix error when linking with [@ci](https://github.com/ci) ([02a47a5](adobe/helix-deploy@02a47a5))
* **builder:** make updated-by optional ([#148](adobe/helix-deploy#148)) ([1f8d88a](adobe/helix-deploy@1f8d88a))
* **builder:** remove externals that are not really present ([61bbaa8](adobe/helix-deploy@61bbaa8))
* **builder:** set process.exitCode on failure ([35c7dbd](adobe/helix-deploy@35c7dbd)), closes [#34](adobe/helix-deploy#34)
* **builder:** signal error during sequence updates ([d239066](adobe/helix-deploy@d239066)), closes [#53](adobe/helix-deploy#53)
* **cli:** correct usage of yargs ([53195be](adobe/helix-deploy@53195be))
* **cli:** default to nodejs:10 container ([19a0c3d](adobe/helix-deploy@19a0c3d)), closes [#18](adobe/helix-deploy#18)
* **cli:** prefer process.env over .wskprops ([#46](adobe/helix-deploy#46)) ([c9eb849](adobe/helix-deploy@c9eb849)), closes [#42](adobe/helix-deploy#42)
* **dep:** update dependencies ([53878a0](adobe/helix-deploy@53878a0))
* **deploy:** force deployment as raw web action in openwhisk ([a6db7a6](adobe/helix-deploy@a6db7a6))
* **deploy:** report correct action package ([999af39](adobe/helix-deploy@999af39)), closes [#109](adobe/helix-deploy#109)
* **deps:** re-add missing semantic release plugin ([e536056](adobe/helix-deploy@e536056))
* **deps:** update dependency chalk to v4 ([#130](adobe/helix-deploy#130)) ([33cb7d0](adobe/helix-deploy@33cb7d0))
* **deps:** update dependency fs-extra to v9 ([#127](adobe/helix-deploy#127)) ([e430bb1](adobe/helix-deploy@e430bb1))
* **deps:** update dependency isomorphic-git to v1.7.1 ([#161](adobe/helix-deploy#161)) ([a593bc8](adobe/helix-deploy@a593bc8))
* **deps:** update dependency semver to v7 ([#88](adobe/helix-deploy#88)) ([04a44e1](adobe/helix-deploy@04a44e1))
* **deps:** update dependency yargs to v16 ([#177](adobe/helix-deploy#177)) ([5a9d53b](adobe/helix-deploy@5a9d53b))
* **deps:** update external ([#140](adobe/helix-deploy#140)) ([b592138](adobe/helix-deploy@b592138))
* **deps:** update external ([#165](adobe/helix-deploy#165)) ([77ea925](adobe/helix-deploy@77ea925))
* **deps:** update external ([#178](adobe/helix-deploy#178)) ([45a6f78](adobe/helix-deploy@45a6f78))
* **deps:** update external ([#81](adobe/helix-deploy#81)) ([5813343](adobe/helix-deploy@5813343))
* **empty:** trigger release ([973f042](adobe/helix-deploy@973f042))
* **express:** ensure req.body is a string ([c40897a](adobe/helix-deploy@c40897a)), closes [#15](adobe/helix-deploy#15)
* **expressify:** fallback to application/octet-stream if no content-type provided ([8d69dcc](adobe/helix-deploy@8d69dcc))
* **expressify:** send body as raw data ([#17](adobe/helix-deploy#17)) ([157e88c](adobe/helix-deploy@157e88c)), closes [#16](adobe/helix-deploy#16)
* **external:** declare all openwhisk files as external ([2271598](adobe/helix-deploy@2271598)), closes [#54](adobe/helix-deploy#54)
* **link:** annotations in sequences are not updated correctly ([#144](adobe/helix-deploy#144)) ([fec7f7e](adobe/helix-deploy@fec7f7e))
* **logging:** move log helpers to own export ([#12](adobe/helix-deploy#12)) ([01a44b4](adobe/helix-deploy@01a44b4))
* **openwhisk:** fix wrapper entry point ([12b7120](adobe/helix-deploy@12b7120))
* **package:** update fs-extra to version 8.0.0 ([fd2869d](adobe/helix-deploy@fd2869d))
* **params:** ignore WSK_xxx in params ([#110](adobe/helix-deploy#110)) ([f543aeb](adobe/helix-deploy@f543aeb))
* **server:** dev-params should win over package params ([#189](adobe/helix-deploy#189)) ([53c8afb](adobe/helix-deploy@53c8afb)), closes [#188](adobe/helix-deploy#188)

### Code Refactoring

* **lib:** extract helper to own package ([#60](adobe/helix-deploy#60)) ([de04fcd](adobe/helix-deploy@de04fcd))
* **project:** rename to helix-deploy/`hedy` ([d8d503a](adobe/helix-deploy@d8d503a))

### Features

* **api:** add new expressify helper to support serverless-http ([#14](adobe/helix-deploy#14)) ([50dbae3](adobe/helix-deploy@50dbae3)), closes [#13](adobe/helix-deploy#13)
* **archive:** add multicloud wrapper to archive ([bb3d4b0](adobe/helix-deploy@bb3d4b0))
* **aws:** add AWS deployer ([717a095](adobe/helix-deploy@717a095))
* **aws:** create api gateway with integration, routes and permissions ([9fd6b3b](adobe/helix-deploy@9fd6b3b))
* **aws:** deploy to lambda and create version tags ([2686c41](adobe/helix-deploy@2686c41))
* **aws:** upload file to temporary s3 bucket ([b845f90](adobe/helix-deploy@b845f90))
* **builder:** add --test-params for testing wsk actions ([b805047](adobe/helix-deploy@b805047)), closes [#102](https://github.com/adobe/helix-deploy/issues/102)
* **builder:** add option to generate link to [@ci](https://github.com/ci) ([#56](adobe/helix-deploy#56)) ([8d1ae73](adobe/helix-deploy@8d1ae73))
* **builder:** add options for --web-secure ([#65](adobe/helix-deploy#65)) ([dba7639](adobe/helix-deploy@dba7639))
* **builder:** add possibility to specify test url ([e450a85](adobe/helix-deploy@e450a85)), closes [#51](adobe/helix-deploy#51)
* **builder:** add timestamp and delete command ([d3ed7ec](adobe/helix-deploy@d3ed7ec)), closes [#145](adobe/helix-deploy#145) [#138](adobe/helix-deploy#138)
* **builder:** allow extension of webpack config ([0e03766](adobe/helix-deploy@0e03766)), closes [#30](adobe/helix-deploy#30)
* **builder:** create option to create symlinks ([fbf37e4](adobe/helix-deploy@fbf37e4)), closes [#48](adobe/helix-deploy#48)
* **builder:** display nicer error message if openwhisk creds are missing ([2a2ef39](adobe/helix-deploy@2a2ef39)), closes [#103](adobe/helix-deploy#103)
* **builder:** don't restict links (fixes [#73](adobe/helix-deploy#73)) ([06c8f53](adobe/helix-deploy@06c8f53))
* **builder:** ensure that web-secure works correctly ([#125](adobe/helix-deploy#125)) ([17f9530](adobe/helix-deploy@17f9530)), closes [#124](adobe/helix-deploy#124)
* **builder:** record dependencies as annotations ([#131](adobe/helix-deploy#131)) ([01e3527](adobe/helix-deploy@01e3527)), closes [#121](adobe/helix-deploy#121)
* **builder:** Support WSK_CONFIG_FILE environment variable ([#92](adobe/helix-deploy#92)) ([629e09f](adobe/helix-deploy@629e09f))
* **builder:** use helix-fetch instead of request ([#158](adobe/helix-deploy#158)) ([b94ef77](adobe/helix-deploy@b94ef77)), closes [#157](adobe/helix-deploy#157)
* **builder:** use version from package json in action name ([3717eca](adobe/helix-deploy@3717eca)), closes [#49](https://github.com/adobe/helix-deploy/issues/49)
* **builder:** validate bundle before deploying (fixes [#76](adobe/helix-deploy#76)) ([a049536](adobe/helix-deploy@a049536))
* **cli:** add default externals for node:10 container ([#28](adobe/helix-deploy#28)) ([28daad1](adobe/helix-deploy@28daad1)), closes [#27](adobe/helix-deploy#27)
* **cli:** add support for --memory and --concurrency ([#171](adobe/helix-deploy#171)) ([4a1314e](adobe/helix-deploy@4a1314e))
* **cli:** allow to create or update openwhisk package ([721b590](adobe/helix-deploy@721b590)), closes [#23](adobe/helix-deploy#23)
* **cli:** bundled package.json should have version set to host package version ([dccaf27](adobe/helix-deploy@dccaf27)), closes [#5](adobe/helix-deploy#5)
* **cli:** package parameter-file should only be required on package … ([#185](adobe/helix-deploy#185)) ([14e7d43](adobe/helix-deploy@14e7d43)), closes [#184](adobe/helix-deploy#184)
* **config:** support to specify file content in env variables ([#25](adobe/helix-deploy#25)) ([e47f0e2](adobe/helix-deploy@e47f0e2)), closes [#22](adobe/helix-deploy#22)
* **deploy:** provide security measure to prevent deployment to wrong namespace ([ed47697](adobe/helix-deploy@ed47697)), closes [#93](adobe/helix-deploy#93)
* **deps:** improve dependency resolution ([#135](adobe/helix-deploy#135)) ([a74e079](adobe/helix-deploy@a74e079)), closes [#134](adobe/helix-deploy#134)
* **dev:** implement development server fixes [#96](adobe/helix-deploy#96) ([#97](adobe/helix-deploy#97)) ([c9df2c0](adobe/helix-deploy@c9df2c0))
* **expressify:** set isBase64Encoded flag correctly to ensure proper decoding ([e555c6e](adobe/helix-deploy@e555c6e))
* **logging:** Adding logging helpers ([#11](adobe/helix-deploy#11)) ([c1e5d50](adobe/helix-deploy@c1e5d50)), closes [#9](adobe/helix-deploy#9)
* **multicloud:** add wrapper template ([745cc2e](adobe/helix-deploy@745cc2e))
* **openwhisk:** add new `--timeout` limit option ([936880d](adobe/helix-deploy@936880d)), closes [#37](adobe/helix-deploy#37)
* **params:** add support for nested action and package params ([#68](adobe/helix-deploy#68)) ([3d0619b](adobe/helix-deploy@3d0619b)), closes [#67](adobe/helix-deploy#67)
* **server:** add dev-params-file support ([b5ba20c](adobe/helix-deploy@b5ba20c))

### BREAKING CHANGES

* **project:** new expanded scope for the project, this is now multi-cloud. The legacy version can still be found here: https://github.com/adobe/openwhisk-action-builder
* **deploy:** The options `--web-export` and `--raw-http` have been removed as all actions will now be deployed to OpenWhisk as raw web actions
* **lib:** logging and expressify are no longer exported by this package. use @adobe/openwhisk-action-utils instead.
* **expressify:** the __ow_body doesn't need to be decoded manually anymore
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants