mirror of
https://github.com/qlik-oss/nebula.js.git
synced 2025-12-19 17:58:43 -05:00
52 lines
1.3 KiB
JavaScript
52 lines
1.3 KiB
JavaScript
const path = require('path');
|
|
|
|
const commonjs = require('@rollup/plugin-commonjs');
|
|
const babel = require('rollup-plugin-babel');
|
|
const { nodeResolve } = require('@rollup/plugin-node-resolve');
|
|
const postcss = require('rollup-plugin-postcss');
|
|
const replace = require('@rollup/plugin-replace');
|
|
|
|
module.exports = [
|
|
{
|
|
input: path.resolve(__dirname, 'src', 'index'),
|
|
output: {
|
|
file: path.resolve(__dirname, 'dist', 'hello-react.js'),
|
|
name: 'mystuff',
|
|
format: 'umd',
|
|
exports: 'default',
|
|
sourcemap: true,
|
|
globals: {
|
|
'@nebula.js/stardust': 'stardust',
|
|
},
|
|
},
|
|
external: ['@nebula.js/stardust'],
|
|
plugins: [
|
|
nodeResolve({
|
|
extensions: ['.js', '.jsx'],
|
|
}),
|
|
replace({
|
|
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
preventAssignment: true,
|
|
}),
|
|
babel({
|
|
babelrc: false,
|
|
include: ['src/**'],
|
|
presets: [
|
|
[
|
|
'@babel/preset-env',
|
|
{
|
|
modules: false,
|
|
targets: {
|
|
browsers: ['last 2 Chrome versions'],
|
|
},
|
|
},
|
|
],
|
|
],
|
|
plugins: [['@babel/plugin-transform-react-jsx']],
|
|
}),
|
|
postcss({}),
|
|
commonjs(),
|
|
],
|
|
},
|
|
];
|