Skip to content

Commit

Permalink
Merge pull request #205 from dgrubelic/feature/update-infrastructure
Browse files Browse the repository at this point in the history
Feature/update infrastructure
  • Loading branch information
dgrubelic authored Mar 21, 2021
2 parents ff1360b + e34f5d8 commit 4d4b6aa
Show file tree
Hide file tree
Showing 30 changed files with 5,768 additions and 25,983 deletions.
9 changes: 9 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"useTabs": false,
"printWidth": 80,
"arrowParens": "avoid"
}
64 changes: 0 additions & 64 deletions build/build.js

This file was deleted.

83 changes: 83 additions & 0 deletions build/build.rollup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
var fs = require('fs');
var rollup = require('rollup');
var uglify = require('uglify-js');
var buble = require('@rollup/plugin-buble');
var uglify = require('rollup-plugin-uglify').uglify;
var rollupBanner = require('rollup-plugin-banner').default;
var package = require('../package.json');

var banner =
'vue-authenticate v' +
package.version +
'\n' +
'https://github.com/dgrubelic/vue-authenticate\n' +
'Released under the MIT License.\n';

function buildSource(inputOptions, outputOptions) {
rollup
.rollup(inputOptions)
.then(function (bundle) {
return bundle.generate(outputOptions).then(function (output) {
bundle.write(outputOptions);
});
})
.catch(logError);
}

buildSource(
{
input: 'src/index.js',
plugins: [buble(), rollupBanner(banner)],
},
{
file: 'dist/vue-authenticate.js',
format: 'umd',
name: 'VueAuthenticate',
}
);

buildSource(
{
input: 'src/index.js',
plugins: [buble(), uglify(), rollupBanner(banner)],
},
{
file: 'dist/vue-authenticate.min.js',
format: 'umd',
name: 'VueAuthenticate',
}
);

buildSource(
{
input: 'src/index.js',
plugins: [rollupBanner(banner)],
},
{
file: 'dist/vue-authenticate.esm.js',
format: 'es',
}
);

buildSource(
{
input: 'src/index.js',
plugins: [rollupBanner(banner)],
},
{
file: 'dist/vue-authenticate.common.js',
format: 'cjs',
}
);

function logError(e) {
console.error(e);
}

function getSize(code) {
return (((code && code.length) || 0) / 1024).toFixed(2) + 'kb';
}

function blue(str) {
return '\x1b[1m\x1b[34m' + str + '\x1b[39m\x1b[22m';
}
Loading

0 comments on commit 4d4b6aa

Please sign in to comment.