mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2026-07-10 08:29:17 +00:00
@@ -12,6 +12,7 @@ import json from '@rollup/plugin-json';
|
||||
import copy from 'rollup-plugin-copy';
|
||||
import copyTransform from './rollup/copy-transform';
|
||||
import license from './rollup/license';
|
||||
import checkOutput from './rollup/check-output';
|
||||
|
||||
const useServe = process.env.ROLLUP_SERVE === 'true';
|
||||
const output = useServe ? '.serve' : 'dist';
|
||||
@@ -44,11 +45,12 @@ export default [
|
||||
dir: output,
|
||||
name: 'DockerRegistryUI',
|
||||
format: 'iife',
|
||||
sourcemap: useServe
|
||||
sourcemap: useServe,
|
||||
},
|
||||
plugins: [emptyDirectories(output)].concat(
|
||||
plugins,
|
||||
html({ template: () => htmlUseref('./src/index.html', { developement: useServe, production: !useServe }) })
|
||||
html({ template: () => htmlUseref('./src/index.html', { developement: useServe, production: !useServe }) }),
|
||||
checkOutput(output)
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
40
rollup/check-output.js
Normal file
40
rollup/check-output.js
Normal file
@@ -0,0 +1,40 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
const files = [
|
||||
'docker-registry-ui.css',
|
||||
'docker-registry-ui.js',
|
||||
'fonts/MaterialIcons-Regular.eot',
|
||||
'fonts/MaterialIcons-Regular.svg',
|
||||
'fonts/MaterialIcons-Regular.ttf',
|
||||
'fonts/MaterialIcons-Regular.woff',
|
||||
'fonts/MaterialIcons-Regular.woff2',
|
||||
'fonts/Roboto-Bold.ttf',
|
||||
'fonts/Roboto-Bold.woff',
|
||||
'fonts/Roboto-Bold.woff2',
|
||||
'fonts/Roboto-Light.ttf',
|
||||
'fonts/Roboto-Light.woff',
|
||||
'fonts/Roboto-Light.woff2',
|
||||
'fonts/RobotoMono-Regular.eot',
|
||||
'fonts/RobotoMono-Regular.ttf',
|
||||
'fonts/RobotoMono-Regular.woff',
|
||||
'fonts/RobotoMono-Regular.woff2',
|
||||
'fonts/Roboto-Regular.eot',
|
||||
'fonts/Roboto-Regular.ttf',
|
||||
'fonts/Roboto-Regular.woff',
|
||||
'fonts/Roboto-Regular.woff2',
|
||||
'images/docker-logo.svg',
|
||||
'index.html',
|
||||
];
|
||||
|
||||
export default function (output) {
|
||||
return {
|
||||
name: 'check-output',
|
||||
writeBundle: () => {
|
||||
const missingFile = files.find((file) => !fs.existsSync(path.join(output, file)));
|
||||
if (missingFile) {
|
||||
throw new Error(`File ${missingFile} is missing after build`);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user