8000 fix: update demo to working condition · heywhy/nativescript-vue@9d7300c · GitHub
[go: up one dir, main page]

Skip to content

Commit 9d7300c

Browse files
committed
fix: update demo to working condition
1 parent 45d1d53 commit 9d7300c

File tree

6 files changed

+681
-715
lines changed

6 files changed

+681
-715
lines changed

demo/app/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createApp } from "vue";
1+
import { createApp } from "nativescript-vue";
22

33
// @ts-ignore
44
global.window = global;

demo/app/composables/goHome.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { $navigateTo, $showModal } from "../../../src";
1+
import { $navigateTo, $showModal } from "nativescript-vue";
22
import Home from "../components/Home.vue";
33

44
export function goHome(depth = 0, modal = false) {

demo/app/composables/useFPS.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
start,
55
stop,
66
} from "@nativescript/core/fps-meter";
7-
import { ref } from "vue";
7+
import { ref } from "nativescript-vue";
88

99
export function useFPS() {
1010
const fps = ref(60);

demo/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@
6< 10000 code>6
"dependencies": {
77
"@nativescript/core": "~8.5.0",
88
"@vueuse/components": "^9.4.0",
9-
"@vueuse/core": "^9.4.0"
9+
"@vueuse/core": "^9.4.0",
10+
"nativescript-vue": "link:.."
1011
},
1112
"devDependencies": {
1213
"@nativescript/android": "~8.5.0",
1314
"@nativescript/ios": "~8.5.0",
1415
"@nativescript/types": "~8.5.0",
1516
"@nativescript/webpack": "~5.0.9",
1617
"@types/node": "~17.0.21",
17-
"typescript": "~4.7.0",
18-
"vue": "^3.2.47",
18+
"@vue/compiler-sfc": "^3.2.47",
19+
"typescript": "~4.9.5",
1920
"vue-loader": "^17.0.0"
2021
}
2122
}

demo/webpack.config.js

Lines changed: 3 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,7 @@
1-
const webpack = require("@nativescript/webpack");
2-
const { VueLoaderPlugin } = require("vue-loader");
3-
4-
const path = require("path");
5-
6-
const nsVuePath = path.resolve(__dirname, "../src/index.ts");
1+
const webpack = require('@nativescript/webpack')
72

83
module.exports = (env) => {
9-
webpack.init(env);
10-
webpack.useConfig("vue");
11-
12-
webpack.chainWebpack((config) => {
13-
config.resolve.alias.set("vue", nsVuePath);
14-
15-
config.plugin("VueLoaderPlugin").use(VueLoaderPlugin);
16-
17-
config.module
18-
.rule("vue")
19-
.test(/\.vue$/)
20-
.use("vue-loader")
21-
.loader(require.resolve("vue-loader"))
22-
.tap((options) => {
23-
return {
24-
...options,
25-
isServerBuild: false,
26-
// compiler: path.resolve(__dirname, '../dist/compiler-sfc'),
27-
compilerOptions: {
28-
// isCustomElement: (el) => true,
29-
// transformHoist: null
30-
},
31-
};
32-
});
33-
34-
config.plugin("DefinePlugin").tap((args) => {
35-
Object.assign(args[0], {
36-
__VUE_OPTIONS_API__: true,
37-
__VUE_PROD_DEVTOOLS__: false,
38-
});
39-
40-
return args;
41-
});
42-
43-
// disable vue fork ts checker, as it doesn't work with vue3 yet?
44-
config.plugin("ForkTsCheckerWebpackPlugin").tap((args) => {
45-
args[0] = webpack.merge(args[0], {
46-
typescript: {
47-
extensions: {
48-
vue: {
49-
enabled: false,
50-
},
51-
},
52-
},
53-
});
54-
return args;
55-
});
56-
});
57-
58-
// Learn how to customize:
59-
// https://docs.nativescript.org/webpack
4+
webpack.init(env)
605

61-
return webpack.resolveConfig();
6+
return webpack.resolveConfig()
627
};

0 commit comments

Comments
 (0)
0