Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sprucelabs/babel-plugin-schema

Package Overview
Dependencies
Maintainers
3
Versions
232
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sprucelabs/babel-plugin-schema

Builds @sprucelabs/schema and generates static paths to #spruce directories.

  • 4.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
28
increased by55.56%
Maintainers
3
Weekly downloads
 
Created
Source

babel-plugin-schema

This module ships with 2 components:

  1. When used with babel in a monorepo, it copies the @sprucelabs/spruce-schema module to the node_modules of the packages that need it so each project can utilize it's local path aliases.
  2. A resolve-path-aliases command that can resolve path aliases configured in your projects tsconfig.json.

Installing

yarn add @sprucelabs/babel-plugin-schema

Adding to Babel config in monorepo

Add @sprucelabs/babel-plugin-schema with the options exactly as is:

[
	"@sprucelabs/babel-plugin-schema",
	{ cwd: __dirname, destination: process.env.PWD },
];

Babel config example

module.exports = (api) => {
	api.cache(true);
	return {
		sourceMaps: true,
		presets: ["@babel/preset-env", "@babel/preset-typescript"],
		plugins: [
			[
				"@sprucelabs/babel-plugin-schema",
				{
					cwd: __dirname,
					destination: process.env.PWD,
				},
			],
			"@babel/plugin-transform-runtime",
			[
				"@babel/plugin-proposal-decorators",
				{
					legacy: true,
				},
			],
			["@babel/plugin-proposal-class-properties", { loose: true }],
			[
				"module-resolver",
				{
					root: ["./"],
					alias: {
						"#spruce": "./src/.spruce",
					},
				},
			],
		],
	};
};

Resolving path aliases

FAQs

Package last updated on 30 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc