-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add optional automatic dico client install
- Loading branch information
Showing
9 changed files
with
363 additions
and
10 deletions.
There are no files selected for viewing
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
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,49 @@ | ||
export const VanillaEsm = `import { createDico } from "@dico/client"; | ||
// Dico data file is created next to your \`dico.config.json\` file | ||
import data from "../dico.data.json"; | ||
export const { $dico, $dicoI18n } = createDico(data); | ||
`; | ||
|
||
export const VanillaEsmRoot = `import { createDico } from "@dico/client"; | ||
// Dico data file is created next to your \`dico.config.json\` file | ||
import data from "../dico.data.json"; | ||
export const { $dico, $dicoI18n } = createDico(data); | ||
`; | ||
|
||
export const VanillaCjs = `const { createDico } = require("@dico/client"); | ||
// Dico data file is created next to your \`dico.config.json\` file | ||
const data = require("./dico.data.json"); | ||
const { $dico, $dicoI18n } = createDico(data); | ||
exports.$dico = $dico; | ||
exports.$dicoI18n = $dicoI18n; | ||
`; | ||
|
||
export const VanillaCjsRoot = `const { createDico } = require("@dico/client"); | ||
// Dico data file is created next to your \`dico.config.json\` file | ||
const data = require("./dico.data.json"); | ||
const { $dico, $dicoI18n } = createDico(data); | ||
exports.$dico = $dico; | ||
exports.$dicoI18n = $dicoI18n; | ||
`; | ||
|
||
export const Vite = `import { reactive } from "vue"; | ||
import { createDico } from "@dico/client"; | ||
// Dico data file is created next to your \`dico.config.json\` file | ||
import data from "../dico.data.json"; | ||
export const { $dico, $dicoI18n } = createDico(data); | ||
export const useDico = () => { | ||
return { | ||
$dico: $dico, | ||
$dicoI18n: reactive($dicoI18n) | ||
}; | ||
}; | ||
`; |
Oops, something went wrong.