Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit 7f7ce47

Browse files
committed
build: use config for build
1 parent b840a5e commit 7f7ce47

File tree

6 files changed

+28
-76
lines changed

6 files changed

+28
-76
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ node_modules
22
dist
33
# playground/src/.generated/*
44
.vercel
5-
yarn-error.log
5+
yarn-error.log
6+
test-vite-project

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"scaffold": "hygen",
1616
"playground:routes": "ts-node ./scripts/parse-routes.ts",
1717
"dev": "yarn playground:routes && NODE_ENV=development vite serve playground --config ./vite.config.ts",
18-
"playground:build": "yarn install && yarn build && yarn playground:routes && NODE_ENV=production vite build playground",
18+
"playground:build": "yarn install && yarn build && yarn playground:routes && NODE_ENV=production vite build playground --config ./vite.config.ts",
1919
"core": "yarn workspace @chakra-ui/vue-next",
2020
"c-alert": "yarn workspace @chakra-ui/c-alert",
2121
"c-theme-provider": "yarn workspace @chakra-ui/c-theme-provider",
@@ -59,7 +59,7 @@
5959
"recursive-readdir": "^2.2.2",
6060
"ts-node": "^9.0.0",
6161
"typescript": "^4.1.2",
62-
"vite": "^2.0.0-beta.12",
62+
"vite": "^2.0.0-beta.44",
6363
"vue": "^3.0.5",
6464
"vue-router": "4.0.0-beta.10"
6565
},

playground/src/.generated/imports.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import Component_1 from "../components/Home.vue";
2-
import Component_2 from '@chakra-ui/c-alert/examples/base-alert.vue'
3-
import Component_3 from '@chakra-ui/c-box/examples/base-box.vue'
4-
import Component_4 from '@chakra-ui/c-box/examples/box-with-chakra-directive.vue'
5-
import Component_5 from '@chakra-ui/c-button/examples/base-button.vue'
2+
const Component_2 = () => import('@chakra-ui/c-alert/examples/base-alert.vue')
3+
const Component_3 = () => import('@chakra-ui/c-box/examples/base-box.vue')
4+
const Component_4 = () => import('@chakra-ui/c-box/examples/box-with-chakra-directive.vue')
5+
const Component_5 = () => import('@chakra-ui/c-button/examples/base-button.vue')
66
import Component_6 from "../components/Home.vue";
77

