-
type:
Object
An object specifying Webpack loaders to use for language blocks inside
*.vue
files. The key corresponds to thelang
attribute for language blocks, if specified. The defaultlang
for each type is:<template>
:html
<script>
:js
<style>
:css
For example, to use
babel-loader
andeslint-loader
to process all<script>
blocks:// ... vue: { loaders: { js: 'babel!eslint' } }
-
type:
Boolean
-
default:
true
Whether to enable autoprefixer for CSS inside
*.vue
files.
-
type:
Array
orFunction
orObject
-
Object
format only supported in ^8.5.0Specify custom PostCSS plugins to be applied to CSS inside
*.vue
files. If using a function, the function will called using the same loader context and should return an Array of plugins.// ... vue: { // note: do not nest the `postcss` option under `loaders` postcss: [require('postcss-cssnext')()], autoprefixer: false, loaders: { // ... } }
This option can also be an object that contains options to be passed to the PostCSS processor. This is useful when you are using PostCSS projects that relies on custom parser/stringifiers:
postcss: { plugins: [...], // list of plugins options: { parser: sugarss // use sugarss parser } }
-
type:
Boolean
-
default:
true
Whether to enable source maps for CSS. Disabling this can avoid some relative path related bugs in
css-loader
and make the build a bit faster.Note this is automatically set to
false
if thedevtool
option is not present in the main Webpack config.
-
^8.4.0
-
type:
Object
Pass options to the template rendering engine (via consolidate) if you are using a non-html templating language.
-
^9.4.3
-
type:
Boolean
-
default:
undefined
Whether to emit esModule compatible code. By default vue-loader will emit default export in commonjs format like
module.exports = ....
. WhenesModule
is set to true, default export will be transpiled intoexports.__esModule = true; exports = ...
. Useful for interoperating with transpiler other than Bable, like TypeScript.