File tree Expand file tree Collapse file tree 2 files changed +41
-1
lines changed Expand file tree Collapse file tree 2 files changed +41
-1
lines changed Original file line number Diff line number Diff line change 2
2
"name" : " openbci-utilities" ,
3
3
"version" : " 0.3.0" ,
4
4
"description" : " The official utility package of Node.js SDK for the OpenBCI Biosensor Boards." ,
5
- "main" : " dist/openbci.utils .js" ,
5
+ "main" : " dist/openbciutilities.umd .js" ,
6
6
"module" : " src/index.js" ,
7
7
"scripts" : {
8
8
"build" : " webpack" ,
Original file line number Diff line number Diff line change
1
+ const path = require ( 'path' ) ;
2
+
3
+ const library = 'OpenBCIUtilities' ;
4
+ const libraryExport = 'default' ;
5
+
6
+ const config = {
7
+ entry : './src/index.js' ,
8
+ module : {
9
+ rules : [
10
+ {
11
+ test : / \. j s $ / ,
12
+ exclude : / ( n o d e _ m o d u l e s ) / ,
13
+ use : {
14
+ loader : 'babel-loader'
15
+ }
16
+ }
17
+ ]
18
+ } ,
19
+ devtool : 'eval' ,
20
+ devServer : {
21
+ compress : true ,
22
+ port : 9000
23
+ }
24
+ } ;
25
+
26
+ const exportLibraryTarget = libraryTarget =>
27
+ Object . assign ( { } , config , {
28
+ output : {
29
+ path : path . resolve ( __dirname , 'dist' ) ,
30
+ filename : `${ library . toLowerCase ( ) } .${ libraryTarget } .js` ,
31
+ library,
32
+ libraryTarget,
33
+ libraryExport
34
+ }
35
+ } ) ;
36
+
37
+ module . exports = [
38
+ exportLibraryTarget ( 'umd' ) ,
39
+ exportLibraryTarget ( 'var' ) ,
40
+ ] ;
You can’t perform that action at this time.
0 commit comments