Skip to content

Commit

Permalink
updated for vue 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Dipak Sarkar committed Sep 20, 2021
1 parent 830b53c commit da6eb81
Show file tree
Hide file tree
Showing 5 changed files with 2,288 additions and 1,919 deletions.
17 changes: 6 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,21 @@
"devDependencies": {
"@babel/core": "^7.15.5",
"@babel/preset-env": "^7.15.6",
"@vue/cli": "^4.5.13",
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-service": "^4.5.13",
"@vue/compat": "^3.2.12",
"@vue/compiler-sfc": "^3.2.12",
"@vue/compiler-sfc": "^3.0.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^27.2.0",
"core-js": "^3.6.5",
"eslint": "^7.32.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-vue": "^7.18.0",
"jest": "^27.2.0",
"rollup": "^2.56.3",
"rollup-plugin-buble": "^0.19.8",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-css-only": "^3.1.0",
"rollup-plugin-filesize": "^9.1.1",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-vue": "^6.0.0",
"vite-plugin-components": "^0.13.3",
"vite-plugin-windicss": "^1.4.3",
"vitepress": "^0.18.1",
"vue": "^3.0.0"
}
Expand Down
123 changes: 14 additions & 109 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,126 +1,31 @@
import vue from 'rollup-plugin-vue'
import buble from 'rollup-plugin-buble'
import commonjs from 'rollup-plugin-commonjs'
import replace from 'rollup-plugin-replace'
import { terser } from 'rollup-plugin-terser'
import resolve from 'rollup-plugin-node-resolve'
import filesize from 'rollup-plugin-filesize'
import css from 'rollup-plugin-css-only'
import peerDepsExternal from "rollup-plugin-peer-deps-external";
import pkg from './package.json'

const banner = `/**
* Vue Number Format ${pkg.version}
* Vue Currency Input ${pkg.version}
* (c) 2018-${new Date().getFullYear()} ${pkg.author}
* @license ${pkg.license}
*/`

const baseConfig = {
export default {
input: 'src/index.js',
plugins: {
preVue: [
replace({
'process.env.NODE_ENV': JSON.stringify('production')
})
],
vue: {
css: true,
template: {
isProduction: true
}
},
postVue: [
buble({
transforms: {
dangerousForOf: true
}
}),
peerDepsExternal(),
commonjs({
extensions: [ '.js', '.vue' ]
}),
filesize()
]
}
};

export default [
{
...baseConfig,
output: {
file: pkg.module,
format: 'esm',
exports: 'named',
sourcemap: true,
banner
},
plugins: [
...baseConfig.plugins.preVue,
css({
output: pkg.style
}),
vue({
...baseConfig.plugins.vue,
css: false
}),
...baseConfig.plugins.postVue,
terser({
output: {
ecma: 6
}
}),
resolve()
]
},
{
...baseConfig,
output: {
compact: true,
output: [
{
file: pkg.main,
format: 'cjs',
name: 'VueNumberFormat',
exports: 'named',
sourcemap: true,
banner
},
plugins: [
...baseConfig.plugins.preVue,
css({
output: pkg.style
}),
vue({
...baseConfig.plugins.vue,
template: {
...baseConfig.plugins.vue.template,
optimizeSSR: true
},
css: false
}),
...baseConfig.plugins.postVue,
resolve()
]
},
{
...baseConfig,
output: {
compact: true,
file: pkg.unpkg,
format: 'iife',
name: 'VueNumberFormat',
{
file: pkg.module,
format: 'es',
exports: 'named',
sourcemap: true,
banner
},
plugins: [
...baseConfig.plugins.preVue,
vue(baseConfig.plugins.vue),
...baseConfig.plugins.postVue,
terser({
output: {
ecma: 5
}
}),
resolve()
]
}
];
}
],
plugins: [
vue(),
filesize()
]
}
1 change: 0 additions & 1 deletion src/component.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export default {
this.$emit('update:modelValue', this.emittedValue)
},
change() {
console.log('change', arguments);
this.$emit('update:modelValue', this.emittedValue)
}
},
Expand Down
1 change: 0 additions & 1 deletion src/core.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import NumberFormat from './number-format'
// import options from './options'

export const CONFIG_KEY = '__input-facade__'

Expand Down
Loading

0 comments on commit da6eb81

Please sign in to comment.