Commit Graph

1558 Commits

Author SHA1 Message Date
Clark Du
b920f22483
refactor: add hooks (#3772) 2018-08-20 15:20:45 +01:00
Jonas Galvez
97910de3ec Improve hooks in nuxt.config.js (#3766)
* Improve hooks in nuxt.config.js

* No mult-line for
2018-08-20 14:19:09 +02:00
Alexander Lichter
e26f23b74a feat: respect beforeEnter for route if set (#3760)
* feat: respect beforeEnter for route if set

* test: add redirecting beforeEnter function and test
2018-08-18 18:15:37 +02:00
Tatsuyuki Ishi
715df92eac Use getFilename for url-loader assets (#3759)
Now they get [name] removed in production.
2018-08-18 10:00:35 +01:00
Clark Du
565ab7086a
fix: disable template literals in loadash template (#3753) 2018-08-17 09:55:24 +01:00
Jonas Galvez
280983fa88 fix: remove string interpolation from App.js (#3750)
In migrating an `1.4.2` app to edge, I came across this bug:

```
✖ fatal Error: Could not compile template /Users/jonas/.../node_modules/nuxt-edge/lib/app/App.js: layout is not defined
```

Upon much investigation, I traced it to the string interpolation used in the `App.js` template. I replaced with regular concatenation and the error was gone.
2018-08-17 09:22:52 +01:00
Clark Du
a3a8c0c9db
refactor: move UglifyJs after extend for getting updated devtool (#3748) 2018-08-16 22:35:38 +01:00
Clark Du
673a38216f refactor: extract customize webpack function (#3745) 2018-08-16 19:14:26 +02:00
Clark Du
50be809b1c
refactor: plugin sanity check (#3743) 2018-08-16 16:34:32 +01:00
Clark Du
e9bb9e7236 fix: avoid duplicate listening message 2018-08-16 10:36:54 +01:00
Clark Du
128dcbe266 refactor: add build.postcss.preset config 2018-08-15 15:22:26 +01:00
Alexander Lichter
f9637a1c86 fix: trigger watch query on trailing slash change (#3695) 2018-08-15 15:24:28 +02:00
Jonas Galvez
e6e8adb671 Minor consistency tweaks (#3726) 2018-08-15 15:23:03 +02:00
Tatsuyuki Ishi
f0045322c1 Do not remove optional tags (#3725)
Mainly, </body> getting removed results in messing up snippet injection.
2018-08-15 15:00:54 +02:00
Clark Du
1492a13162 refactor: nuxt dev watcher (#3732) 2018-08-15 13:48:34 +02:00
Jonas Galvez
f184016197 Server middleware watcher (#3718)
See https://github.com/nuxt/nuxt.js/issues/1509

Status: improving tests.
2018-08-14 19:35:25 +01:00
Clark Du
85a8af570d refactor: use resloveAlias for watch 2018-08-13 22:25:03 +01:00
Clark Du
5ddc394a50
fix: return 404 if extendRoutes without Component (#3608)
resolve #3351
2018-08-13 17:27:20 +01:00
Clark Du
09188dd173 refactor: change quiet log mode after options validated 2018-08-13 17:16:25 +01:00
Anthony Fu
0dff1b8fe9 feat: support server option in nuxt.config.js to set PORT and HOST (#3701)
* feat: support `server` option in `nuxt.config.js` to set PORT and HOST

* lint

* change the conifg priority to `argv > nuxt.config.js > env.NUXT_PORT > env.PORT > package.json > default`

* check for `options.server`
2018-08-12 15:26:30 +01:00
Clark Du
ba2b63e131 refactor: keep error logs in quiet mode 2018-08-12 14:35:24 +01:00
Clark Du
b60c4fd432 refactor: add build.quiet config 2018-08-12 14:35:24 +01:00
Jonas Galvez
ec52104ec1 Fix chokidar on() handler (#3694)
@clarkdo need to merge this asap -- related to https://github.com/nuxt/nuxt.js/pull/3633#discussion_r209436334
2018-08-11 21:43:25 +01:00
Clark Du
3a825dc773
fix: error when plugin not specify js extension (#3692) 2018-08-11 19:18:31 +01:00
Alexander Lichter
1ec5cf7b1c lint: force if braces, no lonely ifs and add store.js (#3685)
* lint: add curly and no-lonely-if

* lint: add lib/app/store.js to eslint config
2018-08-11 00:24:53 +01:00
Clark Du
c4792d247b refactor: options.test from env CI or test 2018-08-10 17:37:20 +01:00
Clark Du
cf06559fa6 refactor: remove unused option ci 2018-08-10 17:12:33 +01:00
Clark Du
4472a5003e refacotr: reduce duplicate call of plugins getter 2018-08-10 16:39:07 +01:00
Alexander Lichter
960f4fe47e feat: make appTemplatePath customizable (#3678)
related: #1925
2018-08-10 16:23:09 +01:00
Jonas Galvez
75d6c4e33a Display proper error when specified plugin isn't found (#3672)
Picking up on https://github.com/nuxt/nuxt.js/pull/3434 -- synced with dev and tests included.
2018-08-10 15:48:27 +01:00
Clark Du
9b060f3be1
feat: upgrade to Babel 7 (#3667) 2018-08-10 14:45:58 +01:00
Jonas Galvez
1842a3b5cb Relative path in custom watchers (#3673)
This was missing in #3633.
2018-08-10 11:37:05 +01:00
Jonas Galvez
8d21b60a24 Render dist options (#3671)
Picking up on [yet another abandoned PR](https://github.com/nuxt/nuxt.js/pull/2933/files). Made all changes suggested by @clarkdo and wrote a test.
2018-08-10 10:34:55 +01:00
Alexander Lichter
b4d81dc584 lint: require await in async function (#3676)
* lint: require await in async function

* lint: replace "error" with 2 in config
2018-08-10 08:41:23 +01:00
Alexander Lichter
427e836688 lint: force dot-notation where applicable (#3677) 2018-08-10 08:19:19 +01:00
Alexander Lichter
cb18aa6f53 feat: add Vue.config configuration to nuxt.config.js (#3655)
After #3564 and the request of #3427  (plus #3452) I decided to add a dedicated `vueConfig`object to the `nuxt.config.js` file.

The keys will be projected on Vue.config.

By default, `Vue.config.performance` is enabled in dev mode, `Vue.config.silent` is enabled in production mode.

Doc PR incoming.

Resolves: #2910, #3427
2018-08-08 20:05:23 +01:00
Jonas Galvez
a522aaf125 misc: add user-defined chokidar files to watch (2) (#3633)
* misc: add user-defined chokidar files to watch

* Improved user-defined chokidar files setup

* Improved user-defined chokidar files setup (2)

* Added custom file for CLI watch test

* Added cli.dev.test.js

* Added cli.dev.test.js (2)

* Remove cli-start/cli.dev, just use cli.test

* Refactored CLI test

* Missing dot in fname

* Improved user-defined chokidar files setup (3)

* Fix killNuxt()

* Remove genHandlers

* Refactored CLI test (2)

* Refactor exitCode

* Remove debugging code

* Remove debugging code (2)

* Linting

* Linting (2)

* Disable nuxt-start test for now

* Disable nuxt-start test for now (2)

* Tweaking nuxt-start test

* Tweaking nuxt-start test (2)

* Tweaking nuxt-start test (3)

* Fix ext

* Tweaked wait params

* Fix conflicts

*  hotfix

* nuxt-dev tweak

* Add blank line after variables declaration

* Disable waitFor() test due to random failure in appveyor

* Fixed error msg

* Refactored into builder.js

* Refactored into builder.js (2)

* Remove unnecessary import from nuxt-dev

* Fixed nuxt-dev test

* Debugging nuxt-dev test

* Debugging nuxt-dev test (2)

* Skip in appveyor

* Linting

* Requested changes

* Hook into nuxt-dev

* Hook into nuxt-dev (2)

* Get fname

* Get fname (2)

* Get fname (3)

* Change hook name

* Fixed conflict
2018-08-08 19:51:57 +01:00
HANATANI Takuma
69ea8e9662 Replace background-color to background in loadingIndicator (#3656) 2018-08-08 18:15:15 +02:00
Alexander Lichter
52d9629bac eslint: Prefer const over let (#3650) 2018-08-08 12:54:05 +02:00
Sébastien Chopin
a3926d5266 core: Show ip address if hostname is 0.0.0.0 2018-08-08 12:45:49 +02:00
Clark Du
6aaf839d54
feat: call global vue errorHandler in fetch and asyncData (#3652)
resolve #3335
2018-08-08 11:11:08 +01:00
Clark Du
3b5a4709e8
feat: support global command-line build and start (#3647)
With this pr, user can install nuxt globally, then start or build simple repos without npm /yarn install:


```bash
npm i nuxt-edge -g
nuxt dev/build/start
```
2018-08-07 19:50:04 +01:00
Clark Du
fe6c524be1
refactor: add deprecation log for addVendor 2018-08-07 10:24:01 +01:00
HANATANI Takuma
ba7e6c735b Use original vue-ssr instead of copy (#3644) 2018-08-07 02:58:33 +02:00
Clark Du
854e53911d refactor: use default preset for cssnano 2018-08-06 18:42:23 +01:00
Clark Du
e946df1dcf feat: upgrade css-loader to 1.0 2018-08-06 18:42:23 +01:00
Jonas Galvez
fe9dd166df Fixed conflicts 2018-08-06 06:45:39 -03:00
Jonas Galvez
6db42ffbb5 hotfix (#3634) 2018-08-06 11:32:39 +02:00
Jonas Galvez
3f1d634fb7 Consistent parens in arrow functions (#3630)
* Minor consistency enhancements

* Arrow parenthesis consistency

* Change linting rule

* Fix typo

* Update .eslintrc.js to only require parens for blocks

* Update style according to brace-only suggestion

* Remove --fix from lint

* Tweak no-loading time (failing test)

* Tweak no-loading time (failing test) (2)

* Tweak no-loading time (failing test) (3)

* Tweak no-loading time (failing test) (4)

* Tweak no-loading time (failing test) (5)
2018-08-06 02:12:44 +02:00
Jonas Galvez
0e42e98751 Add loading: false option to pages (#3629)
* Add hasManualLoading

* Add hasManualLoading (2)

* Debugging

* Debugging (2)

* Change 'manual' to false

* Add custom-page-loading example

* Add custom-page-loading example (2)

* Changed approach

* Added custom-page-loading/README.md

* Change running loading time in about.vue

* Patch loadAsyncComponents

* Added final page

* Changed approach (2)

* Fixed example

* Fixed example (2)

* Fix example package name

* Linting

* Improved examples (more to the point)

* Linting (2)

* Fix typo

* Adjust indentation

* Added noloading.vue to basic fixture

* Added noloading tests

* Linting (3)

* Debugging test

* Linting (4)

* Debugging test (2)

* Debugging test (3)
2018-08-05 23:56:49 +02:00
Clark Du
dbba872be2
misc: remove useless codes 2018-08-03 16:06:18 +01:00
HANATANI Takuma
ff32dbdb09 Fix GitHub capitalize (#3623) 2018-08-01 18:07:43 +02:00
Blake Kostner
4e2f9ca1f2 add ogv to webpack video config (#3624) 2018-08-01 18:07:18 +02:00
Clark Du
56db988f27 feat: exclude build.transpile in server node externals (#3614) 2018-07-31 15:10:24 +02:00
Clark Du
31d25df332 refactor: load all modules with esm (#3556) 2018-07-30 18:05:42 +02:00
Alexander Lichter
8c85f2299e feat(csp): add reportOnly option (#3559) 2018-07-30 18:04:02 +02:00
Clark Du
7998516b85
refactor: enable css thread pool (#3598) 2018-07-29 20:02:06 +01:00
Clark Du
5bdd0dd8a5
fix: undefined host in listening on message (#3595)
Fix error in #3529
2018-07-26 17:38:15 +01:00
Blake Kostner
ee95461cb1 resolve server listen details with server.address() (#3529)
* resolve server listen details with server.address()

* remove empty whitespace

* overwrite host and port in server listen method

* no let
2018-07-26 15:52:00 +02:00
Alexander Lichter
a37772f0f8 fix(csp): remove duplicate sha-256 hashes (#3574) 2018-07-26 15:48:28 +02:00
Clark Du
a0ca257263 fix: lost context in closures 2018-07-25 17:10:56 +01:00
Alexander Lichter
65d318d475 refactor: remove unused variables (#3576) 2018-07-25 09:00:21 +01:00
Dmitry Molotkov
5280e86dfc generate source map for uglify if devtool === #source-map (#3451)
* generate source map for uglify if devtool === #source-map

* support different variants of source-map option

* change source map to be likes in official webpack repo
https://github.com/webpack/webpack/blob/master/lib/WebpackOptionsDefaulter.js#L294

* small code cleanup
2018-07-24 13:01:51 +02:00
Alexander Lichter
e814b34508 feat: enable silent config when not in debug mode (#3564) 2018-07-23 08:59:41 +01:00
Dmitry Molotkov
87f1f312be ignore *.spec.* test files (#3528)
Add ignore for *.spec.* files in addition to *.test.*

PS the error that can happen when try to run dev without ignore and with spec js is totally  confusing and gives zero lead on what happens.
https://gist.github.com/aldarund/8542b2e477956827d9195d0f6d173a3b
Only during build there was a error printed with a proper stacktrace that was lead to my test file
2018-07-21 17:33:41 +01:00
Alexander Lichter
095404a251 refactor: change function calls when arity is one (#3563) 2018-07-20 16:42:31 +01:00
GU Yiling
b5f6ed1332 fix: inject scrollBehavior in a more tolerant way (#3560)
Currently we cannot define `scrollBehavior` like:

```js
scrollBehavior () { // ← we can have space before the parenthesis
  // ...
}
```

Fixed this by using a `RegExp` to be more tolerant.
2018-07-20 16:26:03 +01:00
Dmitry Molotkov
b0d2f674c8 exit code 1 in case of failed builds (#3535)
Fixes https://github.com/nuxt/nuxt.js/issues/3534
2018-07-20 16:12:29 +01:00
Clark Du
dfef5252de
Merge remote-tracking branch 'origin/master' into dev 2018-07-19 12:26:52 +01:00
Clark Du
e2296061b0
misc: fix typos 2018-07-18 15:39:48 +01:00
Clark Du
9afd6a55dd
refactor: obselete AggressiveSplittingPlugin 2018-07-17 12:13:06 +01:00
Clark Du
22a53464a7
fix: allow quotes in messages (#3525) 2018-07-12 21:45:14 +01:00
HG
7c852029aa
Merge pull request #3461 from ktsn/fix-scroll-behavior
fix: ensure emit triggerScroll event after scrollBehavior is called
2018-07-12 14:24:13 +01:00
Blake Kostner
842cc19431 fix(nuxt): try to resolve node_modules before alias logic (#3505)
Fixes issues with @<organization>/<package> for plugins and more.
2018-07-06 18:57:21 +04:30
Clark Du
d98c98360a refactor: smiplify csp 2018-07-01 23:43:30 +04:30
Clark Du
749da85b90 misc: remove unused cache config (#3490) 2018-07-01 23:40:44 +04:30
ktsn
bf6416ae62 fix: ensure emit triggerScroll event after scrollBehavior is called 2018-06-21 15:22:52 +09:00
Clark Du
1958ba8953
chore: remove to-do which has been done 2018-06-13 09:41:18 +01:00
zyxd
3b2ed038da fix: wait for core to be ready before listen (#3407) 2018-06-06 21:22:08 +04:30
Igor
937ce612c7 feat(csr): support custom Vue.config.errorHandler (#3337) 2018-06-02 19:16:57 +04:30
Tatsuyuki Ishi
0db21b1f54 fix: require babel-preset-vue-app directly (#3406) 2018-06-02 18:50:18 +04:30
Pooya Parsa
8acef8d01e feat: use postcss-preset-env instead of postcss-cssnext (#3291)
https://moox.io/blog/deprecating-cssnext
2018-06-02 01:41:55 +04:30
Pooya Parsa
412ffd4c06 feat: auto fallback to legacy build for node@6 support 2018-06-01 16:56:13 +04:30
Pooya Parsa
35ee689473 target SSR bundle to current node version for legacy build support 2018-06-01 16:55:02 +04:30
Pooya Parsa
3d2a7b29d1 use pify instead of utils.promisify for legacy build support 2018-06-01 16:54:37 +04:30
Pooya Parsa
727ef16920 fix(rollup): fix build warnings 2018-06-01 16:30:17 +04:30
Pooya Parsa
1f0053c160 fix(renderer): fix problem with HTMLPlugin's minify option (#3392) 2018-06-01 15:53:57 +04:30
yoyo837
b4d74b417c minify: true => fix gap between inline-block labels 2018-05-30 10:57:03 +08:00
Michael
66030467d1 fix: add title before other meta for better SEO (#3362) 2018-05-23 11:17:47 +04:30
Clark Du
93696eb60b
Revert "test: bring cli test back" 2018-05-16 08:10:20 +01:00
Clark Du
7bbd6c67a5
test: for waitUntil 2018-05-15 13:10:07 +01:00
Clark Du
e962ee19e7
test: bring cli test back 2018-05-15 12:45:09 +01:00
Sébastien Chopin
3a76475ace
Merge pull request #3341 from clarkdo/babel_whitelisting
feat: make babel-loader exclude configurable
2018-05-14 09:50:24 +02:00
Hannes Diercks
c017da10f6
fix(lib): ensure webpack inline loaders stay prefixed
when making a component path relative

fix https://github.com/nuxt/nuxt.js/issues/3314
2018-05-11 21:02:28 +02:00
Clark Du
13ae634c74
refactor: simplify build.transpile 2018-05-06 20:48:19 +01:00
Clark Du
8b0c2f1a67
feat: add build.transpile to transpile npm packages 2018-05-06 19:46:02 +01:00
Clark Du
021ba5a1e2 feat: make babel-loader exclude configurable 2018-05-06 19:20:40 +01:00
Clark Du
bd97faec59
feat(vue-loader): import SFCs from dependencies 2018-05-04 17:00:46 +01:00
Sébastien Chopin
fe30ef3525 fix: Use Component instead of paths 2018-05-04 11:36:10 +02:00
Sébastien Chopin
c6553a39cd fix: #2854 2018-05-04 10:32:26 +02:00