1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
Commit graph

58 commits

Author SHA1 Message Date
Ives van Hoorne 5ab7463b93 Exploration of different config + expose webpack config (#222)
* Use next.config.js instead of package.json

* Remove irrelevant comment

* Integrate with custom webpack config

* Include hotReload option

* Remove async/await for getConfig

* Read package.json, show warning when webpack in config is defined

* Prepend warning message with WARNING

* Update log statements

* Documentation

* Restart server on change of config

* Fix process handling and cases where there is no config

* Also restart server when config file gets deleted

* Changed second parameter of webpack to config

* Support for returning Promise

* Update documentation, fix bug with webpack config

* Remove package.json, cdn and hotReload from config
2016-12-17 10:38:11 -08:00
Arunoda Susiripala b62a0e8f55 Bundle all the modules inside the app (#414)
* Remove the use of CDN and bundle everything inside the app.
We still pre-build the prefetcher because it needs
different webpack config which only targets browsers
supports Service Workers.

* Remove cdn config item.
We no longer using it.

* Stop adding script tags when staticMarkup=true

* Remove babel-plugin-transform-remove-strict-mode NPM module.
2016-12-17 17:49:10 +09:00
Naoyuki Kanezawa 1708222381 Programmatic API (#310)
* add 'next' api

* add render APIs

* add 'as' prop to Link

* check Accept header to serve json response

* check if response was finished on getInitialProps call

* move server/app to server/index

* load webpack-hot-middleware-client by absolute path

* server: options for testing

* add tests

* example: improve

* server: make dir optional

* fix client routing

* add parameterized routing example

* link: fix display url

* Add custom-server-express example (#352)

* Add custom-server-express example

* Remove extraneous nexts in express routes defs

* Update next config in server.js

* Handle accept headers totally inside Next.js (#385)

* Handle accept headers totally inside Next.js
Now user doesn't need to handle it anymore.

* Move json pages serving to /_next/pages base path.

* Join paths correctly.

* remove next/render
2016-12-16 12:33:08 -08:00
Naoyuki Kanezawa 8ddafaea5c custom document support (#405) 2016-12-16 10:42:40 -08:00
Arunoda Susiripala aa6870a4e6 Fix #204 (#401)
React addons require React in a special way.
That causes Webpack to push React into the app's bundle.
This fix adds new externals entries to prevent that.
2016-12-15 17:45:58 -08:00
Dmitry Poddubniy 45e36fdff7 fixed bug #362, also set chunks names (#363)
* fixed bug #362, also set chunks names

* set simple solution for minChunks

* revert in favor of #310
2016-12-16 03:59:59 +05:30
Arunoda Susiripala 36abdc77c5 Prefetch pages with Service Workers (#375)
* Register the service worker.

* Update prefetcher code to do prefetching.

* Implement the core prefetching API.
support "import <Link>, { prefetch } from 'next/prefetch'"

* Implement a better communication system with the service worker.

* Add a separate example for prefetching

* Fix some typos.

* Initiate service worker support even prefetching is not used.
This is pretty important since initiating will reset the cache.
If we don't do this, it's possible to have old cached resources
after the user decided to remove all of the prefetching logic.
In this case, even the page didn't prefetch it'll use the
previously cached pages. That because of there might be a already running
service worker.

* Use url module to get pathname.

* Move prefetcher code to the client from pages
Now we also do a webpack build for the prefetcher code.

* Add prefetching docs to the README.md

* Fix some typo.

* Register service worker only if asked to prefetch
We also clean the cache always, even we initialize
the service worker or not.
2016-12-15 11:13:40 -08:00
nkzawa b4ccb126d9 ignore .babelrc on babel-loader 2016-12-11 18:09:54 +09:00
Arunoda Susiripala 7086287eaf Set the default minChunks values to the length of pages. (#350)
Earlier it was for all length of entry points.
But we add two more entry points for errors.
Because of that, moving common modules to commons.js won't work.
2016-12-06 10:25:01 +01:00
Naoyuki Kanezawa edfdc482e3 fix to not call hot.accept on sub-components (#294) (#351) 2016-12-06 10:24:42 +01:00
Naoyuki Kanezawa 9990a5fc78 use react-hot-loader/webpack (#338) 2016-12-05 18:09:38 +01:00
nkzawa e1a231cd68 remove FriendlyErrorsWebpackPlugin option 2016-12-04 07:01:15 +09:00
Arunoda Susiripala 5c2e845ad7 Revert "Allow the pages directory to be in node_modules (#318)" (#324)
This reverts commit a13c6ccb11.
2016-12-02 16:58:08 +09:00
nkzawa e0fb04d685 clear console on each webpack build 2016-12-02 14:46:45 +09:00
Naoyuki Kanezawa 12f31b5bf3 Source map support (#279)
* generate source-maps on development

* remove unused dep
2016-12-02 10:43:38 +09:00
nkzawa 4a71fb6b3c Merge branch 'master' into pr/264 2016-12-02 10:21:21 +09:00
Naoyuki Kanezawa fc369fa240 webpack: emit json and apply json-loader after emitting files (#298) 2016-12-01 17:46:49 -05:00
nkzawa 214c885b90 remove unnecessary escape character for lint 2016-12-01 20:54:17 +09:00
Frederick Fogerty a13c6ccb11 Allow the pages directory to be in node_modules (#318) 2016-12-01 20:30:36 +09:00
Jonas Windey 10b815b9c9 Add react-require to avoid importing React (#295)
* Add react-require

* Add babel-plugin-react-require
2016-11-28 06:46:42 -05:00
Arunoda Susiripala fcd59adea1 Add support for webpack's CommonsChunkPlugin and remove next bundle (#301)
* Add example app which demonstrate the problem.

* Add the first working version.

* Fix lint issues.

* Add README.md

* Use /_next/main.js as the main file URI

* Add the support for loading the core next bundle.

* Optimize the output by removing Next modules from pages.

* Use the same package.json as master use.

* Change the example repo's README for simpler instructions.

* Change example projects package.json to support next build and start.

* Change main.js into commons.js.

* Add support for hot core reload and errors.

* Introduce require based on eval-script.

* Add error reporting support with hot reloading.

* Update README.md
2016-11-28 09:15:56 +09:00
Naoyuki Kanezawa a14cc66720 Remove webpack-dev-server (#276)
* remove webpack-dev-server

* webpack: fix publicPath
2016-11-23 10:32:49 -08:00
Chris Cunniff 880b71047b fixes #175, no longer sets process.env.NODE_ENV='production' or runs uglify in next dev mode (#274) 2016-11-18 16:26:17 +09:00
Jonathan Chan 1efd6b2f73 fix loader-utils spelling (#265) 2016-11-16 16:04:57 +09:00
Florian Didron 825d1878ff Removes unecessary and undisplayed default message 2016-11-16 13:05:19 +09:00
Florian Didron becf2f2a62 Adds friendly error plugin 2016-11-16 11:46:58 +09:00
Naoyuki Kanezawa c60ed0b730 webpack: load modules from NODE_PATH too (#233)
* webpack: load modules from NODE_PATH too

* fix splitting NODE_PATH
2016-11-14 13:43:31 +09:00
nkzawa e81de708b8 resolve dependency of pages/_error-debug from next root dir 2016-11-06 01:12:21 +09:00
Naoyuki Kanezawa e775721f34 Hot reload error page (#190)
* add detach-plugin

* detach-plugin: remove unused property

* watch-pages-plugin: replace _error.js when user defined one was added/removed

* dynamic-entry-plugin: delete cache

* fix HMR settings for _error.js

* render: pass error only on dev

* hot-reload: enable to hot-reload error page

* server: check if /_error has compilation errors

* webapck-dev-client: fix reloading /_error
2016-11-04 00:12:37 +09:00
nkzawa ca161c375f set babel plugins using absolute paths 2016-10-29 00:50:31 +09:00
nkzawa 990e39b13e replace babel-plugin-module-alias with babel-plugin-module-resolver 2016-10-29 00:48:14 +09:00
nodegin e763dc731b Fix #85 (#97) 2016-10-27 08:49:05 +09:00
nkzawa 42725614d9 fix WatchPagesPlugin to use webpack/hot/dev-server 2016-10-25 23:42:36 +09:00
nkzawa a9c0ae3498 use webpack/hot/dev-server to full-reload on HMR errors 2016-10-25 22:51:44 +09:00
nkzawa ba2e2aced9 webpack: fix loader exclude settings 2016-10-25 18:11:39 +09:00
nkzawa 301cd26235 dynamic-entry-plugin: improve 2016-10-24 11:38:55 +09:00
nkzawa 61dc5137f5 dynamic-entry-plugin: fix hasEntry 2016-10-24 10:55:25 +09:00
nkzawa 07b95ae080 dynamically add/remove pages 2016-10-24 01:42:13 +09:00
nkzawa ec774a39da refactor paths 2016-10-19 21:58:08 +09:00
nkzawa 2e2db37ccb add error page for debug 2016-10-19 21:41:45 +09:00
nkzawa 400b75658b write files even on error 2016-10-18 23:14:00 +09:00
nkzawa 3c44137b9b improve hot-reloading 2016-10-17 23:35:31 +09:00
nkzawa a40bba954b remove .next before compiling 2016-10-17 12:55:33 +09:00
nkzawa fb6f5d4382 change build directories structure 2016-10-17 12:55:09 +09:00
nkzawa 1be8447a26 Merge branch 'master' into add/hot-reload 2016-10-17 11:10:16 +09:00
nkzawa 9b585e91d8 move loaders 2016-10-17 10:57:51 +09:00
nkzawa 577e2c27a7 use webpack for transpiling too 2016-10-17 10:54:36 +09:00
Dan Zajdband 1477734211 Added linting using standard (#27)
* Added linting using standard

* Linting on test
2016-10-16 17:00:17 -07:00
nkzawa 82f23e2aca fix generating _error.js 2016-10-16 13:01:17 +09:00
nkzawa 3bc8fdecb3 always use write-file-webpack-plugin 2016-10-16 11:49:09 +09:00