Skip to content

Commit da6eb81

Browse files
author
Dipak Sarkar
committed
updated for vue 3.0
1 parent 830b53c commit da6eb81

File tree

5 files changed

+2288
-1919
lines changed

5 files changed

+2288
-1919
lines changed

package.json

+6-11
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,21 @@
4848
"devDependencies": {
4949
"@babel/core": "^7.15.5",
5050
"@babel/preset-env": "^7.15.6",
51+
"@vue/cli": "^4.5.13",
52+
"@vue/cli-plugin-babel": "~4.5.0",
53+
"@vue/cli-plugin-eslint": "~4.5.0",
5154
"@vue/cli-service": "^4.5.13",
52-
"@vue/compat": "^3.2.12",
53-
"@vue/compiler-sfc": "^3.2.12",
55+
"@vue/compiler-sfc": "^3.0.0",
56+
"babel-eslint": "^10.1.0",
5457
"babel-jest": "^27.2.0",
58+
"core-js": "^3.6.5",
5559
"eslint": "^7.32.0",
5660
"eslint-plugin-import": "^2.24.2",
5761
"eslint-plugin-vue": "^7.18.0",
5862
"jest": "^27.2.0",
5963
"rollup": "^2.56.3",
60-
"rollup-plugin-buble": "^0.19.8",
61-
"rollup-plugin-commonjs": "^10.1.0",
62-
"rollup-plugin-css-only": "^3.1.0",
6364
"rollup-plugin-filesize": "^9.1.1",
64-
"rollup-plugin-node-resolve": "^5.2.0",
65-
"rollup-plugin-peer-deps-external": "^2.2.4",
66-
"rollup-plugin-replace": "^2.2.0",
67-
"rollup-plugin-terser": "^7.0.2",
6865
"rollup-plugin-vue": "^6.0.0",
69-
"vite-plugin-components": "^0.13.3",
70-
"vite-plugin-windicss": "^1.4.3",
7166
"vitepress": "^0.18.1",
7267
"vue": "^3.0.0"
7368
}

rollup.config.js

+14-109
Original file line numberDiff line numberDiff line change
@@ -1,126 +1,31 @@
11
import vue from 'rollup-plugin-vue'
2-
import buble from 'rollup-plugin-buble'
3-
import commonjs from 'rollup-plugin-commonjs'
4-
import replace from 'rollup-plugin-replace'
5-
import { terser } from 'rollup-plugin-terser'
6-
import resolve from 'rollup-plugin-node-resolve'
72
import filesize from 'rollup-plugin-filesize'
8-
import css from 'rollup-plugin-css-only'
9-
import peerDepsExternal from "rollup-plugin-peer-deps-external";
103
import pkg from './package.json'
114

125
const banner = `/**
13-
* Vue Number Format ${pkg.version}
6+
* Vue Currency Input ${pkg.version}
147
* (c) 2018-${new Date().getFullYear()} ${pkg.author}
158
* @license ${pkg.license}
169
*/`
1710

18-
const baseConfig = {
11+
export default {
1912
input: 'src/index.js',
20-
plugins: {
21-
preVue: [
22-
replace({
23-
'process.env.NODE_ENV': JSON.stringify('production')
24-
})
25-
],
26-
vue: {
27-
css: true,
28-
template: {
29-
isProduction: true
30-
}
31-
},
32-
postVue: [
33-
buble({
34-
transforms: {
35-
dangerousForOf: true
36-
}
37-
}),
38-
peerDepsExternal(),
39-
commonjs({
40-
extensions: [ '.js', '.vue' ]
41-
}),
42-
filesize()
43-
]
44-
}
45-
};
46-
47-
export default [
48-
{
49-
...baseConfig,
50-
output: {
51-
file: pkg.module,
52-
format: 'esm',
53-
exports: 'named',
54-
sourcemap: true,
55-
banner
56-
},
57-
plugins: [
58-
...baseConfig.plugins.preVue,
59-
css({
60-
output: pkg.style
61-
}),
62-
vue({
63-
...baseConfig.plugins.vue,
64-
css: false
65-
}),
66-
...baseConfig.plugins.postVue,
67-
terser({
68-
output: {
69-
ecma: 6
70-
}
71-
}),
72-
resolve()
73-
]
74-
},
75-
{
76-
...baseConfig,
77-
output: {
78-
compact: true,
13+
output: [
14+
{
7915
file: pkg.main,
8016
format: 'cjs',
81-
name: 'VueNumberFormat',
8217
exports: 'named',
83-
sourcemap: true,
8418
banner
8519
},
86-
plugins: [
87-
...baseConfig.plugins.preVue,
88-
css({
89-
output: pkg.style
90-
}),
91-
vue({
92-
...baseConfig.plugins.vue,
93-
template: {
94-
...baseConfig.plugins.vue.template,
95-
optimizeSSR: true
96-
},
97-
css: false
98-
}),
99-
...baseConfig.plugins.postVue,
100-
resolve()
101-
]
102-
},
103-
{
104-
...baseConfig,
105-
output: {
106-
compact: true,
107-
file: pkg.unpkg,
108-
format: 'iife',
109-
name: 'VueNumberFormat',
20+
{
21+
file: pkg.module,
22+
format: 'es',
11023
exports: 'named',
111-
sourcemap: true,
11224
banner
113-
},
114-
plugins: [
115-
...baseConfig.plugins.preVue,
116-
vue(baseConfig.plugins.vue),
117-
...baseConfig.plugins.postVue,
118-
terser({
119-
output: {
120-
ecma: 5
121-
}
122-
}),
123-
resolve()
124-
]
125-
}
126-
];
25+
}
26+
],
27+
plugins: [
28+
vue(),
29+
filesize()
30+
]
31+
}

src/component.vue

-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ export default {
7474
this.$emit('update:modelValue', this.emittedValue)
7575
},
7676
change() {
77-
console.log('change', arguments);
7877
this.$emit('update:modelValue', this.emittedValue)
7978
}
8079
},

src/core.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import NumberFormat from './number-format'
2-
// import options from './options'
32

43
export const CONFIG_KEY = '__input-facade__'
54

0 commit comments

Comments
 (0)