Commit 840980b0 authored by dagal's avatar dagal
Browse files

Webpack working

parent dd484e4b
......@@ -8,7 +8,7 @@
</template>
<script>
let Datepicker = require("vuejs-datepicker");
let Datepicker = require("vuejs-datepicker").default;
let VueTimepicker = require("vuejs-timepicker");
module.exports = {
......
<template>
<p>{{message}}</p>
<p id="hello-vue">{{message}}</p>
</template>
<script>
module.exports = {
name: "hello",
name: "Hello",
data: function() {
return {
message: "Hello Vue!"
......
......@@ -5,9 +5,9 @@
</template>
<script>
let Autocomplete = require("vue-single-select/dist/VueSingleSelect.vue");
let Autocomplete = require("vue-single-select").default;
export default {
module.exports = {
name: "StopSearch",
components: {Autocomplete},
props: {
......
......@@ -8,9 +8,9 @@
</template>
<script>
let DateTimePicker = require("./DateTimePicker.vue");
let DateTimePicker = require("./DateTimePicker.vue").default;
export default {
module.exports = {
name: "TimeFilter",
components: {DateTimePicker},
props: {
......
......@@ -2,29 +2,30 @@ require ("./index.css");
let L = require("leaflet");
let LContextMenu = require("leaflet-contextmenu");
let Vue = require("vue");
let Hello = require("./components/Hello.vue");
let StopPopup = require("./components/StopPopup.vue");
let XYPopup = require("./components/XYPopup.vue");
let DateTimePicker = require("./components/DateTimePicker.vue");
let TimeFilter = require("./components/TimeFilter.vue");
let StopSearch = require("./components/StopSearch.vue");
let Datepicker = require("vuejs-datepicker");
let Hello = require("./components/Hello.vue").default;
let StopPopup = require("./components/StopPopup.vue").default;
let XYPopup = require("./components/XYPopup.vue").default;
let DateTimePicker = require("./components/DateTimePicker.vue").default;
let TimeFilter = require("./components/TimeFilter.vue").default;
let StopSearch = require("./components/StopSearch.vue").default;
let Datepicker = require("vuejs-datepicker").default;
let VueTimepicker = require("vuejs-timepicker");
let PulseLoader = require("vue-spinner/dist/vue-spinner.min").PulseLoader;
let VueRouter = require("vue-router");
let Autocomplete = require("./node_modules/vue-single-select/dist/VueSingleSelect.vue");
let VueRouter = require("vue-router").default;
//let Autocomplete = require("./node_modules/vue-single-select/dist/VueSingleSelect.vue");
let Autocomplete = require("vue-single-select").default;
let getty = require("./getty");
const router = new VueRouter({mode: "history"});
window.Vue = Vue;
Vue.use(require('vue-async-computed'));
Vue.use(require("vue-async-computed").default);
Vue.use(VueRouter);
let app = new Vue({
el: '#app',
el: "#app",
router,
components: {Hello, StopPopup, XYPopup, DateTimePicker, TimeFilter, StopSearch, Datepicker, PulseLoader, VueTimepicker, Autocomplete},
components: {StopPopup, XYPopup, DateTimePicker, TimeFilter, StopSearch, Datepicker, PulseLoader, VueTimepicker, Autocomplete},
data: {
minDate: new Date(0),
maxDate: null,
......
......@@ -14,36 +14,17 @@
"vuejs-timepicker": "git+https://github.com/dgalaktionov/vuejs-timepicker.git"
},
"scripts": {
"build": "browserify index.js > ../bundle.js"
},
"browserify": {
"transform": [
[
"browserify-css",
{
"rebaseUrls": "0"
}
],
[
"babelify",
{
"presets": [
"@babel/preset-env"
]
}
],
"vueify"
]
},
"browser": {
"vue": "vue/dist/vue.common.js"
"build": "webpack --config webpack.config.js"
},
"devDependencies": {
"@babel/core": "^7.4.4",
"@babel/preset-env": "^7.4.4",
"babelify": "^10.0.0",
"browserify": "^16.2.3",
"browserify-css": "^0.14.0",
"vueify": "^9.4.1"
"css-loader": "^2.1.1",
"file-loader": "^3.0.1",
"ignore-loader": "^0.1.2",
"style-loader": "^0.23.1",
"url-loader": "^1.1.2",
"vue-loader": "^15.7.0",
"vue-template-compiler": "^2.6.10",
"webpack": "^4.30.0",
"webpack-cli": "^3.3.2"
}
}
let path = require("path");
let VueLoaderPlugin = require("vue-loader/lib/plugin");
module.exports = {
mode: "development",
entry: "./index.js",
output: {
path: path.resolve(__dirname, "."),
filename: "../bundle.js"
},
module: {
rules: [
{
test: /\.css$/,
use: [
"style-loader",
"css-loader"
]
},
{
test: /\.vue$/,
loader: "vue-loader"
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: "ignore-loader"
},
]
},
resolve: {
alias: {
'vue$': 'vue/dist/vue.js'
},
extensions: ['*', '.js', '.vue', '.json']
},
plugins: [
new VueLoaderPlugin()
]
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment