2022-07-22 10:38:24 +08:00
|
|
|
import 'dotenv/config';
|
2022-07-03 12:37:36 +08:00
|
|
|
import replace from '@rollup/plugin-replace';
|
2020-07-18 10:15:29 +08:00
|
|
|
import { terser } from 'rollup-plugin-terser';
|
2020-07-17 16:03:38 +08:00
|
|
|
|
|
|
|
export default {
|
2023-08-21 17:06:09 +08:00
|
|
|
input: 'src/tracker/index.js',
|
2020-07-17 16:03:38 +08:00
|
|
|
output: {
|
2023-03-16 07:27:05 +08:00
|
|
|
file: 'public/script.js',
|
2020-07-17 16:03:38 +08:00
|
|
|
format: 'iife',
|
|
|
|
},
|
2022-07-03 12:37:36 +08:00
|
|
|
plugins: [
|
|
|
|
replace({
|
2024-03-18 11:42:39 +08:00
|
|
|
'__COLLECT_API_HOST__': process.env.COLLECT_API_HOST || '',
|
|
|
|
'__COLLECT_API_ENDPOINT__': process.env.COLLECT_API_ENDPOINT || '/api/send',
|
2022-07-03 12:37:36 +08:00
|
|
|
delimiters: ['', ''],
|
2022-07-22 10:38:24 +08:00
|
|
|
preventAssignment: true,
|
2022-07-03 12:37:36 +08:00
|
|
|
}),
|
|
|
|
terser({ compress: { evaluate: false } }),
|
|
|
|
],
|
2020-07-17 16:03:38 +08:00
|
|
|
};
|