Skip to content

Commit e946c2b

Browse files
Merge pull request #28 from msaelices/dev
Ensure main.native.js ends with semicolon in order to pass the tslint if we have a TS app
2 parents f43350a + 9ac7efc commit e946c2b

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,19 @@ An example of this would be the following Vue component:
5353
```
5454

5555
### Optional Separation of concerns for Web and Native SFC's
56-
If you want complete seperation of concerns between Web and Native for components, core logic and styling, you can also provide an alternate file naming scheme in your project. The name will dictate which mode (Web or Native) and platform (Android or IOS) the file will be used with. The same overall schema will work for `.vue`, `.js`, `.ts`, `.scss` and `.css` files.
56+
If you want complete seperation of concerns between Web and Native for components, core logic and styling, you can also provide an alternate file naming scheme in your project. The name will dictate which mode (Web or Native) and platform (Android or IOS) the file will be used with. The same overall schema will work for `.vue`, `.js`, `.ts`, `.scss` and `.css` files.
5757

5858
| File Type | Android __and__ IOS | Android only | IOS only | Web only |
5959
| ---------- | ------------------- | --------------- | --------------- | --------------- |
60-
| vue | *.native.vue | *.android.vue | *.ios.vue | *.vue |
60+
| vue | *.native.vue | *.android.vue | *.ios.vue | *.vue |
6161
| js | *.native.js | *.android.js | *.ios.js | *.js |
6262
| ts | *.native.ts | *.android.ts | *.ios.ts | *.ts |
6363
| scss | *.native.scss | *.android.scss | *.ios.scss | *.scss |
6464
| css | *.native.css | *.android.css | *.ios.css | *.css |
6565

6666
Webpack will handle figuring out which files to include based on the `npm run` command syntax you pass in. You can also mix and match this file naming schema with the `web` or `native` tag options mentioned above.
6767

68-
At `serve` or `build` in conjunction with the mode such as `android` or `ios`, Webpack will filter which files are looked at. For instance, if you do `npm run serve:android`, then it will look for `*.native.vue` and `*.android.vue` files and ignore `*.ios.vue` files entirely. Conversely, it will do the same when you are working with `ios` and will ignore `*.android.vue` files.
68+
At `serve` or `build` in conjunction with the mode such as `android` or `ios`, Webpack will filter which files are looked at. For instance, if you do `npm run serve:android`, then it will look for `*.native.vue` and `*.android.vue` files and ignore `*.ios.vue` files entirely. Conversely, it will do the same when you are working with `ios` and will ignore `*.android.vue` files.
6969

7070
This will allow you to develop generic native components under the `*.native.vue` file extension, but in special cases, it may require you to do platform specific components, core logic and styling. Use the corrosponding file extension to allow this to happen.
7171

@@ -218,7 +218,7 @@ Each time the project is built or served, the plugin will copy the latest webpac
218218
If you'd like to see what the webpack config is doing then you can run one of the following:
219219

220220
1. `vue inspect -- --env.android > out-android.js`
221-
2. `vue inspect -- --env.ios > out-android.js`
221+
2. `vue inspect -- --env.ios > out-ios.js`
222222
3. `vue inspect -- --env.web > out-web.js`
223223

224224
These will default to showing you the Development version of the webpack config. You can pass in the `-- --env.production` option to see the Production version of the config. Subtitute `development.android` or `production.ios`, etc to see the different configs based on the environmental variables.

generator/templates/simple/src/main.native.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
extend: '@vue/cli-service/generator/template/src/main.js'
33
replace:
44
- !!js/regexp /import Vue from 'vue'/
5+
- !!js/regexp /import App from './App.vue'/
56
- !!js/regexp /Vue.config.productionTip = false/
67
- !!js/regexp /h => h\(App\),/
78
- !!js/regexp /}\)\.\$mount\('#app'\)/
@@ -11,6 +12,10 @@ replace:
1112
import Vue from 'nativescript-vue';
1213
<%# END_REPLACE %>
1314

15+
<%# REPLACE %>
16+
import App from './App.vue';
17+
<%# END_REPLACE %>
18+
1419
<%# REPLACE %>
1520
// Set the following to `true` to hide the logs created by nativescript-vue
1621
Vue.config.silent = false;

0 commit comments

Comments
 (0)