File tree Expand file tree Collapse file tree 6 files changed +476
-137
lines changed
Expand file tree Collapse file tree 6 files changed +476
-137
lines changed Original file line number Diff line number Diff line change 11{
2- "env" : {
3- "test" : {
4- "presets" : [
5- " es2015" ,
6- " stage-0"
7- ],
8- "plugins" : [
9- " external-helpers" ,
10- " transform-runtime"
11- ]
12- },
13- "development" : {
14- "presets" : [
15- [
16- " es2015" ,
17- {
18- "modules" : false
19- }
20- ],
21- " stage-0"
22- ],
23- "plugins" : [
24- " external-helpers" ,
25- " transform-runtime"
26- ]
27- }
28- }
2+ "presets" : [
3+ [" es2015" , { "modules" : false }],
4+ " stage-0"
5+ ],
6+ "plugins" : [
7+ " external-helpers" ,
8+ " transform-runtime"
9+ ]
2910}
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ clean: ## Clean up the lib folder for building
1313 @rm -rf lib
1414
1515build : clean # # Compile ES6 files to JS
16- NODE_ENV=development ./node_modules/.bin/rollup -c
16+ ./node_modules/.bin/webpack
1717
1818watch : # # continuously compile ES6 files to JS
1919 NODE_ENV=development ./node_modules/.bin/rollup -c --watch
Original file line number Diff line number Diff line change 11#!/usr/bin/env node
2+
23var path = require ( 'path' ) ;
3- var JsonGraphqlServer = require ( './../lib/' ) ;
44var express = require ( 'express' ) ;
5+ var JsonGraphqlServer = require ( '../lib/' ) ;
6+
7+ // fixme the build fails without those
8+ global . window = false ;
9+ global . document = false ;
10+ global . navigator = false ;
511
612var dataFilePath = process . argv . length > 2 ? process . argv [ 2 ] : './data.json' ;
713var data = require ( path . join ( process . cwd ( ) , dataFilePath ) ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " json-graphql-server" ,
33 "version" : " 1.0.0" ,
4- "main" : " index.js " ,
4+ "main" : " lib/ index" ,
55 "repository" :
" [email protected] :marmelab/json-graphql-server.git" ,
66 "authors" : [
77 " François Zaninotto" ,
88 " Gildas Garcia"
99 ],
10+ "files" : [
11+ " *.md" ,
12+ " lib"
13+ ],
1014 "license" : " MIT" ,
1115 "scripts" : {
1216 "build" : " make build" ,
3034 "babel-core" : " ~6.25.0" ,
3135 "babel-eslint" : " ~7.2.3" ,
3236 "babel-jest" : " ~20.0.3" ,
37+ "babel-loader" : " ^7.1.1" ,
38+ "babel-plugin-add-module-exports" : " ^0.2.1" ,
3339 "babel-plugin-external-helpers" : " ~6.22.0" ,
3440 "babel-preset-es2015" : " ~6.24.1" ,
3541 "babel-preset-stage-0" : " ~6.24.1" ,
5056 "rollup-plugin-node-builtins" : " ~2.1.2" ,
5157 "rollup-plugin-node-globals" : " ~1.1.0" ,
5258 "rollup-plugin-node-resolve" : " ~3.0.0" ,
53- "rollup-watch" : " ~4.0.0"
59+ "rollup-watch" : " ~4.0.0" ,
60+ "webpack" : " ~3.2.0"
5461 },
5562 "dependencies" : {
5663 "apollo-client" : " ~1.2.0" ,
6572 "lodash.merge" : " ~4.6.0"
6673 },
6774 "bin" : {
68- "json-graphql-server" : " bin/index .js"
75+ "json-graphql-server" : " bin/json-graphql-server .js"
6976 }
7077}
Original file line number Diff line number Diff line change 1+ const path = require ( 'path' ) ;
2+
3+ module . exports = {
4+ entry : './src/index.js' ,
5+ output : {
6+ path : path . join ( __dirname , 'lib' ) ,
7+ filename : 'index.js' ,
8+ libraryTarget : 'umd' ,
9+ } ,
10+ module : {
11+ loaders : [
12+ {
13+ test : / \. j s $ / ,
14+ exclude : / n o d e _ m o d u l e s / ,
15+ loader : 'babel-loader' ,
16+ } ,
17+ ] ,
18+ } ,
19+ } ;
You can’t perform that action at this time.
0 commit comments