88
export default {

scripts/parse-routes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ export interface Route {
6363
/** To import statement */
6464
const toImport = (component: string, importPath: string) =>
6565
// Note: for now dynamic imports dont work with vite. use static imports
66-
// `const ${component} = () => import('${importPath}')`
67-
`import ${component} from '${importPath}'`
66+
`const ${component} = () => import('${importPath}')`
67+
// `import ${component} from '${importPath}'`
6868

6969
interface Resolver {
7070
(resolver: Route): string

tsconfig.json

Lines changed: 9 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
{
22
"compilerOptions": {
3-
4-
/* Visit https://aka.ms/tsconfig.json to read more about this file */
5-
6-
/* Basic Options */
7-
// "incremental": true, /* Enable incremental compilation */
83
"target": "esnext", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
94
"module": "esnext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
105
"resolveJsonModule": true,
@@ -14,66 +9,22 @@
149
"sourceMap": true,
1510
"moduleResolution": "node",
1611
"plugins": [{ "name": "@vuedx/typescript-plugin-vue" }],
17-
// "allowJs": true, /* Allow javascript files to be compiled. */
18-
// "checkJs": true, /* Report errors in .js files. */
1912
"jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
20-
// "declaration": true, /* Generates corresponding '.d.ts' file. */
21-
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
22-
// "sourceMap": true, /* Generates corresponding '.map' file. */
23-
// "outFile": "./", /* Concatenate and emit output to single file. */
24-
// "outDir": "./", /* Redirect output structure to the directory. */
25-
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
26-
// "composite": true, /* Enable project compilation */
27-
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
28-
// "removeComments": true, /* Do not emit comments to output. */
29-
// "noEmit": true, /* Do not emit outputs. */
30-
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
3113
"downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
32-
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
33-
34-
/* Strict Type-Checking Options */
3514
"strict": true, /* Enable all strict type-checking options. */
36-
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
37-
// "strictNullChecks": true, /* Enable strict null checks. */
38-
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
39-
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
40-
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
41-
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
42-
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
43-
44-
/* Additional Checks */
45-
// "noUnusedLocals": true, /* Report errors on unused locals. */
46-
// "noUnusedParameters": true, /* Report errors on unused parameters. */
47-
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
48-
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
49-
50-
/* Module Resolution Options */
51-
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
52-
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
53-
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
54-
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
55-
// "typeRoots": [], /* List of folders to include type definitions from. */
56-
// "types": [], /* Type declaration files to be included in compilation. */
5715
"allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
5816
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
59-
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
60-
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
61-
62-
/* Source Map Options */
63-
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
64-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
65-
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
66-
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
67-
68-
/* Experimental Options */
69-
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
70-
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
71-
72-
/* Advanced Options */
7317
"skipLibCheck": true, /* Skip type checking of declaration files. */
74-
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
18+
"forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */
19+
7520
},
76-
"include": ["packages"],
21+
"include": [
22+
"packages",
23+
"playground/**/*.ts",
24+
"playground/**/*.d.ts",
25+
"playground/**/*.tsx",
26+
"playground/**/*.vue"
27+
],
7728
"exclude": ["node_modules"],
7829
"ts-node": {
7930
"compilerOptions": {

yarn.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3957,10 +3957,10 @@ es6-promisify@^5.0.0:
39573957
dependencies:
39583958
es6-promise "^4.0.3"
39593959

3960-
esbuild@^0.8.26:
3961-
version "0.8.32"
3962-
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.8.32.tgz#d3d679ea417925f7afaab37555e52070df317355"
3963-
integrity sha512-5IzQapMW/wFy5oxziHCJzawk26K3xeyrIAQPnPN3c0Q84hqRw6IfGDGfGWOdJNw5tAx77yvwqZ4r1QMpo6emJA==
3960+
esbuild@^0.8.34:
3961+
version "0.8.34"
3962+
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.8.34.tgz#16b4ac58f74c821d2c5a8c2f0585ca96a38ab4e6"
3963+
integrity sha512-tnr0V1ooakYr1aRLXQLzCn2GVG1kBTW3FWpRyC+NgrR3ntsouVpJOlTOV0BS4YLATx3/c+x3h/uBq9lWJlUAtQ==
39643964

39653965
escalade@^3.1.1:
39663966
version "3.1.1"
@@ -8508,12 +8508,12 @@ [email protected]:
85088508
core-util-is "1.0.2"
85098509
extsprintf "^1.2.0"
85108510

8511-
vite@^2.0.0-beta.12:
8512-
version "2.0.0-beta.30"
8513-
resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.30.tgz#d0c1056d1fb05c489614360f92363eebec41a6b4"
8514-
integrity sha512-wOeO64J3k4jGjCOkH/6RUcIyT/HOTaDZSiXE75aWYqV9hI7Q6uEeSXbAFtb9bG82RGLEWdsqtCvx5t7gaeqtsw==
8511+
vite@^2.0.0-beta.44:
8512+
version "2.0.0-beta.44"
8513+
resolved "https://registry.yarnpkg.com/vite/-/vite-2.0.0-beta.44.tgz#df3846160066a121d85dbc8ec11c9fa9a71347f2"
8514+
integrity sha512-NTzmP7HEKDg3J5r3I22f87jK3ugPVEU81BQ8hWn3hNWU0msCziUlj7aHwItSUEbQA+ymqO3TBO2fN7Aa+OKckQ==
85158515
dependencies:
8516-
esbuild "^0.8.26"
8516+
esbuild "^0.8.34"
85178517
postcss "^8.2.1"
85188518
resolve "^1.19.0"
85198519
rollup "^2.35.1"

0 commit comments

Comments
 (0)