1 Star 0 Fork 0

iStop/hh

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
rollup-tests.config.js 1.59 KB
一键复制 编辑 原始数据 按行查看 历史
Sean Hammond 提交于 2024-07-11 16:58 . Add Preact component tests
import { babel } from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import { nodeResolve } from '@rollup/plugin-node-resolve';
export default {
input: 'build/scripts/test-inputs.js', // Input file generated by gulp task
output: {
file: 'build/scripts/tests.bundle.js',
format: 'es',
sourcemap: true,
},
treeshake: false,
// Suppress a warning (https://rollupjs.org/guide/en/#error-this-is-undefined)
// due to https://github.com/babel/babel/issues/9149.
//
// Any code string other than "undefined" which evaluates to `undefined` will work here.
context: 'void(0)',
plugins: [
nodeResolve({
browser: true,
extensions: ['.js', '.ts', '.tsx'],
// Disallow use of browser polyfills for Node builtin modules. We're
// trying to avoid dependencies which rely on these.
//
// There are a couple of references to Node builtins that are stubbed by
// configuration for the `virtual` plugin above.
preferBuiltins: false,
}),
commonjs({
include: 'node_modules/**',
}),
babel({
babelHelpers: 'bundled',
exclude: 'node_modules/**',
extensions: ['.js', '.ts', '.tsx'],
presets: [
[
'@babel/preset-react',
{
// Turn off the `development` setting in tests to prevent warnings
// about `this`. See https://github.com/babel/babel/issues/9149.
development: false,
runtime: 'automatic',
importSource: 'preact',
},
],
],
plugins: ['mockable-imports'],
}),
],
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/istop/h_.git
git@gitee.com:istop/h_.git
istop
h_
hh
main

搜索帮助