-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6e7a18
commit 414aa31
Showing
12 changed files
with
87 additions
and
26 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { UserConfig } from 'vite'; | ||
export declare const config: UserConfig; | ||
declare const _default: UserConfig; | ||
export default _default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { | ||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { | ||
if (ar || !(i in from)) { | ||
if (!ar) ar = Array.prototype.slice.call(from, 0, i); | ||
ar[i] = from[i]; | ||
} | ||
} | ||
return to.concat(ar || Array.prototype.slice.call(from)); | ||
}; | ||
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin'; | ||
import react from '@vitejs/plugin-react-swc'; | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
import { defineConfig } from 'vite'; | ||
/** | ||
* Get list of monorepo packages from package.json non-dev-dependencies | ||
* @returns {string[]} - list of package names | ||
*/ | ||
function getMonorepoPackagesFromPackageJson() { | ||
var packageJson = fs.readFileSync(path.resolve(__dirname, './package.json'), 'utf-8'); | ||
var dependencies = JSON.parse(packageJson).dependencies; | ||
var packages = Object.keys(dependencies).filter(function (key) { | ||
return dependencies[key].startsWith('workspace:'); | ||
}); | ||
return packages; | ||
} | ||
var monorepoPackages = getMonorepoPackagesFromPackageJson(); | ||
monorepoPackages.push('@kadena/client-utils'); | ||
monorepoPackages.push('@kadena/cryptography-utils'); | ||
monorepoPackages.push('@kadena/pactjs'); | ||
monorepoPackages.push('@kadena/wallet-sdk'); | ||
var monorepoPathsRegex = monorepoPackages.map(function (pkg) { return new RegExp("".concat(pkg.replace('@kadena/', ''))); }); | ||
monorepoPackages.push('@kadena/client/fp'); | ||
export var config = { | ||
plugins: [vanillaExtractPlugin(), react()], | ||
optimizeDeps: { | ||
// add all monorepo packages to optimizeDeps since they are commonjs | ||
include: __spreadArray([], monorepoPackages, true), | ||
}, | ||
build: { | ||
commonjsOptions: { | ||
// add all monorepo packages path regex to commonjsOptions since they are commonjs | ||
include: __spreadArray([/node_modules/], monorepoPathsRegex, true), | ||
}, | ||
}, | ||
}; | ||
export default defineConfig(config); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters