Skip to content

Commit

Permalink
copy jsx files and fix replacements of all exports (not just the firs…
Browse files Browse the repository at this point in the history
…t line )
  • Loading branch information
petersalomonsen committed Feb 10, 2024
1 parent 27b6ac6 commit aea88da
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from "fs";
import replaceInFiles from "replace-in-files";

const transpiledPathPrefix = ".bos/transpiled/src/npm_package_name";
const transpiledPathPrefix = ".bos/transpiled/src/neardevhub-trustees";

async function build() {
await replaceInFiles({
Expand All @@ -13,7 +13,7 @@ async function build() {

await replaceInFiles({
files: [`${transpiledPathPrefix}/**/*.jsx`],
from: /^export /,
from: /^export /gms,
// NOTE: Empty string is ignored, so we use a function workaround it
to: () => "",
});
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"fmt:check": "prettier --check '**/*.{js,jsx,ts,tsx,json}'",
"lint": "tsc --pretty --noEmit && eslint .",
"dev": "~/.cargo/bin/bos-loader dashboard.treasury-devdao.near --path ./.bos/transpiled/src",
"build": "npm run fmt && rimraf .bos/transpiled && mkdir -p .bos/transpiled/src && sucrase ./src -d .bos/transpiled/src/npm_package_name --transforms typescript,jsx --jsx-runtime preserve --disable-es-transforms --out-extension jsx && node ./build.js",
"build": "npm run fmt && rimraf .bos/transpiled && mkdir -p .bos/transpiled/src && sucrase ./src -d .bos/transpiled/src/neardevhub-trustees --transforms typescript,jsx --jsx-runtime preserve --disable-es-transforms --out-extension jsx && sucrase ./src -d .bos/transpiled/src/neardevhub-trustees --transforms jsx --jsx-runtime preserve --disable-es-transforms --out-extension jsx && node ./build.js",
"deploy": "npm run build && cd .bos/transpiled && bos components deploy",
"prepare": "husky install",
"gateway": "node scripts/dev-gateway.js",
Expand Down

0 comments on commit aea88da

Please sign in to comment.