Repository: nuxt/nuxt.js (ts)

Issue:
Invalid CSS asset filenames generated, breaks site operation
### Versions

- nuxt: 2.14.17
- node: 10.15.3

### Reproduction

https://github.com/IlyaSemenov/nuxt-css-invalid-filename-reproduction

### Steps to reproduce

Using Node 10.15.3 and yarn 1.22.5:

```
yarn
yarn nuxt build
```

(See README in the reproduction repo.)

### What is Expected?

Build completes successfully. All generated filenames are valid.

### What is actually happening?

Build completes successfully, however one of the filenames is invalid: `pages/123456789_123456789_123456789_123456789_/pages/test1/test/pages/test2/pages/test2/index/pages//6c0ffc7c.c67c3ba.css`. Note the double slash near the end (`pages//6c0ffc7c.c67c3ba.css`).

This invalid filename goes to the manifest. When these static assets are deployed onto certain CDNs (such as Amazon S3 compatible storages), they wouldn't load, for example:

[schools//8be984b7.6b1ee97.css](https://hb.bizmrg.com/eg11-static/pages/user/_role/coverage/pages/user/_role/dashboard/pages/user/_role/operators/_operatorId/schools//8be984b7.6b1ee97.css) -> 403 Access Denied
[schools/8be984b7.6b1ee97.css](https://hb.bizmrg.com/eg11-static/pages/user/_role/coverage/pages/user/_role/dashboard/pages/user/_role/operators/_operatorId/schools/8be984b7.6b1ee97.css) -> 200 OK

Moreover, this broken chunk completely breaks `<nuxt-link>`'s pointing to the affected page! (Not included in the minimal reproduction, although it's not hard to add.)

### Additional context

This is a regression introduced with https://github.com/nuxt/nuxt.js/pull/7463 where the css/images/video URLs were changed to include `[name]`.

Also, the [documentation](https://github.com/nuxt/nuxtjs.org/blob/f36f50ca3555162a1a98933cb705f02ecff3214b/content/en/guides/configuration-glossary/configuration-build.md#filenames) misleadingly lists the old defaults:

```
css: ({ isDev }) => isDev ? '[name].css' : '[contenthash].css'
```

which is not true anymore.

Pull request:
fix(config): prevent invalid css filenames in webpack output
## Types of changes
- [x] Bug fix (a non-breaking change which fixes an issue)

## Description
It seems it is possible for `[name]` to include invalid filenames - such as `schools//8be984b7.6b1ee97.css`.

context:  #7463 
closes #8274, #8777

## Checklist:
- [x] My change requires a change to the documentation.
- [x] I have updated the documentation accordingly. https://github.com/nuxt/nuxtjs.org/pull/1233
- [x] All new and existing tests are passing.



Patch:
diff --git a/packages/config/src/config/build.js b/packages/config/src/config/build.js
index 40dfd96e8..f7f65160d 100644
--- a/packages/config/src/config/build.js
+++ b/packages/config/src/config/build.js
@@ -16,7 +16,7 @@ export default () => ({
     // { isDev, isClient, isServer }
     app: ({ isDev, isModern }) => isDev ? `[name]${isModern ? '.modern' : ''}.js` : `[contenthash:7]${isModern ? '.modern' : ''}.js`,
     chunk: ({ isDev, isModern }) => isDev ? `[name]${isModern ? '.modern' : ''}.js` : `[contenthash:7]${isModern ? '.modern' : ''}.js`,
-    css: ({ isDev }) => isDev ? '[name].css' : '[name].[contenthash:7].css',
+    css: ({ isDev }) => isDev ? '[name].css' : 'css/[contenthash:7].css',
     img: ({ isDev }) => isDev ? '[path][name].[ext]' : 'img/[name].[contenthash:7].[ext]',
     font: ({ isDev }) => isDev ? '[path][name].[ext]' : 'fonts/[name].[contenthash:7].[ext]',
     video: ({ isDev }) => isDev ? '[path][name].[ext]' : 'videos/[name].[contenthash:7].[ext]'


Test patch:
diff --git a/packages/config/test/config/build.test.js b/packages/config/test/config/build.test.js
index 26db389d7..161bbc897 100644
--- a/packages/config/test/config/build.test.js
+++ b/packages/config/test/config/build.test.js
@@ -17,7 +17,7 @@ describe('config: build', () => {
     const env = { isDev: false }
     expect(filenames.app(env)).toEqual('[contenthash:7].js')
     expect(filenames.chunk(env)).toEqual('[contenthash:7].js')
-    expect(filenames.css(env)).toEqual('[name].[contenthash:7].css')
+    expect(filenames.css(env)).toEqual('css/[contenthash:7].css')
     expect(filenames.img(env)).toEqual('img/[name].[contenthash:7].[ext]')
     expect(filenames.font(env)).toEqual('fonts/[name].[contenthash:7].[ext]')
     expect(filenames.video(env)).toEqual('videos/[name].[contenthash:7].[ext]')