Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import typescript from 'rollup-plugin-typescript2';
- import { terser } from "rollup-plugin-terser";
- import { sizeSnapshot } from "rollup-plugin-size-snapshot";
- import resolve from 'rollup-plugin-node-resolve';
- import commonjs from 'rollup-plugin-commonjs';
- import * as globby from "globby";
- const globbedConfigs = globby.sync('src/patterns/**/*.ts').map(inputFile => {
- const filename = inputFile.split("/")[inputFile.split("/").length-1];
- return {
- input: inputFile,
- output: {
- dir: './public/js/',
- format: 'iife',
- file: filename.replace(".ts", ".min.js"),
- name: filename.replace(".ts", ""),
- },
- plugins: [
- resolve(),
- commonjs(),
- typescript(),
- sizeSnapshot(),
- terser()
- ]
- };
- });
- export default [...globbedConfigs,{
- input: './src/scripts/main.ts',
- output: [{
- format: 'iife',
- dir: './public/js/',
- file: 'main.browser.js',
- name: 'com.compassion',
- sourcemap: true,
- }],
- plugins: [
- resolve(),
- commonjs(),
- typescript(/*{ plugin options }*/),
- sizeSnapshot(),
- ]
- },{
- input: './src/scripts/main.ts',
- output: [{
- format: 'iife',
- dir: './public/js/',
- file: 'main.browser.min.js',
- name: 'com.compassion',
- }],
- plugins: [
- resolve(),
- commonjs(),
- typescript(/*{ plugin options }*/),
- sizeSnapshot(),
- terser()
- ]
- },{
- input: './src/scripts/main.ts',
- output: {
- format: "es",
- dir: "./dist/js/",
- file: "main.module.js",
- sourcemap: true,
- },
- plugins: [
- resolve({
- browser: true,
- }),
- commonjs(),
- typescript(/*{ plugin options }*/),
- sizeSnapshot(),
- ]
- }];
Add Comment
Please, Sign In to add comment