Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrollup.build.js
More file actions
Latest commit
56 lines (48 loc) · 1.04 KB
/
Copy pathrollup.build.js
File metadata and controls
56 lines (48 loc) · 1.04 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
constrollup=require('rollup');
constbabel=require('rollup-plugin-babel');
constresolve=require('rollup-plugin-node-resolve');
constcommonjs=require('rollup-plugin-commonjs');
constplugins=[
resolve({}),
commonjs(),
babel({
babelrc: false,
presets: [
[
'env',
{
targets: {
node: 'current',
},
modules: false,
loose: true,
},
],
],
}),
];
asyncfunctionbuild(){
letinputOptions={
input: 'src/react.index.js',
plugins: plugins,
};
letoutputOptions={
format: 'es',
file: 'priv/elixir_script/react.js',
sourcemap: 'inline',
};
letbundle=awaitrollup.rollup(inputOptions);
awaitbundle.write(outputOptions);
inputOptions={
input: 'src/react_dom.index.js',
plugins: plugins,
};
outputOptions={
format: 'es',
file: 'priv/elixir_script/react_dom.js',
sourcemap: 'inline',
};
bundle=awaitrollup.rollup(inputOptions);
awaitbundle.write(outputOptions);
}
build();