|
1 | | -const addChakraLoaderConfig = require('./helpers/add-chakra-loader-config'); |
2 | | -const registerChakraVuePlugin = require('./helpers/register-chakra-vue-plugin'); |
3 | 1 | const chakraPkg = require('@chakra-ui/vue/package.json') |
4 | 2 | const emotionPkg = require('@emotion/css/package.json') |
5 | 3 | const chakraLoaderPkg = require('chakra-loader/package.json') |
| 4 | +const registerChakraVuePlugin = require('./helpers/register-chakra-vue-plugin') |
| 5 | +const addChakraLoaderConfig = require('./helpers/add-chakra-loader-config') |
6 | 6 |
|
7 | 7 | module.exports = (api, options) => { |
8 | 8 | api.extendPackage({ |
9 | 9 | dependencies: { |
10 | 10 | '@chakra-ui/vue': `^${chakraPkg.version}`, |
11 | | - '@emotion/css': `^${emotionPkg.version}`, |
12 | | - }, |
13 | | - }); |
| 11 | + '@emotion/css': `^${emotionPkg.version}` |
| 12 | + } |
| 13 | + }) |
14 | 14 |
|
15 | 15 | if (options.addChakraLoader) { |
16 | 16 | api.extendPackage({ |
17 | 17 | devDependencies: { |
18 | | - 'chakra-loader': `^${chakraLoaderPkg.version}`, |
19 | | - }, |
20 | | - }); |
| 18 | + 'chakra-loader': `^${chakraLoaderPkg.version}` |
| 19 | + } |
| 20 | + }) |
21 | 21 | } |
22 | 22 |
|
23 | | - api.injectImports(api.entryFile, `import Chakra from '@chakra-ui/vue'`); |
| 23 | + api.injectImports(api.entryFile, 'import Chakra from \'@chakra-ui/vue\'') |
24 | 24 |
|
25 | 25 | api.render('./template', { |
26 | 26 | hasVueRouter: options.hasVueRouter, |
27 | | - hasChakraLoader: options.addChakraLoader, |
28 | | - }); |
| 27 | + hasChakraLoader: options.addChakraLoader |
| 28 | + }) |
29 | 29 | api.onCreateComplete(() => { |
30 | | - registerChakraVuePlugin(api); |
| 30 | + registerChakraVuePlugin(api) |
31 | 31 |
|
32 | 32 | if (options.addChakraLoader) { |
33 | | - addChakraLoaderConfig(api); |
| 33 | + addChakraLoaderConfig(api) |
34 | 34 | } |
35 | | - }); |
| 35 | + }) |
36 | 36 |
|
37 | | - api.exitLog('Chakra UI Vue is ready'); |
38 | | - api.exitLog('Join the community on Discord - https://discord.gg/Tv8Jca'); |
39 | | -}; |
| 37 | + api.exitLog('Chakra UI Vue is ready') |
| 38 | + api.exitLog('Join the community on Discord - https://discord.gg/Tv8Jca') |
| 39 | +} |
0 commit comments