-
Notifications
You must be signed in to change notification settings - Fork 340
Module browser bundle configuration using webpack #48
Changes from 8 commits
ea9763c
243d810
10ac03a
4c9b4ff
30a1d44
e0dd42e
3195c4a
ee4b77f
c0939a8
8d35f0c
815d97e
8b6fd90
b001028
c2e7a47
c0604b9
ad34073
a481a65
af2ffa0
5fc3497
90a160b
e1d68de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ dist | |
coverage | ||
typings | ||
npm-debug.log | ||
browser/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,10 @@ | |
"dependencies": { | ||
"backo2": "^1.0.2", | ||
"graphql-subscriptions": "^0.2.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, so while we're here, can you move this one in |
||
"json-loader": "^0.5.4", | ||
"lodash.isobject": "^3.0.2", | ||
"lodash.isstring": "^4.0.1", | ||
"ts-loader": "^1.2.1", | ||
"websocket": "^1.0.23" | ||
}, | ||
"scripts": { | ||
|
@@ -24,7 +26,8 @@ | |
"testonly": "mocha --reporter spec --full-trace ./dist/test/tests.js", | ||
"coverage": "node ./node_modules/istanbul/lib/cli.js cover _mocha -- --full-trace ./dist/test/tests.js", | ||
"postcoverage": "remap-istanbul --input coverage/coverage.raw.json --type lcovonly --output coverage/lcov.info", | ||
"prepublish": "npm run compile" | ||
"start": "webpack --config webpack.config.js", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't call this script start, something more meaningful: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
"prepublish": "npm run compile && npm run start" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of |
||
}, | ||
"devDependencies": { | ||
"@types/chai": "^3.4.32", | ||
|
@@ -42,11 +45,13 @@ | |
"tslint": "^3.13.0", | ||
"typed-graphql": "^1.0.1", | ||
"typescript": "^2.0.0", | ||
"typings": "^1.3.2" | ||
"typings": "^1.3.2", | ||
"webpack": "^1.13.3" | ||
}, | ||
"typings": "dist/index.d.ts", | ||
"typescript": { | ||
"definition": "dist/index.d.ts" | ||
}, | ||
"browser": "browser/bundle.js", | ||
"license": "MIT" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module.exports = { | ||
context: __dirname + "/src", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use |
||
entry: './index.ts', | ||
output: { | ||
path: __dirname + '/browser', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use |
||
filename: 'bundle.js', | ||
library: 'subscriptions_transport_ws' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Usually exported libs are in pascal case: |
||
}, | ||
resolve: { | ||
extensions: ['', '.webpack.js', '.web.js', '.ts', '.js'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not just |
||
}, | ||
module: { | ||
loaders: [ | ||
{ test: /\.ts$/, loader: 'ts-loader' }, | ||
{ test: /\.json$/, loader: 'json-loader' } | ||
] | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: reference this PR number in the changelog