-
Notifications
You must be signed in to change notification settings - Fork 62
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
45e2a6b
commit 209ab7c
Showing
17 changed files
with
430 additions
and
21 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
apps/website/docs/react/ahead-of-time-compilation/with-vite.md
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,41 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
|
||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
# With Webpack | ||
|
||
## Install | ||
|
||
<Tabs> | ||
<TabItem value="yarn" label="Yarn"> | ||
|
||
```shell | ||
yarn add --dev @griffel/tag-processor @griffel/vite-plugin | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="npm" label="NPM"> | ||
|
||
```shell | ||
npm install --save-dev @griffel/tag-processor @griffel/vite-plugin | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
## Usage | ||
|
||
After installation, add the plugin to your `vite.config.js`: | ||
|
||
```js | ||
import { defineConfig } from 'vite'; | ||
import griffel from '@griffel/vite-plugin'; | ||
|
||
export default defineConfig({ | ||
// ... | ||
plugins: [griffel()], | ||
}); | ||
``` |
7 changes: 7 additions & 0 deletions
7
change/@griffel-tag-processor-a06f06b2-52aa-4ba3-ab1b-ffe6098ea909.json
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,7 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "chore: bump @wyw-in-js/processor-utils", | ||
"packageName": "@griffel/tag-processor", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@griffel-vite-plugin-59a866c1-5134-4a4d-b18e-9fa4e832d0e3.json
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,7 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "chore: initial release", | ||
"packageName": "@griffel/vite-plugin", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"extends": ["../../.eslintrc.json"], | ||
"ignorePatterns": ["!**/*", "__fixtures__/*/output.ts"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.js", "*.jsx"], | ||
"rules": {} | ||
} | ||
] | ||
} |
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,36 @@ | ||
# @griffel/vite-plugin | ||
|
||
The package contains a plugin for [Vite](https://vitejs.dev/). | ||
|
||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
|
||
- [Installation](#installation) | ||
- [Usage](#usage) | ||
|
||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
|
||
## Installation | ||
|
||
```shell | ||
# npm | ||
npm i -D @griffel/tag-processor @griffel/vite-plugin | ||
# yarn | ||
yarn add --dev @griffel/tag-processor @griffel/vite-plugin | ||
``` | ||
|
||
## Usage | ||
|
||
After installation, add the plugin to your `vite.config.js`: | ||
|
||
```js | ||
import { defineConfig } from 'vite'; | ||
import griffel from '@griffel/vite-plugin'; | ||
|
||
export default defineConfig({ | ||
// ... | ||
plugins: [griffel()], | ||
}); | ||
``` | ||
|
||
|
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,17 @@ | ||
/* eslint-disable */ | ||
export default { | ||
displayName: 'vite-plugin', | ||
preset: '../../jest.preset.js', | ||
globals: {}, | ||
testEnvironment: 'node', | ||
transform: { | ||
'^.+\\.[tj]sx?$': [ | ||
'ts-jest', | ||
{ | ||
tsconfig: '<rootDir>/tsconfig.spec.json', | ||
}, | ||
], | ||
}, | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'], | ||
coverageDirectory: '../../coverage/packages/vite-plugin', | ||
}; |
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,17 @@ | ||
{ | ||
"name": "@griffel/vite-plugin", | ||
"version": "0.0.1", | ||
"description": "Vite plugin for Griffel", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/microsoft/griffel" | ||
}, | ||
"dependencies": { | ||
"@wyw-in-js/vite": "^0.2.3" | ||
}, | ||
"peerDependencies": { | ||
"@griffel/tag-processor": "*", | ||
"vite": ">=4" | ||
} | ||
} |
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 @@ | ||
{ | ||
"name": "@griffel/vite-plugin", | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "packages/vite-plugin/src", | ||
"projectType": "library", | ||
"targets": { | ||
"lint": { | ||
"executor": "@nx/eslint:lint", | ||
"outputs": ["{options.outputFile}"] | ||
}, | ||
"test": { | ||
"executor": "@nx/jest:jest", | ||
"outputs": ["{workspaceRoot}/coverage/packages/vite-plugin"], | ||
"options": { | ||
"jestConfig": "packages/vite-plugin/jest.config.ts" | ||
} | ||
}, | ||
"build": { | ||
"executor": "@nx/js:tsc", | ||
"outputs": ["{options.outputPath}"], | ||
"options": { | ||
"outputPath": "dist/packages/vite-plugin", | ||
"tsConfig": "packages/vite-plugin/tsconfig.lib.json", | ||
"skipTypeField": true, | ||
"packageJson": "packages/vite-plugin/package.json", | ||
"main": "packages/vite-plugin/src/index.ts", | ||
"assets": [ | ||
"packages/vite-plugin/README.md", | ||
{ | ||
"glob": "LICENSE.md", | ||
"input": ".", | ||
"output": "." | ||
} | ||
] | ||
} | ||
}, | ||
"type-check": { | ||
"executor": "nx:run-commands", | ||
"options": { | ||
"cwd": "packages/vite-plugin", | ||
"commands": [{ "command": "tsc -b --pretty" }], | ||
"outputPath": [] | ||
} | ||
} | ||
}, | ||
"tags": [] | ||
} |
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 @@ | ||
export { vitePlugin as default } from './vitePlugin'; |
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 @@ | ||
export { default as vitePlugin } from '@wyw-in-js/vite'; |
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,22 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"strict": true, | ||
"noImplicitOverride": true, | ||
"noPropertyAccessFromIndexSignature": true, | ||
"noImplicitReturns": true, | ||
"noFallthroughCasesInSwitch": true | ||
}, | ||
"files": [], | ||
"include": [], | ||
"references": [ | ||
{ | ||
"path": "./tsconfig.lib.json" | ||
}, | ||
{ | ||
"path": "./tsconfig.spec.json" | ||
} | ||
] | ||
} |
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,11 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"outDir": "../../dist/out-tsc", | ||
"declaration": true, | ||
"types": ["node", "environment"] | ||
}, | ||
"exclude": ["__fixtures__/*/*.ts", "**/*.spec.ts", "**/*.test.ts", "jest.config.ts"], | ||
"include": ["**/*.ts"] | ||
} |
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,22 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"jsx": "react", | ||
"outDir": "../../dist/out-tsc", | ||
"module": "commonjs", | ||
"types": ["jest", "node", "environment"] | ||
}, | ||
"include": [ | ||
"__fixtures__/*/code.ts", | ||
"**/*.test.ts", | ||
"**/*.spec.ts", | ||
"**/*.test.tsx", | ||
"**/*.spec.tsx", | ||
"**/*.test.js", | ||
"**/*.spec.js", | ||
"**/*.test.jsx", | ||
"**/*.spec.jsx", | ||
"**/*.d.ts", | ||
"jest.config.ts" | ||
] | ||
} |
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
Oops, something went wrong.