From 6c5b19f60d869b207e23617ff853c44704d727e4 Mon Sep 17 00:00:00 2001 From: tbl0605 Date: Sun, 27 Aug 2023 14:44:18 +0200 Subject: [PATCH 1/9] Initial vue 3 support --- .prettierrc.json | 6 + build/rollup.config.js | 26 +- example/src/App.vue | 589 +-- example/src/main.js | 8 +- example/webpack.config.js | 49 +- lib/misc.js | 49 +- lib/vue-simple-suggest.vue | 500 +- package-lock.json | 9427 +++++++++++++++++------------------- package.json | 50 +- 9 files changed, 5238 insertions(+), 5466 deletions(-) create mode 100644 .prettierrc.json diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 00000000..69272f33 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,6 @@ +{ + "semi": false, + "singleQuote": true, + "trailingComma": "none", + "allowParens": "avoid" +} diff --git a/build/rollup.config.js b/build/rollup.config.js index 17923337..206721c0 100644 --- a/build/rollup.config.js +++ b/build/rollup.config.js @@ -1,11 +1,11 @@ -const vue = require('rollup-plugin-vue2'); -const css = require('rollup-plugin-css-only'); -const babel = require('rollup-plugin-babel'); -const nodeResolve = require('rollup-plugin-node-resolve'); -const commonjs = require('rollup-plugin-commonjs'); -const { uglify } = require('rollup-plugin-uglify'); +const vue = require('rollup-plugin-vue') +const css = require('rollup-plugin-css-only') +const babel = require('rollup-plugin-babel') +const nodeResolve = require('rollup-plugin-node-resolve') +const commonjs = require('rollup-plugin-commonjs') +const { uglify } = require('rollup-plugin-uglify') -module.exports = exports = function( +module.exports = exports = function ( compress = false, polyfills = { arrows: true, @@ -15,7 +15,7 @@ module.exports = exports = function( }, defineInWindow = false ) { - const babelPlugins = []; + const babelPlugins = [] if (polyfills.assign) { babelPlugins.push('transform-object-assign') @@ -31,23 +31,23 @@ module.exports = exports = function( const plugins = [ vue(), - css({ output: 'dist/styles.css' }), + css({ output: 'styles.css' }), babel({ exclude: 'node_modules/**', runtimeHelpers: false, presets: polyfills.arrows ? ['stage-3', 'es2015-rollup'] : [], plugins: babelPlugins }), - nodeResolve({ mainFields: ['browser', 'jsnext:main', 'main'] }), + nodeResolve(), commonjs() - ]; + ] if (compress) { - plugins.push(uglify()); + plugins.push(uglify()) } return { input: defineInWindow ? 'lib/window.js' : 'lib/index.js', plugins - }; + } } diff --git a/example/src/App.vue b/example/src/App.vue index 6665ff8e..753171f5 100644 --- a/example/src/App.vue +++ b/example/src/App.vue @@ -1,317 +1,360 @@