Skip to content

New build process #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Apr 2, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: build library config
  • Loading branch information
Javier Diaz committed Apr 2, 2019
commit fee88341cba1ee22e109ef622051785ac5909bfa
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
"license": "MIT",
"private": false,
"scripts": {
"build": "vue-cli-service build --target lib --name VueTinyPagination index.js",
"build": "rollup --config rollup.config.js",
"lint": "vue-cli-service lint",
"test:unit": "vue-cli-service test:unit",
"prepare": "yarn test:unit && yarn build"
},
"main": "dist/vue-tiny-pagination.umd.js",
"module": "dist/vue-tiny-pagination.esm.js",
"unpkg": "dist/vue-tiny-pagination.min.js",
"repository": {
"type": "git",
"url": "git+https://github.com/coderdiaz/vue-tiny-pagination.git"
Expand Down Expand Up @@ -45,6 +48,9 @@
"babel-core": "7.0.0-bridge.0",
"babel-jest": "^23.0.1",
"node-sass": "^4.9.0",
"rollup": "^1.8.0",
"rollup-plugin-commonjs": "^9.2.3",
"rollup-plugin-vue": "^4.7.2",
"sass-loader": "^7.0.1",
"vue-template-compiler": "^2.5.17"
}
Expand Down
55 changes: 55 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import vue from 'rollup-plugin-vue';
import commonjs from 'rollup-plugin-commonjs';

export default [
// ESM build to be used with webpack/rollup.
{
input: 'index.js',
output: {
format: 'esm',
file: 'dist/vue-tiny-pagination.esm.js',
},
plugins: [
vue(),
commonjs(),
],
},
// UMD build.
{
input: 'index.js',
output: {
name: 'VueTinyPagination',
format: 'umd',
file: 'dist/vue-tiny-pagination.umd.js',
},
plugins: [
vue(),
commonjs(),
],
},
// SSR build.
{
input: 'index.js',
output: {
format: 'cjs',
file: 'dist/vue-tiny-pagination.ssr.js',
},
plugins: [
vue({ template: { optimizeSSR: true } }),
commonjs(),
],
},
// Browser build.
{
input: 'index.js',
output: {
name: 'VueTinyPagination',
format: 'iife',
file: 'dist/vue-tiny-pagination.min.js',
},
plugins: [
vue(),
commonjs(),
],
},
];
Loading