Skip to content

Commit

Permalink
Added full config for NPM publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
icehaunter committed Sep 24, 2020
1 parent 400f4dc commit 4362d9c
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 17 deletions.
48 changes: 33 additions & 15 deletions build/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
import vue from 'rollup-plugin-vue'
import typescript from 'rollup-plugin-typescript2'
import css from 'rollup-plugin-postcss'
import path from 'path'

export default {
input: 'src/components/Datepicker.vue',
output: {
format: 'esm',
file: 'dist/Datepicker.js'
export default [
{
output: {
format: 'esm',
file: 'dist/vue3-datepicker.esm.js',
},
plugins: [
typescript(),
vue({ css: false }),
css({
extract: path.resolve('dist', 'vue3-datepicker.css'),
}),
],
},
{
output: {
format: 'cjs',
file: 'dist/vue3-datepicker.cjs.js',
exports: 'default'
},
plugins: [
typescript(),
vue({ css: false }),
css({
extract: false,
inject: false
})
],
},
].map((v) => ({
...v,
input: 'src/datepicker/Datepicker.vue',
external: ['vue', 'date-fns', 'date-fns/fp'],
plugins: [
typescript(),
vue({ css: false }),
css({
extract: true,
minimize: true
}),
// resolve(),
]
}
}))
28 changes: 27 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,37 @@
"type": "git",
"url": "https://github.com/icehaunter/vue3-datepicker.git"
},
"bugs": {
"url": "https://github.com/icehaunter/vue3-datepicker/issues"
},
"private": false,
"name": "vue3-datepicker",
"version": "0.1.0",
"publishConfig": {
"access": "public"
},
"description": "A simple Vue 3 datepicker component. Supports disabling of dates, translations. Dependent on date-fns.",
"keywords": [
"vue",
"vue 3",
"component",
"datepicker",
"date-picker",
"calendar",
"date-fns"
],
"main": "dist/vue3-datepicker.cjs.js",
"module": "dist/vue3-datepicker.esm.js",
"style": "dist/vue3-datepicker.css",
"types": "dist/Datepicker.vue.d.ts",
"files": [
"src/datepicker",
"dist"
],
"scripts": {
"dev": "vite",
"build": "vite build"
"build:demo": "vite build",
"build:component": "rollup -c build/rollup.config.js"
},
"devDependencies": {
"@vue/compiler-sfc": "^3.0.0",
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
// this enables stricter inference for data properties on `this`
"strict": true,
"jsx": "preserve",
"moduleResolution": "node"
"moduleResolution": "node",
"declaration": true
},
"exclude": [
"node_modules",
Expand Down

0 comments on commit 4362d9c

Please sign in to comment.