-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.test.config.js
39 lines (36 loc) · 1.1 KB
/
rollup.test.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import nodeResolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import {babel} from '@rollup/plugin-babel';
import page from 'rollup-plugin-generate-html-template';
import styles from 'rollup-plugin-styles';
import path from "path";
import assert from "assert";
import shell from 'shelljs';
const srcDir = 'src';
const testDir = 'test';
const buildDir = 'build';
const config = {
input: `${testDir}/utils-specs.js`,
output: {
file: `${buildDir}/utils-specs.js`,
format: "iife",
sourcemap: true,
assetFileNames: "assets/[name].[ext]",
},
plugins: [
nodeResolve(), commonjs(),
styles(),
babel({
babelHelpers: 'bundled',
presets: [['@babel/preset-env', {modules: false}]],
}),
page({template: `${testDir}/cases.html`}),
{
name: 'browse', closeBundle: () => {
const opened = shell.exec(path.resolve(buildDir, 'cases.html'));
assert(opened.code === 0, opened.stderr);
}
}
]
};
export default config;