-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dipak Sarkar
committed
Sep 20, 2021
1 parent
830b53c
commit da6eb81
Showing
5 changed files
with
2,288 additions
and
1,919 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.