This file contains hidden or 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
| import Vue from 'nativescript-vue' | |
| import router from './router' | |
| import store from './store' | |
| import devtools from '@vue/devtools' | |
| // Prints Vue logs when --env.production is *NOT* set while building | |
| Vue.config.silent = (TNS_ENV === 'production') | |
| const app = new Vue({ | |
| router, |
This file contains hidden or 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
| <script> | |
| export default { | |
| inheritAttrs: false, | |
| props: { | |
| index: { | |
| type: [String, Number], | |
| default: null, | |
| }, |
This file contains hidden or 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
| const path = require('path') | |
| module.exports = { | |
| chainWebpack: config => { | |
| const types = ['vue-modules', 'vue', 'normal-modules', 'normal'] | |
| types.forEach(type => addStyleResource(config.module.rule('stylus').oneOf(type))) | |
| }, | |
| } | |
| function addStyleResource (rule) { |
This file contains hidden or 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
| // Existing imports | |
| import Vue from 'vue' | |
| import router from './router' | |
| import store from './store' | |
| // Other existing code here | |
| // Add 'app' variable | |
| const app = new Vue({ | |
| // Existing options |
This file contains hidden or 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
| @import '~@vue/cli-ui/src/style/imports' | |
| .my-class | |
| background $vue-ui-color-light-neutral | |
| .vue-ui-dark-mode & | |
| background $vue-ui-color-dark |
Follow those simple steps to propose a new language for the CLI UI!
-
Run
navigator.languagesornavigator.languageto get the language code for the new locale. For example:'fr'. -
Search NPM to see if a package called
vue-cli-locale-<language code>doesn't already exist. If it does, please contribute to it by submitting PRs! If you don't find any, create a new package calledvue-cli-locale-<language code>. For example:vue-cli-locale-fr
This file contains hidden or 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
| const LRU = require('lru-cache') | |
| // Micro-caching | |
| exports.cache = function (resolver, keyFactory, { max = 500, maxAge = 3000, perUser = true } = {}) { | |
| const microCache = new LRU({ | |
| max, | |
| maxAge, | |
| }) | |
| return async (holder, args, context) => { | |
| let key = typeof keyFactory === 'function' ? keyFactory(holder, args, context) : keyFactory |
This file contains hidden or 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
| // @vue/cli-plugin-eslint/ui.js | |
| module.exports = api => { | |
| // Config file | |
| api.describeConfig({ | |
| name: 'ESLint configuration', | |
| description: 'Error checking & Code quality', | |
| link: 'https://eslint.org', | |
| files: { | |
| json: ['eslintrc', 'eslintrc.json'], |
This file contains hidden or 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
| const { resolve } = require('path') | |
| const chalk = require('chalk') | |
| const findInFiles = require('find-in-files') | |
| const importReg = /'(.*?)'$/ | |
| async function findVendorEntries (vendors, folder) { | |
| const reg = `import (.*? from )?'((${vendors.join('|')})/.*?)'` | |
| const results = await findInFiles.find(reg, folder, /\.(vue|jsx?|styl)$/) | |
| const set = new Set(vendors) |