diff --git a/package.json b/package.json index 29abb24..bbd3af3 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,9 @@ "description": "DatetimePicker component for Vuetify.js.", "main": "src/index.js", "scripts": { - "dev": "webpack-dev-server --config webpack/webpack.dev.config.js", - "build": "webpack --config webpack/webpack.build.config.js --progress --profile --colors", - "deploy": "npm run build && npm publish --registry https://registry.npmjs.org/", - "docs": "webpack --config webpack/webpack.docs.config.js --progress --profile --colors" + "dev": "vite", + "build": "vite build", + "serve": "vite preview" }, "author": "Darren Fang ", "license": "MIT", @@ -16,43 +15,22 @@ "url": "git+https://github.com/darrenfang/vuetify-datetime-picker" }, "devDependencies": { - "@babel/core": "^7.5.5", - "@babel/preset-env": "^7.5.5", "@fortawesome/fontawesome-free": "^5.10.1", - "babel-loader": "^8.0.6", - "clean-webpack-plugin": "^3.0.0", - "css-loader": "^3.2.0", - "deepmerge": "^4.0.0", - "eslint": "^6.1.0", - "eslint-config-standard": "^13.0.1", - "eslint-loader": "^2.2.1", - "eslint-plugin-import": "^2.18.2", - "eslint-plugin-node": "^9.1.0", - "eslint-plugin-promise": "^4.2.1", - "eslint-plugin-standard": "^4.0.0", - "eslint-plugin-vue": "^5.2.3", - "fibers": "^4.0.1", - "file-loader": "^4.2.0", - "html-webpack-plugin": "^3.2.0", - "less-loader": "^5.0.0", - "prettier": "1.18.2", - "sass": "^1.22.10", - "sass-loader": "^7.2.0", - "stylus": "^0.54.5", - "stylus-loader": "^3.0.2", - "url-loader": "^2.1.0", - "vue-loader": "^15.7.1", - "vue-style-loader": "^4.1.2", - "vue-template-compiler": "^2.6.10", - "vuetify-loader": "^1.3.0", - "webpack": "^4.39.2", - "webpack-cli": "^3.3.6", - "webpack-dev-server": "^3.8.0", - "webpack-merge": "^4.2.1" + "sass": "1.32.13", + "stylus": "^0.58.1", + "vite": "^2.6.13", + "vue-template-compiler": "^2.6.14" }, "dependencies": { "date-fns": "^2.1.0", - "vue": "^2.6.10", - "vuetify": "^2.1.3" + "eslint": "7.32.0", + "eslint-config-airbnb-base": "^14.2.1", + "eslint-import-resolver-alias": "^1.1.2", + "eslint-plugin-import": "^2.24.2", + "eslint-plugin-vue": "7.16.0", + "vite-plugin-components": "^0.13.2", + "vite-plugin-vue2": "^1.4.0", + "vue": "^2.6.12", + "vuetify": "^2.5.8" } } diff --git a/src/index.html b/src/index.html index 46322c4..6dbfa86 100644 --- a/src/index.html +++ b/src/index.html @@ -26,7 +26,7 @@ - <%= htmlWebpackPlugin.options.title %> + Vuetify Datetime picker
+ diff --git a/src/index.js b/src/index.js index 4b5c626..e16aff9 100644 --- a/src/index.js +++ b/src/index.js @@ -23,10 +23,6 @@ * */ -import DatetimePicker from './components/DatetimePicker' +import VDatetimePicker from './components/DatetimePicker.vue' -const install = Vue => { - Vue.component('v-datetime-picker', DatetimePicker) -} - -export default install +export { VDatetimePicker } diff --git a/src/main.js b/src/main.js index 3f1a55a..b2ccaab 100644 --- a/src/main.js +++ b/src/main.js @@ -2,7 +2,7 @@ import 'vuetify/src/styles/main.sass' import './stylus/main.styl' import Vue from 'vue' import vuetify from './plugins/vuetify' // path to vuetify export -import App from './app' +import App from './app.vue' new Vue({ vuetify, diff --git a/src/plugins/vuetify.js b/src/plugins/vuetify.js index 0638e4a..8f694e0 100644 --- a/src/plugins/vuetify.js +++ b/src/plugins/vuetify.js @@ -24,11 +24,9 @@ */ import Vue from 'vue' -import Vuetify from 'vuetify/lib' -import DatetimePicker from '../index' +import Vuetify from 'vuetify/lib/framework' Vue.use(Vuetify) -Vue.use(DatetimePicker) export default new Vuetify({ theme: { diff --git a/src/resolver.js b/src/resolver.js new file mode 100644 index 0000000..b894911 --- /dev/null +++ b/src/resolver.js @@ -0,0 +1,6 @@ +export function DatetimeResolver() { + return (name) => { + if (name === 'VDatetimePicker') + return { importName: 'VDatetimePicker', path: "." }; + }; +} diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..af652b1 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,38 @@ +import { createVuePlugin } from 'vite-plugin-vue2'; +import viteComponents, { + VuetifyResolver, +} from 'vite-plugin-components'; +import { DatetimeResolver } from './src/resolver' + +import path from 'path'; + +/** + * @type {import('vite').UserConfig} + */ +module.exports = { + resolve: { + alias: [ + { + find: '@/', + replacement: `${path.resolve(__dirname, './src')}/`, + }, + { + find: 'src/', + replacement: `${path.resolve(__dirname, './src')}/`, + }, + ], + }, + plugins: [ + createVuePlugin(), + viteComponents({ + customComponentResolvers: [ + DatetimeResolver(), + VuetifyResolver() + ], + }), + ], + server: { + host: '0.0.0.0', + port: 8080, + }, +};