Skip to content

Commit b6114d4

Browse files
author
Guillaume Chau
committed
chore: merge dev
2 parents 74bc221 + 396b92f commit b6114d4

File tree

23 files changed

+832
-475
lines changed

23 files changed

+832
-475
lines changed

docs/css.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,23 @@ Vue CLI uses PostCSS internally, and enables [autoprefixer](https://github.com/p
1313

1414
You can [use CSS Modules in `*.vue` files](https://vue-loader.vuejs.org/en/features/css-modules.html) out of the box with `<style module>`.
1515

16-
If you wish to import style files as CSS Modules in JavaScript, you can import a file with a `?module` resourceQuery:
16+
To import CSS or other pre-processor files as CSS Modules in JavaScript, the filename should end with `.module.(css|less|sass|scss|styl)`:
17+
18+
``` js
19+
import styles from './foo.module.css'
20+
// works for all supported pre-processors as well
21+
import sassStyles from './foo.module.scss'
22+
```
23+
24+
Alternatively, you can import a file explicitly with a `?module` resourceQuery so that you can drop the `.module` in the filename:
1725

1826
``` js
1927
import styles from './foo.css?module'
2028
// works for all supported pre-processors as well
2129
import sassStyles from './foo.scss?module'
2230
```
2331

24-
If you wish to customize the CSS modules class name output you can set the `css.localIdentName` option in `vue.config.js`.
32+
If you wish to customize the generated CSS modules class names, you can do so via the `css.localIdentName` option in `vue.config.js`.
2533

2634
### Pre-Processors
2735

@@ -57,3 +65,5 @@ module.exports = {
5765
}
5866
}
5967
```
68+
69+
This is preferred over manually tapping into specific loaders, because these options will be shared across all rules that are related to it.

package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,15 @@
5151
"jest": "^22.1.4",
5252
"lerna": "^2.8.0",
5353
"lint-staged": "^6.0.1",
54-
"memfs": "^2.6.0",
54+
"memfs": "^2.8.0",
5555
"puppeteer": "^1.0.0",
5656
"request": "^2.83.0",
5757
"request-promise-native": "^1.0.5",
5858
"rimraf": "^2.6.2",
5959
"yorkie": "^1.0.2"
60+
},
61+
"resolutions": {
62+
"fs-monkey": "0.3.1",
63+
"babel-core": "7.0.0-bridge.0"
6064
}
6165
}

packages/@vue/cli-plugin-babel/index.js

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// hack babel's codegen to fix source map.
2+
// this is a temporary patch before the actual change is released.
3+
// TODO remove after upgrading Babel to 7.0.0-beta.47
4+
require('./patchBabel')
5+
16
module.exports = (api, {
27
parallel,
38
transpileDependencies

0 commit comments

Comments
 (0)