This is simple boilerplate for develop vuejs projects without NPM & Webpack.
$ git clone https://github.com/fachryansyah/vue-spa-without-npm.git
You can add 3rd libraries or plugin stored in src/lib. and register your libraries to config.js example using jQuery.
require.config({
baseUrl: "src",
paths: {
// from libs
jQuery: "lib/jquery.min"
}
})
And register again in main.js like this.
require(["config"], function() {
require(["app", "Uikit", "UikitIcons", "jQuery"])
})
For setting route page you must register that page stored in src/pages to config.js
require.config({
baseUrl: "src",
paths: {
...
// from pages
HomePage: "pages/Home.vue",
ArticlePage: "pages/Article.vue",
...
}
})
so you can use on router.js like this.
define(function(require){
...
// its your pages
let HomePage = require("HomePage")
let ArticlePage = require("ArticlePage")
// define your route pages here..
const routes = [
{
path: "/",
component: HomePage,
name: "Home"
},
{
path: "/article",
component: ArticlePage,
name: "Article"
}
]
...
})