File tree 3 files changed +770
-13
lines changed
functions/gen-opengraph-image
3 files changed +770
-13
lines changed Original file line number Diff line number Diff line change 8
8
"@emotion/core" : " ^10.0.28" ,
9
9
"playwright-aws-lambda" : " ^0.4.0" ,
10
10
"playwright-core" : " ^0.11.1" ,
11
+ "react" : " ^16.13.0" ,
12
+ "react-dom" : " ^16.13.0" ,
11
13
"react-textfit" : " ^1.1.0"
12
14
},
13
15
"devDependencies" : {
14
16
"@babel/core" : " ^7.8.7" ,
15
17
"@babel/preset-env" : " ^7.8.7" ,
16
18
"@babel/preset-react" : " ^7.8.3" ,
19
+ "@rollup/plugin-commonjs" : " ^11.0.2" ,
20
+ "@rollup/plugin-node-resolve" : " ^7.1.1" ,
21
+ "@rollup/plugin-replace" : " ^2.3.1" ,
17
22
"rollup" : " ^2.1.0" ,
18
- "rollup-plugin-babel" : " ^4.4.0"
23
+ "rollup-plugin-babel" : " ^4.4.0" ,
24
+ "rollup-plugin-node-builtins" : " ^2.1.2" ,
25
+ "rollup-plugin-node-globals" : " ^1.4.0"
19
26
},
20
27
"scripts" : {
21
28
"build" : " rollup -c rollup.config.js"
Original file line number Diff line number Diff line change 1
1
import babel from "rollup-plugin-babel" ;
2
+ import resolve from "@rollup/plugin-node-resolve" ;
3
+ import commonjs from "@rollup/plugin-commonjs" ;
4
+ import builtins from "rollup-plugin-node-builtins" ;
5
+ import globals from "rollup-plugin-node-globals" ;
6
+ import replace from "@rollup/plugin-replace" ;
7
+ import React from "react" ;
8
+ import ReactDOM from "react-dom" ;
2
9
3
10
const config = {
4
11
input : "src/image.js" ,
5
12
output : [
6
13
{
7
14
file : `image.js` ,
8
- format : "cjs "
15
+ format : "iife "
9
16
}
10
17
] ,
11
- plugins : [ babel ( ) ]
18
+ plugins : [
19
+ resolve ( {
20
+ preferBuiltins : true
21
+ } ) ,
22
+ babel ( {
23
+ exclude : "node_modules/**"
24
+ } ) ,
25
+ commonjs ( {
26
+ namedExports : {
27
+ "react-dom" : Object . keys ( ReactDOM ) ,
28
+ react : Object . keys ( React )
29
+ }
30
+ } ) ,
31
+ replace ( {
32
+ "process.env.NODE_ENV" : JSON . stringify ( "production" )
33
+ } ) ,
34
+ globals ( ) ,
35
+ builtins ( )
36
+ ]
12
37
} ;
13
38
14
39
export default config ;
You can’t perform that action at this time.
0 commit comments