Skip to content

Commit

Permalink
Update package dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Zhivka Dimova <zhivka.dimova@myforest.net>
  • Loading branch information
lovery committed Jan 20, 2023
1 parent d3f458e commit 154deb3
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 6 deletions.
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
"serve": "rollup -c -w"
},
"devDependencies": {
"@rollup/plugin-buble": "^0.21.3",
"@rollup/plugin-node-resolve": "^8.0.0",
"rollup": "^2.12.0",
"rollup-plugin-serve": "^1.0.1",
"rollup-plugin-stringify": "^19.0.2",
"rollup-plugin-terser": "^6.1.0"
"@rollup/plugin-buble": "^1.0.1",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-terser": "^0.1.0",
"eslint": "^8.28.0",
"eslint-config-seregpie": "^1.2.1",
"rollup": "^3.5.0",
"rollup-plugin-serve": "^2.0.2"
},
"peerDependencies": {
"vue": "^3"
Expand Down
74 changes: 74 additions & 0 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import {rollup} from 'rollup';
import serve from 'rollup-plugin-serve';

import buble from '@rollup/plugin-buble';
import resolve from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';

import pkg from './package.json' assert { type: 'json' };

let stringify = function({
importeePrefix = 'stringify!',
plugins = [],
} = {}) {
let ids = new Set();
return {
name: 'stringify',
async resolveId(importee, importer) {
if (importee.startsWith(importeePrefix)) {
importee = importee.slice(importeePrefix.length);
let {id} = await this.resolve(importee, importer);
ids.add(id);
return id;
}
return null;
},
async load(id) {
if (ids.has(id)) {
let bundle = await rollup({
input: id,
plugins,
});
let {output} = await bundle.generate({format: 'iife'});
let [{code}] = output;
return `export default ${JSON.stringify(code)}`;
}
return null;
},
};
};

let plugins = [
stringify({
plugins: [
buble(),
terser(),
],
}),
resolve(),
buble({objectAssign: 'Object.assign'}),
terser({mangle: {properties: {regex: //}}}),
];

if (process.env.ROLLUP_WATCH) {
plugins.push(serve({
contentBase: '',
open: true,
}));
}

let globals = {
'vue': 'Vue',
};

export default {
external: Object.keys(Object.assign(pkg.devDependencies, pkg.peerDependencies)),
input: 'src/index.js',
plugins: plugins,
output: {
file: pkg.main,
format: 'umd',
name: 'VueWordCloud',
globals,
},
};

0 comments on commit 154deb3

Please sign in to comment.