canvasframework 0.5.29 → 0.5.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +66 -27
  2. package/index.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  # Installation
12
12
  - npm install canvasframework
13
- - npm install -D vite
13
+ - npm install vite --save-dev
14
14
 
15
15
  # add in package.json
16
16
  "scripts": {
@@ -18,40 +18,79 @@
18
18
  "build": "vite build"
19
19
  }
20
20
 
21
- # Configure webpack and babel
21
+ # Configure with Vite and Capacitor or cordova
22
22
 
23
- add your app.js in src folder and index.html in www folder
24
- in index.html add script src bundle.js
23
+ - add your app.js in src folder "src/main.js"
24
+ - add your index.html in the root of your project
25
+ - add this to your index.html <script type="module" src="/src/main.js"></script>
26
+ - you didn't add canvas or other html tags to your index.html
25
27
 
26
28
  ```
27
- // webpack.config.cjs
28
- const path = require('path');
29
-
30
- module.exports = {
31
- entry: './src/main.js',
32
- output: {
33
- filename: 'bundle.js',
34
- path: path.resolve(__dirname, 'www')
35
- },
36
- mode: 'development',
37
- module: {
38
- rules: [
39
- {
40
- test: /\.js$/,
41
- exclude: /node_modules/,
42
- use: 'babel-loader'
43
- }
44
- ]
45
- },
46
- devServer: {
47
- static: './www',
48
- hot: true
29
+ <!DOCTYPE html>
30
+ <html lang="en">
31
+ <head>
32
+ <meta charset="UTF-8">
33
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
34
+ <title>My App</title>
35
+ <style>
36
+ * {
37
+ margin: 0;
38
+ padding: 0;
39
+ box-sizing: border-box;
40
+ }
41
+
42
+ body {
43
+ font-family: -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
44
+ overflow: hidden;
45
+ background-color: #f5f5f5;
46
+ }
47
+ </style>
48
+ </head>
49
+ <body>
50
+ <script type="module" src="/src/app.js"></script>
51
+ </body>
52
+ </html>
53
+ ```
54
+
55
+ - Add vite.config.js to the root of the project
56
+
57
+ ```
58
+ import { defineConfig } from 'vite';
59
+
60
+ export default defineConfig({
61
+ base: './', // IMPORTANT pour Android
62
+ build: {
63
+ outDir: 'www',
64
+ emptyOutDir: true
49
65
  }
66
+ });
67
+ ```
68
+
69
+ - add this to our package.json
70
+
71
+ ```
72
+ "scripts": {
73
+ "dev": "vite",
74
+ "build": "vite build"
75
+ }
76
+ ```
77
+
78
+ - into your capacitor.config.ts specify this webDir
79
+
80
+ ```
81
+ const config = {
82
+ appId: 'com.test.app',
83
+ appName: 'CanvasApp',
84
+ webDir: 'www'
50
85
  };
51
86
  ```
52
87
 
88
+ - And finally you can build your app
89
+
53
90
  ```
54
- webpack.config.js webpack.config.cjs
91
+ npm run build
92
+ npx cap sync
93
+ npx cap run android
55
94
  ```
56
95
 
57
96
  ---
package/index.js CHANGED
@@ -116,4 +116,4 @@ export { default as FeatureFlags } from './manager/FeatureFlags.js';
116
116
 
117
117
  // Version du framework
118
118
 
119
- export const VERSION = '0.5.22';
119
+ export const VERSION = '0.5.30';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "canvasframework",
3
- "version": "0.5.29",
3
+ "version": "0.5.30",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/beyons/CanvasFramework.git"