webpack_rails 0.3.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/webpack_rails/ErrorMessagePlugin.js +37 -0
- data/lib/webpack_rails/engine.rb +6 -5
- data/lib/webpack_rails/node_modules/cors/CONTRIBUTING.md +35 -0
- data/lib/webpack_rails/node_modules/cors/LICENSE +9 -0
- data/lib/webpack_rails/node_modules/cors/README.md +192 -0
- data/lib/webpack_rails/node_modules/cors/lib/index.js +242 -0
- data/lib/webpack_rails/node_modules/cors/node_modules/vary/HISTORY.md +29 -0
- data/lib/webpack_rails/node_modules/cors/node_modules/vary/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/cors/node_modules/vary/README.md +91 -0
- data/lib/webpack_rails/node_modules/cors/node_modules/vary/index.js +124 -0
- data/lib/webpack_rails/node_modules/cors/node_modules/vary/package.json +72 -0
- data/lib/webpack_rails/node_modules/cors/package.json +79 -0
- data/lib/webpack_rails/node_modules/cors/test/basic-auth.js +40 -0
- data/lib/webpack_rails/node_modules/cors/test/body-events.js +81 -0
- data/lib/webpack_rails/node_modules/cors/test/cors.js +652 -0
- data/lib/webpack_rails/node_modules/cors/test/error-response.js +77 -0
- data/lib/webpack_rails/node_modules/cors/test/example-app.js +98 -0
- data/lib/webpack_rails/node_modules/cors/test/issue-2.js +56 -0
- data/lib/webpack_rails/node_modules/cors/test/issue-31.js +58 -0
- data/lib/webpack_rails/node_modules/cors/test/mocha.opts +3 -0
- data/lib/webpack_rails/node_modules/express/History.md +3025 -0
- data/lib/webpack_rails/node_modules/express/LICENSE +24 -0
- data/lib/webpack_rails/node_modules/express/Readme.md +138 -0
- data/lib/webpack_rails/node_modules/express/index.js +11 -0
- data/lib/webpack_rails/node_modules/express/lib/application.js +643 -0
- data/lib/webpack_rails/node_modules/express/lib/express.js +103 -0
- data/lib/webpack_rails/node_modules/express/lib/middleware/init.js +36 -0
- data/lib/webpack_rails/node_modules/express/lib/middleware/query.js +51 -0
- data/lib/webpack_rails/node_modules/express/lib/request.js +489 -0
- data/lib/webpack_rails/node_modules/express/lib/response.js +1053 -0
- data/lib/webpack_rails/node_modules/express/lib/router/index.js +645 -0
- data/lib/webpack_rails/node_modules/express/lib/router/layer.js +176 -0
- data/lib/webpack_rails/node_modules/express/lib/router/route.js +210 -0
- data/lib/webpack_rails/node_modules/express/lib/utils.js +300 -0
- data/lib/webpack_rails/node_modules/express/lib/view.js +173 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/HISTORY.md +170 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/README.md +135 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/index.js +231 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/HISTORY.md +171 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/README.md +103 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/index.js +188 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/HISTORY.md +274 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/README.md +82 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/db.json +6474 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/index.js +11 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/package.json +94 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/package.json +84 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/HISTORY.md +76 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/LICENSE +24 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/README.md +203 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/index.js +62 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/lib/charset.js +102 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/lib/encoding.js +118 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/lib/language.js +112 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/lib/mediaType.js +179 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/package.json +86 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/package.json +98 -0
- data/lib/webpack_rails/node_modules/express/node_modules/array-flatten/LICENSE +21 -0
- data/lib/webpack_rails/node_modules/express/node_modules/array-flatten/README.md +43 -0
- data/lib/webpack_rails/node_modules/express/node_modules/array-flatten/array-flatten.js +64 -0
- data/lib/webpack_rails/node_modules/express/node_modules/array-flatten/package.json +62 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-disposition/HISTORY.md +40 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-disposition/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-disposition/README.md +141 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-disposition/index.js +443 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-disposition/package.json +66 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-type/HISTORY.md +9 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-type/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-type/README.md +92 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-type/index.js +214 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-type/package.json +65 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie/README.md +64 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie/index.js +116 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie/package.json +68 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie-signature/History.md +38 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie-signature/Readme.md +42 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie-signature/index.js +51 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie-signature/package.json +59 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/History.md +195 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/Makefile +36 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/Readme.md +188 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/bower.json +28 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/browser.js +168 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/component.json +19 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/debug.js +197 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/node.js +209 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/node_modules/ms/History.md +66 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/node_modules/ms/LICENSE +20 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/node_modules/ms/README.md +35 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/node_modules/ms/index.js +125 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/node_modules/ms/package.json +47 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/package.json +73 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/History.md +75 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/Readme.md +274 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/index.js +529 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/lib/compat/buffer-concat.js +33 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/lib/compat/callsite-tostring.js +101 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/lib/compat/index.js +69 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/package.json +66 -0
- data/lib/webpack_rails/node_modules/express/node_modules/escape-html/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/escape-html/Readme.md +15 -0
- data/lib/webpack_rails/node_modules/express/node_modules/escape-html/index.js +29 -0
- data/lib/webpack_rails/node_modules/express/node_modules/escape-html/package.json +51 -0
- data/lib/webpack_rails/node_modules/express/node_modules/etag/HISTORY.md +71 -0
- data/lib/webpack_rails/node_modules/express/node_modules/etag/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/etag/README.md +165 -0
- data/lib/webpack_rails/node_modules/express/node_modules/etag/index.js +132 -0
- data/lib/webpack_rails/node_modules/express/node_modules/etag/package.json +73 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/HISTORY.md +90 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/README.md +133 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/index.js +151 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/node_modules/unpipe/HISTORY.md +4 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/node_modules/unpipe/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/node_modules/unpipe/README.md +43 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/node_modules/unpipe/index.js +69 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/node_modules/unpipe/package.json +59 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/package.json +81 -0
- data/lib/webpack_rails/node_modules/express/node_modules/fresh/HISTORY.md +38 -0
- data/lib/webpack_rails/node_modules/express/node_modules/fresh/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/fresh/README.md +58 -0
- data/lib/webpack_rails/node_modules/express/node_modules/fresh/index.js +57 -0
- data/lib/webpack_rails/node_modules/express/node_modules/fresh/package.json +87 -0
- data/lib/webpack_rails/node_modules/express/node_modules/merge-descriptors/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/merge-descriptors/README.md +34 -0
- data/lib/webpack_rails/node_modules/express/node_modules/merge-descriptors/index.js +57 -0
- data/lib/webpack_rails/node_modules/express/node_modules/merge-descriptors/package.json +125 -0
- data/lib/webpack_rails/node_modules/express/node_modules/methods/HISTORY.md +24 -0
- data/lib/webpack_rails/node_modules/express/node_modules/methods/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/methods/README.md +41 -0
- data/lib/webpack_rails/node_modules/express/node_modules/methods/index.js +42 -0
- data/lib/webpack_rails/node_modules/express/node_modules/methods/package.json +88 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/HISTORY.md +88 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/README.md +154 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/index.js +196 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/node_modules/ee-first/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/node_modules/ee-first/README.md +80 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/node_modules/ee-first/index.js +95 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/node_modules/ee-first/package.json +64 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/package.json +71 -0
- data/lib/webpack_rails/node_modules/express/node_modules/parseurl/HISTORY.md +42 -0
- data/lib/webpack_rails/node_modules/express/node_modules/parseurl/LICENSE +24 -0
- data/lib/webpack_rails/node_modules/express/node_modules/parseurl/README.md +107 -0
- data/lib/webpack_rails/node_modules/express/node_modules/parseurl/index.js +136 -0
- data/lib/webpack_rails/node_modules/express/node_modules/parseurl/package.json +80 -0
- data/lib/webpack_rails/node_modules/express/node_modules/path-to-regexp/History.md +36 -0
- data/lib/webpack_rails/node_modules/express/node_modules/path-to-regexp/LICENSE +21 -0
- data/lib/webpack_rails/node_modules/express/node_modules/path-to-regexp/Readme.md +35 -0
- data/lib/webpack_rails/node_modules/express/node_modules/path-to-regexp/index.js +129 -0
- data/lib/webpack_rails/node_modules/express/node_modules/path-to-regexp/package.json +184 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/HISTORY.md +66 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/README.md +137 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/index.js +345 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/forwarded/HISTORY.md +4 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/forwarded/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/forwarded/README.md +53 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/forwarded/index.js +35 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/forwarded/package.json +65 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/Cakefile +18 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/LICENSE +19 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/README.md +161 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/ipaddr.min.js +1 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/lib/ipaddr.js +439 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/package.json +60 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/src/ipaddr.coffee +374 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/test/ipaddr.test.coffee +262 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/package.json +90 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/CHANGELOG.md +88 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/CONTRIBUTING.md +1 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/LICENSE +28 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/README.md +317 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/bower.json +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/lib/index.js +15 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/lib/parse.js +186 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/lib/stringify.js +121 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/lib/utils.js +190 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/package.json +56 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/test/parse.js +478 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/test/stringify.js +259 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/test/utils.js +28 -0
- data/lib/webpack_rails/node_modules/express/node_modules/range-parser/HISTORY.md +35 -0
- data/lib/webpack_rails/node_modules/express/node_modules/range-parser/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/range-parser/README.md +48 -0
- data/lib/webpack_rails/node_modules/express/node_modules/range-parser/index.js +49 -0
- data/lib/webpack_rails/node_modules/express/node_modules/range-parser/package.json +76 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/HISTORY.md +295 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/README.md +195 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/index.js +820 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/destroy/README.md +38 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/destroy/index.js +36 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/destroy/package.json +67 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/HISTORY.md +76 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/README.md +63 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/index.js +120 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/LICENSE +16 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/README.md +42 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/inherits.js +1 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/inherits_browser.js +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/package.json +50 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/test.js +25 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/package.json +85 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/LICENSE +19 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/README.md +90 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/build/build.js +11 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/build/test.js +57 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/cli.js +8 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/mime.js +108 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/package.json +73 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/types.json +1 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/ms/History.md +66 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/ms/LICENSE +20 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/ms/README.md +35 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/ms/index.js +125 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/ms/package.json +47 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/statuses/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/statuses/README.md +114 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/statuses/codes.json +64 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/statuses/index.js +60 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/statuses/package.json +84 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/package.json +89 -0
- data/lib/webpack_rails/node_modules/express/node_modules/serve-static/HISTORY.md +284 -0
- data/lib/webpack_rails/node_modules/express/node_modules/serve-static/LICENSE +25 -0
- data/lib/webpack_rails/node_modules/express/node_modules/serve-static/README.md +235 -0
- data/lib/webpack_rails/node_modules/express/node_modules/serve-static/index.js +187 -0
- data/lib/webpack_rails/node_modules/express/node_modules/serve-static/package.json +83 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/HISTORY.md +180 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/README.md +132 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/index.js +262 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/media-typer/HISTORY.md +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/media-typer/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/media-typer/README.md +81 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/media-typer/index.js +270 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/media-typer/package.json +58 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/HISTORY.md +171 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/README.md +103 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/index.js +188 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/HISTORY.md +274 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/README.md +82 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/db.json +6474 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/index.js +11 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/package.json +94 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/package.json +84 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/package.json +93 -0
- data/lib/webpack_rails/node_modules/express/node_modules/utils-merge/LICENSE +20 -0
- data/lib/webpack_rails/node_modules/express/node_modules/utils-merge/README.md +34 -0
- data/lib/webpack_rails/node_modules/express/node_modules/utils-merge/index.js +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/utils-merge/package.json +58 -0
- data/lib/webpack_rails/node_modules/express/node_modules/vary/HISTORY.md +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/vary/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/vary/README.md +91 -0
- data/lib/webpack_rails/node_modules/express/node_modules/vary/index.js +117 -0
- data/lib/webpack_rails/node_modules/express/node_modules/vary/package.json +72 -0
- data/lib/webpack_rails/node_modules/express/package.json +167 -0
- data/lib/webpack_rails/node_modules/is-array/History.md +11 -0
- data/lib/webpack_rails/node_modules/is-array/Makefile +11 -0
- data/lib/webpack_rails/node_modules/is-array/Readme.md +27 -0
- data/lib/webpack_rails/node_modules/is-array/component.json +13 -0
- data/lib/webpack_rails/node_modules/is-array/index.js +33 -0
- data/lib/webpack_rails/node_modules/is-array/package.json +41 -0
- data/lib/webpack_rails/node_modules/is-array/test/test.html +46 -0
- data/lib/webpack_rails/node_modules/is-object/LICENSE +19 -0
- data/lib/webpack_rails/node_modules/is-object/README.md +55 -0
- data/lib/webpack_rails/node_modules/is-object/index.js +5 -0
- data/lib/webpack_rails/node_modules/is-object/package.json +91 -0
- data/lib/webpack_rails/node_modules/is-object/test/index.js +23 -0
- data/lib/webpack_rails/node_modules/is-string/CHANGELOG.md +19 -0
- data/lib/webpack_rails/node_modules/is-string/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/is-string/Makefile +61 -0
- data/lib/webpack_rails/node_modules/is-string/README.md +57 -0
- data/lib/webpack_rails/node_modules/is-string/index.js +20 -0
- data/lib/webpack_rails/node_modules/is-string/package.json +93 -0
- data/lib/webpack_rails/node_modules/is-string/test.js +36 -0
- data/lib/webpack_rails/node_modules/js-string-escape/CHANGELOG.md +9 -0
- data/lib/webpack_rails/node_modules/js-string-escape/LICENSE +21 -0
- data/lib/webpack_rails/node_modules/js-string-escape/README.md +44 -0
- data/lib/webpack_rails/node_modules/js-string-escape/index.js +22 -0
- data/lib/webpack_rails/node_modules/js-string-escape/package.json +63 -0
- data/lib/webpack_rails/node_modules/js-string-escape/test/test.js +43 -0
- data/lib/webpack_rails/node_modules/strip-ansi/index.js +6 -0
- data/lib/webpack_rails/node_modules/strip-ansi/license +21 -0
- data/lib/webpack_rails/node_modules/strip-ansi/node_modules/ansi-regex/index.js +4 -0
- data/lib/webpack_rails/node_modules/strip-ansi/node_modules/ansi-regex/license +21 -0
- data/lib/webpack_rails/node_modules/strip-ansi/node_modules/ansi-regex/package.json +86 -0
- data/lib/webpack_rails/node_modules/strip-ansi/node_modules/ansi-regex/readme.md +31 -0
- data/lib/webpack_rails/node_modules/strip-ansi/package.json +85 -0
- data/lib/webpack_rails/node_modules/strip-ansi/readme.md +33 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/README.md +109 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/client-overlay.js +35 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/client.js +131 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/README.md +15 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/client.js +30 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/index.html +18 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/package.json +14 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/server.js +41 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/webpack.config.js +22 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/helpers.js +8 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/middleware.js +83 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/History.md +20 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/License.md +19 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/Readme.md +15 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/decode.js +80 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/encode.js +64 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/index.js +4 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/package.json +96 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/test/common-index.js +3 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/test/index.js +210 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/test/tap-index.js +3 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/cli.js +47 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/index.js +6 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/node_modules/ansi-regex/index.js +4 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/node_modules/ansi-regex/license +21 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/node_modules/ansi-regex/package.json +86 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/node_modules/ansi-regex/readme.md +33 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/package.json +89 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/readme.md +43 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/package.json +58 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/process-update.js +105 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/test/client-test.js +81 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/test/helpers-test.js +22 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/test/middleware-test.js +188 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/test/mocha.opts +1 -0
- data/lib/webpack_rails/node_modules/xtend/LICENCE +19 -0
- data/lib/webpack_rails/node_modules/xtend/Makefile +4 -0
- data/lib/webpack_rails/node_modules/xtend/README.md +32 -0
- data/lib/webpack_rails/node_modules/xtend/immutable.js +17 -0
- data/lib/webpack_rails/node_modules/xtend/mutable.js +15 -0
- data/lib/webpack_rails/node_modules/xtend/package.json +88 -0
- data/lib/webpack_rails/node_modules/xtend/test.js +63 -0
- data/lib/webpack_rails/package.json +22 -0
- data/lib/webpack_rails/processor.rb +28 -9
- data/lib/webpack_rails/require_directive_processor.rb +51 -0
- data/lib/webpack_rails/sprockets_environment.rb +45 -0
- data/lib/webpack_rails/task.rb +51 -22
- data/lib/webpack_rails/webpack-task-dev-server.js +122 -0
- data/lib/webpack_rails/{webpack-task.js → webpack-task-watch.js} +0 -0
- data/lib/webpack_rails/webpack.rake +5 -5
- data/lib/webpack_rails.rb +1 -3
- metadata +346 -5
- data/lib/webpack_rails/sprockets_base_webpack.rb +0 -14
- data/lib/webpack_rails/sprockets_index_webpack.rb +0 -15
@@ -0,0 +1,17 @@
|
|
1
|
+
module.exports = extend
|
2
|
+
|
3
|
+
function extend() {
|
4
|
+
var target = {}
|
5
|
+
|
6
|
+
for (var i = 0; i < arguments.length; i++) {
|
7
|
+
var source = arguments[i]
|
8
|
+
|
9
|
+
for (var key in source) {
|
10
|
+
if (source.hasOwnProperty(key)) {
|
11
|
+
target[key] = source[key]
|
12
|
+
}
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
return target
|
17
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module.exports = extend
|
2
|
+
|
3
|
+
function extend(target) {
|
4
|
+
for (var i = 1; i < arguments.length; i++) {
|
5
|
+
var source = arguments[i]
|
6
|
+
|
7
|
+
for (var key in source) {
|
8
|
+
if (source.hasOwnProperty(key)) {
|
9
|
+
target[key] = source[key]
|
10
|
+
}
|
11
|
+
}
|
12
|
+
}
|
13
|
+
|
14
|
+
return target
|
15
|
+
}
|
@@ -0,0 +1,88 @@
|
|
1
|
+
{
|
2
|
+
"name": "xtend",
|
3
|
+
"version": "4.0.0",
|
4
|
+
"description": "extend like a boss",
|
5
|
+
"keywords": [
|
6
|
+
"extend",
|
7
|
+
"merge",
|
8
|
+
"options",
|
9
|
+
"opts",
|
10
|
+
"object",
|
11
|
+
"array"
|
12
|
+
],
|
13
|
+
"author": {
|
14
|
+
"name": "Raynos",
|
15
|
+
"email": "raynos2@gmail.com"
|
16
|
+
},
|
17
|
+
"repository": {
|
18
|
+
"type": "git",
|
19
|
+
"url": "git://github.com/Raynos/xtend.git"
|
20
|
+
},
|
21
|
+
"main": "immutable",
|
22
|
+
"scripts": {
|
23
|
+
"test": "node test"
|
24
|
+
},
|
25
|
+
"dependencies": {},
|
26
|
+
"devDependencies": {
|
27
|
+
"tape": "~1.1.0"
|
28
|
+
},
|
29
|
+
"homepage": "https://github.com/Raynos/xtend",
|
30
|
+
"contributors": [
|
31
|
+
{
|
32
|
+
"name": "Jake Verbaten"
|
33
|
+
},
|
34
|
+
{
|
35
|
+
"name": "Matt Esch"
|
36
|
+
}
|
37
|
+
],
|
38
|
+
"bugs": {
|
39
|
+
"url": "https://github.com/Raynos/xtend/issues",
|
40
|
+
"email": "raynos2@gmail.com"
|
41
|
+
},
|
42
|
+
"licenses": [
|
43
|
+
{
|
44
|
+
"type": "MIT",
|
45
|
+
"url": "http://github.com/raynos/xtend/raw/master/LICENSE"
|
46
|
+
}
|
47
|
+
],
|
48
|
+
"testling": {
|
49
|
+
"files": "test.js",
|
50
|
+
"browsers": [
|
51
|
+
"ie/7..latest",
|
52
|
+
"firefox/16..latest",
|
53
|
+
"firefox/nightly",
|
54
|
+
"chrome/22..latest",
|
55
|
+
"chrome/canary",
|
56
|
+
"opera/12..latest",
|
57
|
+
"opera/next",
|
58
|
+
"safari/5.1..latest",
|
59
|
+
"ipad/6.0..latest",
|
60
|
+
"iphone/6.0..latest"
|
61
|
+
]
|
62
|
+
},
|
63
|
+
"engines": {
|
64
|
+
"node": ">=0.4"
|
65
|
+
},
|
66
|
+
"gitHead": "94a95d76154103290533b2c55ffa0fe4be16bfef",
|
67
|
+
"_id": "xtend@4.0.0",
|
68
|
+
"_shasum": "8bc36ff87aedbe7ce9eaf0bca36b2354a743840f",
|
69
|
+
"_from": "xtend@>=4.0.0 <5.0.0",
|
70
|
+
"_npmVersion": "1.4.15",
|
71
|
+
"_npmUser": {
|
72
|
+
"name": "raynos",
|
73
|
+
"email": "raynos2@gmail.com"
|
74
|
+
},
|
75
|
+
"maintainers": [
|
76
|
+
{
|
77
|
+
"name": "raynos",
|
78
|
+
"email": "raynos2@gmail.com"
|
79
|
+
}
|
80
|
+
],
|
81
|
+
"dist": {
|
82
|
+
"shasum": "8bc36ff87aedbe7ce9eaf0bca36b2354a743840f",
|
83
|
+
"tarball": "http://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz"
|
84
|
+
},
|
85
|
+
"directories": {},
|
86
|
+
"_resolved": "http://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz",
|
87
|
+
"readme": "ERROR: No README data found!"
|
88
|
+
}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
var test = require("tape")
|
2
|
+
var extend = require("./")
|
3
|
+
var mutableExtend = require("./mutable")
|
4
|
+
|
5
|
+
test("merge", function(assert) {
|
6
|
+
var a = { a: "foo" }
|
7
|
+
var b = { b: "bar" }
|
8
|
+
|
9
|
+
assert.deepEqual(extend(a, b), { a: "foo", b: "bar" })
|
10
|
+
assert.end()
|
11
|
+
})
|
12
|
+
|
13
|
+
test("replace", function(assert) {
|
14
|
+
var a = { a: "foo" }
|
15
|
+
var b = { a: "bar" }
|
16
|
+
|
17
|
+
assert.deepEqual(extend(a, b), { a: "bar" })
|
18
|
+
assert.end()
|
19
|
+
})
|
20
|
+
|
21
|
+
test("undefined", function(assert) {
|
22
|
+
var a = { a: undefined }
|
23
|
+
var b = { b: "foo" }
|
24
|
+
|
25
|
+
assert.deepEqual(extend(a, b), { a: undefined, b: "foo" })
|
26
|
+
assert.deepEqual(extend(b, a), { a: undefined, b: "foo" })
|
27
|
+
assert.end()
|
28
|
+
})
|
29
|
+
|
30
|
+
test("handle 0", function(assert) {
|
31
|
+
var a = { a: "default" }
|
32
|
+
var b = { a: 0 }
|
33
|
+
|
34
|
+
assert.deepEqual(extend(a, b), { a: 0 })
|
35
|
+
assert.deepEqual(extend(b, a), { a: "default" })
|
36
|
+
assert.end()
|
37
|
+
})
|
38
|
+
|
39
|
+
test("is immutable", function (assert) {
|
40
|
+
var record = {}
|
41
|
+
|
42
|
+
extend(record, { foo: "bar" })
|
43
|
+
assert.equal(record.foo, undefined)
|
44
|
+
assert.end()
|
45
|
+
})
|
46
|
+
|
47
|
+
test("null as argument", function (assert) {
|
48
|
+
var a = { foo: "bar" }
|
49
|
+
var b = null
|
50
|
+
var c = void 0
|
51
|
+
|
52
|
+
assert.deepEqual(extend(b, a, c), { foo: "bar" })
|
53
|
+
assert.end()
|
54
|
+
})
|
55
|
+
|
56
|
+
test("mutable", function (assert) {
|
57
|
+
var a = { foo: "bar" }
|
58
|
+
|
59
|
+
mutableExtend(a, { bar: "baz" })
|
60
|
+
|
61
|
+
assert.equal(a.bar, "baz")
|
62
|
+
assert.end()
|
63
|
+
})
|
@@ -0,0 +1,22 @@
|
|
1
|
+
{
|
2
|
+
"name": "webpack_rails",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "",
|
5
|
+
"main": "webpack-dev-server.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
8
|
+
},
|
9
|
+
"author": "",
|
10
|
+
"license": "ISC",
|
11
|
+
"dependencies": {
|
12
|
+
"cors": "^2.7.1",
|
13
|
+
"express": "^4.13.3",
|
14
|
+
"is-array": "^1.0.1",
|
15
|
+
"is-object": "^1.0.1",
|
16
|
+
"is-string": "^1.0.4",
|
17
|
+
"js-string-escape": "^1.0.0",
|
18
|
+
"strip-ansi": "^3.0.0",
|
19
|
+
"webpack-hot-middleware": "^2.4.1",
|
20
|
+
"xtend": "^4.0.0"
|
21
|
+
}
|
22
|
+
}
|
@@ -1,24 +1,43 @@
|
|
1
1
|
require 'tilt'
|
2
2
|
|
3
|
-
require_relative './sprockets_index_webpack'
|
4
|
-
require_relative './task'
|
5
|
-
|
6
3
|
module WebpackRails
|
7
4
|
class Processor < Tilt::Template
|
5
|
+
def self.configure(webpack_task_config)
|
6
|
+
Class.new(Processor) do
|
7
|
+
self.config = webpack_task_config
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.config=(new_config)
|
12
|
+
@config = new_config
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.config
|
16
|
+
@config
|
17
|
+
end
|
18
|
+
|
8
19
|
def prepare
|
9
20
|
end
|
10
21
|
|
22
|
+
def rewrite_asset_paths(contents, context)
|
23
|
+
contents.gsub(/['"]\$asset_path\/([^'"]+?)['"]/) {|s| "'#{context.asset_path($1)}'" }
|
24
|
+
end
|
25
|
+
|
11
26
|
def evaluate(context, locals)
|
12
27
|
return data unless context.pathname.to_s.include?('.bundle')
|
13
28
|
|
14
|
-
|
15
|
-
|
29
|
+
file_contents = nil
|
30
|
+
if self.class.config[:watch]
|
31
|
+
result = WebpackRails::Task.run_webpack(self.class.config)
|
32
|
+
|
33
|
+
result[:modules].map{|m| context.depend_on m}
|
16
34
|
|
17
|
-
|
35
|
+
file_contents = context.pathname.open.read # reload file contents after build
|
36
|
+
else
|
37
|
+
file_contents = data
|
38
|
+
end
|
18
39
|
|
19
|
-
|
20
|
-
# rewrite $asset_paths in strings
|
21
|
-
bundle_contents.gsub(/['"]\$asset_path\/([^'"]+?)['"]/) {|s| "'#{context.asset_path($1)}'" }
|
40
|
+
rewrite_asset_paths(file_contents, context)
|
22
41
|
end
|
23
42
|
end
|
24
43
|
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'tilt'
|
2
|
+
|
3
|
+
module WebpackRails
|
4
|
+
class RequireDirectiveProcessor < Tilt::Template
|
5
|
+
DIRECTIVE_PATTERN = /^.*?=\s*webpack_require\s+(.*?)\s*$/
|
6
|
+
|
7
|
+
def self.configure(webpack_task_config)
|
8
|
+
Class.new(RequireDirectiveProcessor) do
|
9
|
+
self.config = webpack_task_config
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.config=(new_config)
|
14
|
+
@config = new_config
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.config
|
18
|
+
@config
|
19
|
+
end
|
20
|
+
|
21
|
+
def prepare
|
22
|
+
end
|
23
|
+
|
24
|
+
def config
|
25
|
+
self.class.config
|
26
|
+
end
|
27
|
+
|
28
|
+
def dev_server_base_url
|
29
|
+
"#{config[:protocol]}://#{config[:host]}:#{config[:port]}"
|
30
|
+
end
|
31
|
+
|
32
|
+
def process_require(context, locals, bundle_filename)
|
33
|
+
if config[:dev_server]
|
34
|
+
if bundle_filename.end_with? '.js'
|
35
|
+
return %{document.write('<script src="#{dev_server_base_url}/#{bundle_filename}"></script>');}
|
36
|
+
end
|
37
|
+
return ''
|
38
|
+
end
|
39
|
+
|
40
|
+
# will be handled by normal sprockets require
|
41
|
+
context.require_asset(bundle_filename)
|
42
|
+
return ''
|
43
|
+
end
|
44
|
+
|
45
|
+
def evaluate(context, locals)
|
46
|
+
data.gsub(DIRECTIVE_PATTERN) do |match_text|
|
47
|
+
process_require(context, locals, $1)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'sprockets'
|
2
|
+
require 'sprockets/webpack_index'
|
3
|
+
require 'webpack_rails/require_directive_processor'
|
4
|
+
require 'webpack_rails/processor'
|
5
|
+
|
6
|
+
module WebpackRails
|
7
|
+
class SprocketsEnvironment
|
8
|
+
DEFAULT_WEBPACK_TASK_CONFIG = {
|
9
|
+
dev_server: false,
|
10
|
+
protocol: 'http',
|
11
|
+
host: 'localhost',
|
12
|
+
port: 9876,
|
13
|
+
}
|
14
|
+
|
15
|
+
module EnvironmentWebpackInstanceMethods
|
16
|
+
def webpack_task_config=(new_webpack_task_config)
|
17
|
+
@webpack_task_config = new_webpack_task_config
|
18
|
+
end
|
19
|
+
|
20
|
+
def webpack_task_config
|
21
|
+
@webpack_task_config.merge(DEFAULT_WEBPACK_TASK_CONFIG).merge(@webpack_task_config)
|
22
|
+
end
|
23
|
+
|
24
|
+
def install_webpack_task_processors!
|
25
|
+
file_processor = WebpackRails::Processor.configure(webpack_task_config)
|
26
|
+
require_directive_processor = WebpackRails::RequireDirectiveProcessor.configure(webpack_task_config)
|
27
|
+
|
28
|
+
register_preprocessor 'application/javascript', file_processor
|
29
|
+
register_preprocessor 'text/css', file_processor
|
30
|
+
register_preprocessor 'application/javascript', require_directive_processor
|
31
|
+
register_preprocessor 'text/css', require_directive_processor
|
32
|
+
end
|
33
|
+
|
34
|
+
def index
|
35
|
+
Sprockets::WebpackIndex.new(self)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.enhance!(env, webpack_task_config)
|
40
|
+
env.extend(EnvironmentWebpackInstanceMethods)
|
41
|
+
env.webpack_task_config = webpack_task_config
|
42
|
+
env.install_webpack_task_processors!
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/lib/webpack_rails/task.rb
CHANGED
@@ -28,8 +28,24 @@ module WebpackRails
|
|
28
28
|
@webpack_gem_dir ||= File.dirname(File.expand_path(__FILE__))
|
29
29
|
end
|
30
30
|
|
31
|
-
def
|
32
|
-
@
|
31
|
+
def webpack_task_watch_script
|
32
|
+
@webpack_task_watch_script ||= File.join(webpack_gem_dir, 'webpack-task-watch.js')
|
33
|
+
end
|
34
|
+
|
35
|
+
def webpack_task_dev_server_script
|
36
|
+
@webpack_task_dev_server_script ||= File.join(webpack_gem_dir, 'webpack-task-dev-server.js')
|
37
|
+
end
|
38
|
+
|
39
|
+
def webpack_task_script(opts)
|
40
|
+
return webpack_task_watch_script if opts[:watch]
|
41
|
+
return webpack_task_dev_server_script if opts[:dev_server]
|
42
|
+
fail "can't determine which task to run"
|
43
|
+
end
|
44
|
+
|
45
|
+
def webpack_task_opts(opts)
|
46
|
+
opts.merge(
|
47
|
+
webpack_config_file: opts[:webpack_config_file] ? opts[:webpack_config_file].to_s : nil,
|
48
|
+
)
|
33
49
|
end
|
34
50
|
|
35
51
|
def app_node_path
|
@@ -47,26 +63,42 @@ module WebpackRails
|
|
47
63
|
return_value
|
48
64
|
end
|
49
65
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
66
|
+
# TODO: move to NodeTask
|
67
|
+
def alive?
|
68
|
+
current_pid = nil
|
69
|
+
alive = false
|
70
|
+
if @controller
|
71
|
+
begin
|
72
|
+
current_pid = @controller.pid
|
73
|
+
rescue Errno::ENOENT
|
74
|
+
end
|
75
|
+
end
|
76
|
+
if current_pid
|
77
|
+
begin
|
78
|
+
Process.getpgid(current_pid)
|
79
|
+
alive = true
|
80
|
+
rescue Errno::ESRCH
|
81
|
+
end
|
55
82
|
end
|
83
|
+
alive
|
56
84
|
end
|
57
85
|
|
58
|
-
def
|
59
|
-
|
60
|
-
|
61
|
-
|
86
|
+
def build_once(webpack_task_config)
|
87
|
+
WebpackRails::Task.with_app_node_path do
|
88
|
+
webpack_cmd_script = `#{WebpackRails::Task.node_command} -e "process.stdout.write(require.resolve('webpack/bin/webpack.js'))"`
|
89
|
+
system "#{WebpackRails::Task.node_command} #{webpack_cmd_script} --config #{webpack_task_config[:webpack_config_file]}"
|
62
90
|
end
|
91
|
+
end
|
63
92
|
|
93
|
+
def run_webpack(opts = {})
|
94
|
+
return if ENV['DISABLE_WEBPACK']
|
95
|
+
|
96
|
+
result = nil
|
64
97
|
task_duration = Benchmark.realtime do
|
65
|
-
|
98
|
+
with_app_node_path do
|
66
99
|
begin
|
67
|
-
task = self.new
|
68
|
-
task.run(opts)
|
69
|
-
build_result
|
100
|
+
task = self.new(webpack_task_script(opts))
|
101
|
+
result = task.run(webpack_task_opts(opts))
|
70
102
|
rescue NodeTask::Error => e
|
71
103
|
raise self::Error.new(e)
|
72
104
|
end
|
@@ -74,10 +106,11 @@ module WebpackRails
|
|
74
106
|
end
|
75
107
|
|
76
108
|
task_duration_ms = task_duration * 1000
|
77
|
-
if defined?(Rails) &&
|
78
|
-
|
109
|
+
if defined?(Rails) && result
|
110
|
+
if opts[:dev_server] && result[:started]
|
111
|
+
Rails.logger.info("Started webpack-dev-server in #{task_duration_ms.round(0)}ms")
|
112
|
+
end
|
79
113
|
end
|
80
|
-
|
81
114
|
result
|
82
115
|
end
|
83
116
|
|
@@ -90,9 +123,5 @@ module WebpackRails
|
|
90
123
|
wd
|
91
124
|
end
|
92
125
|
end
|
93
|
-
|
94
|
-
def initialize
|
95
|
-
super(self.class.webpack_task_script)
|
96
|
-
end
|
97
126
|
end
|
98
127
|
end
|
@@ -0,0 +1,122 @@
|
|
1
|
+
var fs = require('fs');
|
2
|
+
var path = require('path');
|
3
|
+
var xtend = require('xtend');
|
4
|
+
var isArray = require('is-array');
|
5
|
+
var isString = require('is-string');
|
6
|
+
var isObject = require('is-object');
|
7
|
+
var express = require('express');
|
8
|
+
var cors = require('cors');
|
9
|
+
|
10
|
+
// these modules are expected to be installed by the gem consumer (eg. the app)
|
11
|
+
var webpackDevMiddleware = require('webpack-dev-middleware');
|
12
|
+
var webpackHotMiddleware = require('webpack-hot-middleware');
|
13
|
+
var webpack = require('webpack');
|
14
|
+
|
15
|
+
var ErrorMessagePlugin = require('./ErrorMessagePlugin');
|
16
|
+
|
17
|
+
var loggingToFile = Boolean(process.env.WEBPACK_TASK_LOGGING);
|
18
|
+
|
19
|
+
process.on('exit', function(code) {
|
20
|
+
log(process.pid+' About to exit with code:', code);
|
21
|
+
});
|
22
|
+
|
23
|
+
var server = null;
|
24
|
+
module.exports = function waitForServer(opts, done) {
|
25
|
+
if (server) {
|
26
|
+
log('webpack already running');
|
27
|
+
return done(null, {started: false});
|
28
|
+
}
|
29
|
+
|
30
|
+
log('starting webpack');
|
31
|
+
runWebpackDevServer(opts, function(err, createdServer) {
|
32
|
+
if (err) {
|
33
|
+
logErr(err);
|
34
|
+
done(err);
|
35
|
+
}
|
36
|
+
|
37
|
+
server = createdServer;
|
38
|
+
log('server started succesfully');
|
39
|
+
done(null, {started: true});
|
40
|
+
});
|
41
|
+
};
|
42
|
+
|
43
|
+
function runWebpackDevServer(opts, done) {
|
44
|
+
opts = opts || {};
|
45
|
+
opts.protocol = opts.protocol || 'http';
|
46
|
+
opts.host = opts.host || 'localhost';
|
47
|
+
opts.port = opts.port || 9876;
|
48
|
+
opts.webpack_config_file = opts.webpack_config_file || path.resolve('./config/webpack.config.js');
|
49
|
+
|
50
|
+
var devServerConfig;
|
51
|
+
try {
|
52
|
+
devServerConfig = makeDevServerConfig(opts);
|
53
|
+
} catch (err) {
|
54
|
+
done(err);
|
55
|
+
}
|
56
|
+
|
57
|
+
// create webpack compiler instance
|
58
|
+
var compiler = webpack(devServerConfig);
|
59
|
+
|
60
|
+
// create express app
|
61
|
+
var app = express();
|
62
|
+
app.use(cors({credentials: true, origin: true}));
|
63
|
+
|
64
|
+
app.use(webpackDevMiddleware(compiler, {
|
65
|
+
publicPath: devServerConfig.output.publicPath,
|
66
|
+
}));
|
67
|
+
|
68
|
+
app.use(webpackHotMiddleware(compiler));
|
69
|
+
|
70
|
+
// spawn server
|
71
|
+
var server = app.listen(opts.port, opts.host, function() {
|
72
|
+
log('pid '+process.pid+' listening on '+opts.host+':'+opts.port);
|
73
|
+
done(null, server);
|
74
|
+
});
|
75
|
+
|
76
|
+
return server;
|
77
|
+
}
|
78
|
+
|
79
|
+
function makeDevServerConfig(opts) {
|
80
|
+
var config = require(opts.webpack_config_file);
|
81
|
+
var publicUrl = opts.protocol+'://'+opts.host+':'+opts.port;
|
82
|
+
|
83
|
+
// extend webpack config
|
84
|
+
var devServerConfig = xtend(config, {
|
85
|
+
output: xtend(config.output || {}, {
|
86
|
+
publicPath: publicUrl+'/',
|
87
|
+
path: path.resolve(config.output.path),
|
88
|
+
}),
|
89
|
+
plugins: (config.plugins || []).concat([
|
90
|
+
new webpack.optimize.OccurenceOrderPlugin(),
|
91
|
+
// https://webpack.github.io/docs/webpack-dev-server.html#hot-module-replacement
|
92
|
+
new webpack.HotModuleReplacementPlugin(),
|
93
|
+
new ErrorMessagePlugin(),
|
94
|
+
]),
|
95
|
+
});
|
96
|
+
|
97
|
+
// inject webpack-dev-server & hot module reload clients into each bundle
|
98
|
+
var devServerClientScripts = [
|
99
|
+
require.resolve('webpack-hot-middleware/client')+'?path='+publicUrl+'/__webpack_hmr',
|
100
|
+
];
|
101
|
+
|
102
|
+
if (isArray(devServerConfig.entry) || isString(devServerConfig.entry)) {
|
103
|
+
devServerConfig.entry = devServerClientScripts.concat(devServerConfig.entry);
|
104
|
+
} else if (isObject(devServerConfig.entry)) {
|
105
|
+
devServerConfig.entry = {};
|
106
|
+
Object.keys(config.entry).forEach(function(key) {
|
107
|
+
devServerConfig.entry[key] = devServerClientScripts.concat(config.entry[key]);
|
108
|
+
});
|
109
|
+
} else {
|
110
|
+
throw new Error("couldn't add hot reload client to config.entry");
|
111
|
+
}
|
112
|
+
|
113
|
+
return devServerConfig;
|
114
|
+
}
|
115
|
+
|
116
|
+
function log(message) {
|
117
|
+
if (loggingToFile) fs.appendFileSync('log/webpack-task.log', new Date()+' -- '+message+'\n');
|
118
|
+
}
|
119
|
+
|
120
|
+
function logErr(err) {
|
121
|
+
log(err.toString()+' -- '+JSON.stringify(err.stack));
|
122
|
+
}
|
File without changes
|
@@ -8,12 +8,12 @@ namespace :webpack do
|
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
-
task :
|
12
|
-
|
13
|
-
# find_asset monkey patch. instead, we just run it before precompiling assets
|
14
|
-
WebpackRails::Task.run_webpack
|
11
|
+
task :build_once => :environment do
|
12
|
+
WebpackRails::Task.build_once(Rails.application.config.webpack_rails)
|
15
13
|
end
|
16
14
|
end
|
17
15
|
|
18
16
|
# runs before every 'rake assets:precompile'
|
19
|
-
|
17
|
+
# with production config, sprockets index isn't updated correctly by the
|
18
|
+
# find_asset monkey patch. instead, we just run it before precompiling assets
|
19
|
+
Rake::Task['assets:precompile'].enhance(['webpack:build_once'])
|
data/lib/webpack_rails.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
|
-
require 'sprockets'
|
2
|
-
|
3
1
|
module WebpackRails
|
4
|
-
require_relative './webpack_rails/
|
2
|
+
require_relative './webpack_rails/require_directive_processor'
|
5
3
|
require_relative './webpack_rails/task'
|
6
4
|
require_relative './webpack_rails/processor'
|
7
5
|
require_relative './webpack_rails/engine'
|