mediacms/frontend/packages/scripts/config/helpers/buildCommonjs.js
Yiannis Stergiou aa6520daac
Frontent dev env (#247)
* Added frontend development files/environment

* More items-categories related removals

* Improvements in pages templates (inc. static pages)

* Improvements in video player

* Added empty home page message + cta

* Updates in media, playlist and management pages

* Improvements in material icons font loading

* Replaced media & playlists links in frontend dev-env

* frontend package version update

* chnaged frontend dev url port

* static files update

* Changed default position of theme switcher

* enabled frontend docker container
2021-07-11 18:01:34 +03:00

25 lines
746 B
JavaScript
Executable File

import typescript from 'rollup-plugin-typescript2';
import resolve from '@rollup/plugin-node-resolve';
import visualizer from 'rollup-plugin-visualizer';
import cleanup from 'rollup-plugin-cleanup';
export function buildCommonjs(input_file, output_folder) {
return function (filename, visualize) {
const plugins = [
resolve({ customResolveOptions: { moduleDirectories: 'node_modules' } }),
typescript(),
cleanup({ comments: 'none' }),
];
if (visualize) {
plugins.push(visualizer({ title: filename, filename: output_folder + filename + '.html' }));
}
return {
input: input_file,
output: [{ format: 'cjs', file: filename }],
plugins: plugins,
};
};
}