2022-09-02 03:16:52 +08:00
|
|
|
/* SnappyMail Webmail (c) SnappyMail Team | Licensed under AGPL v3 */
|
2021-02-02 20:54:48 +08:00
|
|
|
const rollup2 = require('gulp-rollup-2');
|
|
|
|
const includePaths = require('rollup-plugin-includepaths');
|
|
|
|
const externalGlobals = require('rollup-plugin-external-globals');
|
|
|
|
const { config } = require('./config');
|
|
|
|
|
|
|
|
let includePathOptions = {
|
|
|
|
include: {},
|
|
|
|
paths: ['dev'],
|
|
|
|
external: [],
|
2024-07-08 07:08:40 +08:00
|
|
|
extensions: ['.js']
|
2021-02-02 20:54:48 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
exports.rollupJS = (inputFile) =>
|
|
|
|
rollup2.src({
|
|
|
|
external: ['ko'],
|
|
|
|
input: 'dev/' + inputFile,
|
|
|
|
output: [
|
|
|
|
{file: config.paths.staticJS + inputFile, format: 'iife'}
|
|
|
|
],
|
|
|
|
plugins: [
|
|
|
|
includePaths(includePathOptions),
|
|
|
|
externalGlobals({
|
|
|
|
ko: 'ko'
|
|
|
|
})
|
|
|
|
]
|
|
|
|
});
|