caiobiodere / cordova-template-framework7-vue-webpack Goto Github PK
View Code? Open in Web Editor NEWFramework7 - Vue - Webpack Cordova Template with Webpack Dev Server and Hot Module Replacement
License: Apache License 2.0
Framework7 - Vue - Webpack Cordova Template with Webpack Dev Server and Hot Module Replacement
License: Apache License 2.0
when I run cordova run browser -- --lr OR cordova run ios -- --lr
I find some error below. How can I fix it.
http://localhost:8081/platform_cordova_files/browser/cordova.js 404 not found
http://localhost:8081/platform_cordova_files/ios/cordova.js 404 not found
Hi guys,
I'm still use the 1.0.9
version template, after reinstall my pc and checkout my projects. I ran into an error on my test phone, Invalid Host header
with a white background.
As per webpack/webpack-dev-server#882 (comment), and https://github.com/webpack/webpack-dev-server/releases/tag/v2.4.3,
Host
doesn't match listening host or public
option.localhost
or 127.0.0.1
are not blocked.the config in webpack.config.js
(https://github.com/centrual/cordova-template-framework7-vue-webpack/blob/master/template_src/webpack.config.js#L105)
host: "0.0.0.0",
My due date is today, so I just add disableHostCheck: true
under that line to continue the work.
Hope you'll find a better way to fix this. : )
Hi,
I'm looking forward for this template do support for both Android and iOS platform. With this compatibility, I can develop much powerful app with its dynamically.
Thanks! π
Refer: https://framework7.io/tutorials/maintain-both-ios-and-material-themes-in-single-app.html
I am running cordova run android and I am getting the error at the bottom.
I have a service (item.js) thats getting a json array as follows:
export default {
getItems() {
let items = [
{
id: "1",
title: "item 1"
},
{
id: "2",
title: "item 2"
}
]
}
}
Then I have a items.vue file below.
<template>
<f7-page>
<f7-navbar title="Principle Member" back-link="Back" sliding></f7-navbar>
<f7-block-title>Items</f7-block-title>
<f7-list>
<f7-list-item v-for="item in fetchedItems">
<f7-label>{{item.label}}</f7-label>
</f7-list>
</f7-list>
</f7-page>
</template>
<script>
import fetchedItems from '../services/items'
data() {
return {
fetchedItems: []
}
},
created() {
this.fetchedItems()
},
methods: {
fetchedItems() {
return fetchedItems.getItems()
.then(results => {
this.fetchedItems = results;
})
}
}
</script>
The error generated on android is below.
file:///android_asset/www/19699c910e8139766b4c.main.js: Line 27217 : Uncaught SyntaxError: Unexpected token )
E/Web Console(13580): Uncaught SyntaxError: Unexpected token ):27217
D/CordovaWebViewImpl(13580): onPageFinished(file:///android_asset/www/index.html)
Below is a snippet on 19699c910e8139766b4c.main.js where the error occurs.
/*!****************************************************!*\
!*** ./src/assets/vue/services/item.js ***!
\****************************************************/
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony default export */ __webpack_exports__["a"] = {
getItems() { // ** line 27217 **
let items = [
{
id: "1",
label: "item 1"
},
{
id: "2",
label: "item 2"
}
]
return new Promise(function (resolve, reject) {
resolve(items)
})
.catch(function (error) {
reject(error);
})
} ....
When I run on IOS and browser, it works fine.
Im want using babel-loader ? , i edit webpack config like this, app running but it only whitescreen.
How to config webpack "babel-loader" for js file?
{ test: /\.js?$/, loader: 'babel-loader?presets[]=env&presets[]=stage-0', exclude: /node_modules/, enforce: 'pre' }
hello~
when i try to use this url http://127.0.0.1:8081/#/lecture/room/?id=1
to go to the room.vue
page, the app will go to the index page ? why? thank you very much
I want to using mp3 in my app .
I using file-loader like this :
{ test: /\.(png|jpe?g|gif|mp3)$/, loader: 'file-loader', options: { name: '[name].[ext]?[hash]' } },
and require it in modules vuex :
export const mp3 = { namespaced: true, state: { music: require('../../assets/static/mp3/music.mp3') }, mutations: {} };
But i can't using mp3? π what i'm do wrong? plz help me .
Hi. I need make a redirect in main.vue, but this.$router
is undefined. How can I do that? thx.
when I execute 'cordova platform add ios', some error below:
Error: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
how to fix it
thanks
A recent upgrade to F7 version 1.6.2 caused a Dom7 not defined error. Confirmed with clean install of current project.
Uncaught ReferenceError: Dom7 is not defined
at a09b5dbβ¦.main.js:24342
at a09b5dbβ¦.main.js:24447
at Object.<anonymous> (a09b5dbβ¦.main.js:28508)
at Object.<anonymous> (a09b5dbβ¦.main.js:28512)
at __webpack_require__ (a09b5dbβ¦.main.js:20)
at Object.<anonymous> (a09b5dbβ¦.main.js:34955)
at __webpack_require__ (a09b5dbβ¦.main.js:20)
at module.exports.rawScriptExports (a09b5dbβ¦.main.js:66)
at a09b5dbβ¦.main.js:69
Rolling back to Framework7 v1.6.0 works, but only as a workaround.
Dom7 becamse a standalone dependency (devDependency (only?)) for F7 at v1.6.2
Does that impact this project?
Your project looks like fun. I set it up using the command you have in the instructions.
cordova create <project_create_dir> [com.example.projectname] [ProjectClassName] --template cordova-template-framework7-vue-webpack
No errors. One warning that I think may be relevant is:
npm WARN [email protected] requires a peer of uglify-js@^2.8.0 but none was installed.
I then ran npm install
All good.
When I run webpack I get
Error: Cannot find module 'uglify-js'
So, I installed the Android platform cordova platform add android
All good.
Then I and ran cordova build android
And I get
Error: Cannot find module 'uglify-js'
I checked node_modules\
and I found uglify-es
, uglifyjs-webpack-plugin
, uglify-to-browserify
Not sure about that uglify-es
folder.
In the package.js
file in dev it says,
"uglify-js": "git://github.com/mishoo/UglifyJS2.git#harmony",
"uglifyjs-webpack-plugin": "^0.3.0",
When I try to
npm install --save-dev uglify-js@github:mishoo/UglifyJS2#harmony
I now see a uglify-js folder in the node-modules
folder, but I still get the same uglify-js not found
error.
I'm on Linux and checked my $PATH for conflicting settings. No path specified for node_modules. That's all good, no reference at all.
I haven't installed uglify globally. That would probably solve the issue though it might make reference to the Harmony version difficult, breaking support for ES6 (I'm guessing?).
I'm new to webpack (previous gulp exp.) so maybe I'm using Webpack incorrectly or missing a step?
Running
Node v 7.2.1
Cordova v 6.5.0
NPM v 3.10.10
Any advice appreciated. Thank you in advance.
excuse me, how to use in this template?
i want to judge the current page to remove css, but destroyed not working.
Thank you
var HomeIndexStyles = require('!style-loader/useable!css-loader!../../css/home/index.css');
β¦β¦
mounted: function() {
this.$nextTick(function() {
HomeIndexStyles.use();
}
},
destroyed: function() {
HomeIndexStyles.unuse();
console.log('ιζ―δΊHomeIndexStyles');
}
Hi, I've added a favicon.png file to the src/assets/static/images directory in my project, but
phonegap build browser
doesn't copy it to anywhere.
Is there something in a config file that needs turning on?
I am running into issues using SVGs, during development I had placed svg files in www/assets/subdirs/files.svg
- this was working fine.
When I then did a phonegap run android, I found that one of the hooks wiped out everything in www/
I then tried to place the svgs in:
src/assets/static/images/svg/subdirs/files.svg
and
src/static/images/svg/subdirs/files.svg
Neither seem to give me any joy, any hints?
Defining scroll distance console throwing error.
<f7-page name="feeds" infinite-scroll @infinite="onInfiniteScroll" infinite-scroll-distance="100">
[Vue warn]: Invalid prop: type check failed for prop "infiniteScrollDistance". Expected Number, got String.
(found in )
However in compiled version I can see data-distance attribute added to page-content
I stored the images on src/assets/static/images
as on template. But how to load it to app? Since there is no images on www folder.
I'm using this cordova plugin https://github.com/jeduan/cordova-plugin-facebook4, but during a cordova run browser -- --live-reload
its js file get ignored.
Everything works if I run cordova run browser
.
How can I tell cordova to include some other plugins using your template?
Error: Error happened when webpack build: Error: stdout maxBuffer exceeded
I used xCode to compiled the iOS app. When app installed and started, it's showing white screen. I have external js files placed in assets/js/. Those files are not moving to /www folder
Hi,
I have some problems with the "livereload" function under android.
First IΒ΄ve created a new project, added platforms and tried to run it:
1: cordova run browser -- --lr
----> Everyhing works fine, got directed to 127.0.0.1:8081
2: cordova run android -- --lr
---> I got a connection error.
Will i have to do some additional configurations (webpack.config.js) ????
Thx in advance ....
hello, how to compress the html code in vue file? should i change the configure of webpack.config.js?thank you~
I try , but could you add babel loader to your template ? π
Because i want using spread syntax
, plz help me.
Could you please help me on how to and where to import custom JavaScript file and/or library or from a CDN?
Because usually I just inject it at the bottom part of the <body>
, but it seems that this has a different method. Thank you so much.
Small error when sudo cordova run android
with space in project path.
I'm on linux.
Exemple with /home/name/Documents/test cordova/project/
:
sudo cordova run android
Before deploy hook started...
Checking is node modules installed...
Node modules already installed.
Starting webpack build...
Error happened when webpack build: Error: Command failed: /home/name/Documents/test cordova/project/node_modules/.bin/webpack
/bin/sh: 1: /home/name/Documents/test: not found
Hi. I have to make redirect when authorized user going to the login page. How can I use f7 router events?
Any interest in adding Vuex as well? I've used your project here twice and I like it. I look forward to using it more.
I find that adding Vuex is almost always my next step and even when it's not, it's only because I'm rolling my own for very small testing projects. In those cases, I would be just as happy to have Vuex already installed.
This is just a suggestion. You might have other plans or use cases to meet and if so, no worries at all.
I hate having to post this as an issue. Is there a better way to have this conversation? I'm relatively new to Github still.
Thank you for your efforts on this project already. Greatly appreciated.
Can I use the material theme? I imagine it would require some components to be material specific as there dom is different. Or perhaps the components can make use of v-if="$theme.ios" and v-if="$theme.material".
I
Hi,
I created a cordova app with your template with cordova cli and after that I commit in my git repo.
In a second PC I download sources with git's checkout, but when I try to execute any cordova cli command I've the following error:
Error: Current working directory is not a Cordova-based project.
To make it works I had to create a new cordova project ad after that I had to copy all files from my checkout to it, replacing all files (hooks, www, config.xml, ...)
There is another solution to "create" cordova app from your project folder?
Having some problems with the points in the Header.
Vue-DevTools:
while debugging in chrome, vue-devtools plugin will not detect that i'm working on a vue-project.
Vuex:
After installing "vuex" and "babel-preset-stage-2" i got following error message after import e.g. { mapActions }
ERROR in ./~/vue-loader/lib/selector.js?type=script&index=0!./src/assets/vue/pages/components/add.vue
Module parse failed: C:\phonegap\mytime\node_modules\vue-loader\lib\selector.js?type=script&index=0!C:\phonegap\mytime\src\assets\vue\pages\components\add.vue Unexpected token (34:8)
You may need an appropriate loader to handle this file type.
|
| methods: {
| ...mapActions([ <-- Line 34
| 'addAccount'
| ]),
@ ./src/assets/vue/pages/components/add.vue 3:2-97
@ ./src/routes.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://0.0.0.0:8081 webpack/hot/dev-server ./src/main.js ./webpack/dev_helpers/CordovaDeviceRouter.js
Any suggestions?
Many thanks in advance,
After success install current template, when I run
cordova run browser -- --live-reload
it fails, with
cordova run browser -- --live-reload
Error: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
Hi,
I have just followed initial instructions (create project from template, adding platforms, etc.) when webpack compilation fails (looks like it cannot find modules).
I get several errors like this one:
ERROR in ./src/app.js
Module not found: Error: Can't resolve 'framework7' in .../Test/src'
@ ./src/app.js 5:0-19
@ multi (webpack)-dev-server/client?http://192.168.1.38:8081 webpack/hot/dev-server ./src/app.js ./webpack/dev_helpers/CordovaDeviceRouter.js
It not only fails with framework7, but also with vue.
My cordova version is 7.0.1. npm version 5.0.3.
MacOS Sierra.
Commands I followed:
cordova create Test com.me.test Test --template cordova-template-framework7-vue-webpack
cordova platform add browser
cordova run browser -- --live-reload
What am I doing wrong?
Thanks!
Sorry If I skipped any step but, running cordova run browser -- --live-reload
show the right title, but the page is completely white. Is it right?
Great project, thanks.
I'm wondering if there is any way to listen for the deviceready
call in this setup from running it in the browser or building it?
https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-device/
I can't seem to catch that event. Any experience with this?
This is more of a Cordova issue. I'll close it.
Hi,
I purchased the apple developer program, and don't have a Mac. I need to build an app for both android and iphone.
I work in my own docker image with docker-compose (config), and test the code on an android with usb plugged.
The live-reload works. It shows blank screen sometimes, but it's not annoying. One can simply press return
on the phone, the page will reload again.
The build command also works, install the right .apk (~28 MB)
export NODE_ENV=development
phonegap analytics off
phonegap run android -d --device
However, when I use the adobe phonegap build to build the app, it build a much smaller .apk (~3.4 MB), and shows a white screen.
test project generated with phonegap run android
:
βββ AndroidManifest.xml
βββ assets
βΒ Β βββ www
βΒ Β βββ c28e4029ac8795ebc20a.main.js
βΒ Β βββ cordova.js
βΒ Β βββ cordova-js-src
βΒ Β βββ cordova_plugins.js
βΒ Β βββ i-f7-ios.png
βΒ Β βββ index.html
βΒ Β βββ styles.css
βββ classes.dex
βββ META-INF
βΒ Β βββ CERT.RSA
βΒ Β βββ CERT.SF
βΒ Β βββ MANIFEST.MF
βββ res
...
βΒ Β βββ xml
βΒ Β βββ config.xml
βββ resources.arsc
test project generated in phonegap service:
βββ AndroidManifest.xml
βββ assets
βΒ Β βββ www
βΒ Β βββ assets
βΒ Β βββ cordova.js
βΒ Β βββ cordova_plugins.js
βΒ Β βββ hooks
βΒ Β βββ index.html
βΒ Β βββ main.js
βΒ Β βββ main.vue
βΒ Β βββ package.json
βΒ Β βββ phonegap.js
βΒ Β βββ routes.js
βΒ Β βββ webpack
βΒ Β βββ webpack.config.js
βΒ Β βββ www
βββ classes.dex
βββ META-INF
βΒ Β βββ CERT.RSA
βΒ Β βββ CERT.SF
βΒ Β βββ MANIFEST.MF
βββ res
...
βΒ Β βββ xml
βΒ Β βββ config.xml
βββ resources.arsc
Any other suggestions please?
I thought the issue may be the folder structure. So I make a test project
my project:
βββ app
βΒ Β βββ config.xml
βΒ Β βββ Dockerfile
βΒ Β βββ hooks
βΒ Β βββ node_modules
βΒ Β βββ package.json
βΒ Β βββ platforms
βΒ Β βββ plugins
βΒ Β βββ src
βΒ Β βββ webpack
βΒ Β βββ webpack.config.js
βΒ Β βββ www
βββ docker-compose.yml
βββ gradle
βΒ Β βββ wrapper
βββ gradlew
βββ gradlew.bat
βββ README.org
test project:
βββ config.xml
βββ hooks
βββ node_modules
βββ package.json
βββ platforms
βββ plugins
βββ src
βββ webpack
βββ webpack.config.js
βββ www
the test project resulted an .apk with white screen, and smaller size (141 KB vs 2.1 MB) too.
cordova build android
is successfuly building in platforms/android/build/outputs/apk/android-debug.apk
But when I want to build a release with
cordova build android --release
webpack build is failing with :
Before deploy hook started...
Checking is node modules installed...
Node modules already installed.
Starting webpack build...
Error happened when webpack build: Error: Command failed: /home/emak/code/portrait/node_modules/.bin/webpack --env.release
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
clean-webpack-plugin: /home/emak/code/portrait/www has been removed.
(node:16644) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/is
sues/56 parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
Webpack build completed to www folder successfully!
Error happened on main chain:
Error: Error happened when webpack build: Error: Command failed: /home/emak/code/portrait/node_modules/.bin/webpack --env.release
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
clean-webpack-plugin: /home/emak/code/portrait/www has been removed.
(node:16644) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/is
sues/56 parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
at exec (/home/emak/code/portrait/hooks/hookers.js:171:19)
at ChildProcess.exithandler (child_process.js:218:5)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:885:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
Error: Error happened when webpack build: Error: Command failed: /home/emak/code/portrait/node_modules/.bin/webpack --env.release
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
clean-webpack-plugin: /home/emak/code/portrait/www has been removed.
(node:16644) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/is
sues/56 parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
I tried to change webpack.config.js:L77-78
according to this messages without success.
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
How to run or build ???
Just curious if this template requires any special build instructions for deployment? To clarify, this build will work for all Phonegap/Cordova supported platforms correct? Just asking in advance because I've not built a PhoneGap/Cordova app with this many different frameworks or with Node involved. On a deadline, so I'm trying to make this transition as seamless as possible. Thanks in advance!
Hey OΔuz! I want to add you to F7 developers and contributors Slack channel! Could you email me at [email protected] and I will send you invite
Shouldn't it be under src/sass
?
https://github.com/nparashuram/cordova-plugin-browsersync
Will you add this plugin ??
Hi @centrual
Somehow the live reload functionality seems broken for me, when I run:
$ cordova run ios -- --live-reload
from my project folder
It's a completely clean project.
I get the following from the iOS simulator:
I'm running Cordova 6.4.0 and Node 7.2.1.
I'm not sure whether the template is misconfigured, or the cordova browsersync plugin is broken:
Do the live reload feature work on your machine?
Somehow i am not able to watch $route. I have two components: One for the view and one to add new items.
Routes:
{
path: '/addTodo/addTodo',
component: require('./assets/todos/pages/todos/addTodo.vue')
},
{
path: '/todos/',
component: require('./assets/todos/pages/viewTodos.vue')
}
From viewTodos.vue i switch to addTodo.vue but then after $route.back() my view does not update.
I use:
watch: {
'$route': 'doSomething'
},
Here are the $route values for each component:
viewTodo.vue
Url: /todos/
Path: /todos/
Route: {
"path": "/todos/",
"component": {
"watch": {
"$route": "loadTodos"
},
"methods": {},
"computed": {},
"staticRenderFns": [],
"__file": "C:\Users\SgtPepper\phonegap\mytime\src\assets\todos\pages\viewTodos.vue",
"beforeCreate": [
null
],
"beforeDestroy": [
null
],
"_Ctor": {}
},
"pagePath": "/todos/"
}
addTodo.vue
Url: /todos/addTodo/
Path: /todos/addTodo
Route: {
"path": "/todos/addTodo/",
"component": {
"methods": {},
"staticRenderFns": [],
"_scopeId": "data-v-6bd83e6e",
"__file": "C:\Users\SgtPepper\phonegap\mytime\src\assets\todos\pages\todos\addTodo\addTodo.vue",
"beforeCreate": [
null
],
"beforeDestroy": [
null
],
"_Ctor": {}
},
"pagePath": "/todos/addTodo/"
}
I'm trying to import a SASS partial, like so:
<style scoped lang="sass">
@import 'assets/sass/colors.scss';
</style>
It doesn't resolve though.
Hi, i have this issue after to try to add some platform:
PS D:***> cordova platform add android
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms\android
Package: ************
Name: *********
Activity: MainActivity
Android target: android-25
Subproject Path: CordovaLib
Android project created with [email protected]
Error: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
The platform is added, but, if i try "cordova run android" i have the same issue:
PS D:****> cordova run android
Error: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
Some idea? tnk!
Hi,
Thank you for your work.
It seems there is an issue with HMR on the first page.
When I try to modify the script tag inside main.vue, It reloads the entire page and I get a white screen, without any errors in the console, do you know why?
I was thinking it was due to modifications on my side but after I started with a new clone of the repo I have the same issue.
Thanks.
I am running cordova emulate ios -- --lr, Simulator loads fine but any changes in the code it disconnect from Simulator with error [WDS] Disconnected!
I am playing with Cordova plugin and right now it's difficult to re-run the command to test every line of code.
is there any fix for that?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.