Configuration

vue-pack uses JoyCon to load configuration file.

These is config files that will be loaded in vue-pack:

  • vue-pack.config.js
  • vue-pack.config.json
  • vue-pack.config.yaml
  • vue-pack.config.yml
  • vue-pack.config.ts

.yaml, .yml are loaded by joycon-yaml-loader
.ts is loaded by joycon-ts-loader

entry Required

Type: string

Entry file of your library.

libraryName Required

Type: string

Library name.

fileName

Type: string

Name of output bundled files (without extension).

TIP

If it isn't provided, vue-pack will generate file name from libraryName by slugify.

outDir

Type: string
Default: dist

Output directory of bundled files.

cleanOutDir

Type: boolean
Default: true

Clean output directory before bundling.

alias

Type: { [key: string]: string }

Alias to path

See webpack's resolve.alias.

TIP

vue-pack provides @ as alias to your ./src directory out of the box.

define

Type: { [key: string]: any }
Default: {}

Define global constants which can be configured at compile time by webpack's DefinePlugin.

TIP

Each value in define is stringified by default.

externals

Type: Externals
Default: { web: { vue: 'Vue' }, module: [nodeExternals()] }

Configure external dependencies for webpack.

See webpack's externals.

sourceMap

Type: boolean
Default: true

Enable generating source maps.

chainWebpack

Type: WebpackChainer

A function that provide all webpack-chain instances for customizing webpack configs.

noProfiler

Type: boolean
Default: false

Disable WebpackBar's profiler.

plugins

Type: Plugin[]

vue-pack's plugins.

dev

Type: DevOptions

Options for vue-pack's development server.