mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2025-04-26 15:09:53 +03:00
feat(riot-v5): create the skeleton for riot5
This commit is contained in:
parent
307e171ede
commit
cde932ec17
7 changed files with 125 additions and 25 deletions
39
rollup.config.js
Normal file
39
rollup.config.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
import riot from 'rollup-plugin-riot';
|
||||
import nodeResolve from '@rollup/plugin-node-resolve';
|
||||
import commonjs from '@rollup/plugin-commonjs';
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
import { emptyDirectories } from 'rollup-plugin-app-utils';
|
||||
import { babel } from '@rollup/plugin-babel';
|
||||
import scss from 'rollup-plugin-scss';
|
||||
import serve from 'rollup-plugin-serve';
|
||||
import html from '@rollup/plugin-html';
|
||||
import htmlUseref from './rollup/html-useref';
|
||||
|
||||
const useServe = process.env.ROLLUP_SERVE === 'true';
|
||||
const output = useServe ? '.serve' : 'dist';
|
||||
|
||||
const plugins = [
|
||||
riot(),
|
||||
nodeResolve(),
|
||||
commonjs(),
|
||||
scss({ output: `./${output}/docker-registry-ui.css`, outputStyle: 'compressed' }),
|
||||
babel({ babelHelpers: 'bundled', presets: ['@babel/env'] }),
|
||||
html({ template: () => htmlUseref('./src/index.html') }),
|
||||
];
|
||||
|
||||
if (useServe) {
|
||||
plugins.push(serve({ host: 'localhost', port: 8000, contentBase: [output, './'] }));
|
||||
} else {
|
||||
plugins.push(terser());
|
||||
}
|
||||
|
||||
export default [
|
||||
{
|
||||
input: { 'docker-registry-ui': 'src/index.js' },
|
||||
output: {
|
||||
dir: output,
|
||||
format: 'iife',
|
||||
},
|
||||
plugins: [emptyDirectories(output)].concat(plugins),
|
||||
},
|
||||
];
|
Loading…
Add table
Add a link
Reference in a new issue