Skip to content

Commit 6d4e51d

Browse files
committed
feat: remove DLL option
BREAKING CHANGE: dll option has been removed.
1 parent ab0746e commit 6d4e51d

File tree

7 files changed

+99
-216
lines changed

7 files changed

+99
-216
lines changed

docs/cli-service.md

-28
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
- [build](#build)
77
- [Caching and Parallel Mode](#caching-and-parallel-mode)
88
- [Building as Library or Web Component](#building-as-library-or-web-component)
9-
- [DLL Mode](#dll-mode)
109
- [inspect](#inspect)
1110
- [Checking All Available Commands](#checking-all-available-commands)
1211

@@ -118,33 +117,6 @@ Options:
118117

119118
It is also possible to build any component(s) inside your project as a library or as web components. See [Build Targets](./build-targets.md) for more details.
120119

121-
#### DLL Mode
122-
123-
If your app has a large amount of dependency libraries, you can improve the build performance by opting into DLL mode. DLL mode builds your dependencies into a separate vendor bundle which will be reused on future builds as long as your dependencies did not change.
124-
125-
To enable DLL mode, set the `dll` option in `vue.config.js` to `true`:
126-
127-
``` js
128-
// vue.config.js
129-
module.exports = {
130-
dll: true
131-
}
132-
```
133-
134-
This by default builds **all the modules listed in the `dependencies` field in `package.json`** into the DLL bundle. It is important that you correctly list your dependencies, otherwise it may end up including unnecessary code.
135-
136-
If you wish to have finer grained control over what modules to be included in the DLL bundle, you can also provide an Array of modules to the `dll` option:
137-
138-
``` js
139-
// vue.config.js
140-
module.exports = {
141-
dll: [
142-
'dep-a',
143-
'dep-b/some/nested/file.js'
144-
]
145-
}
146-
```
147-
148120
### inspect
149121

150122
```

docs/config.md

+3-8
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ module.exports = {
3434
// performance.
3535
preserveWhitepsace: false,
3636

37+
// generate sourceMap for production build?
38+
productionSourceMap: true,
39+
3740
// tweak internal webpack configuration.
3841
// see https://github.com/vuejs/vue-cli/blob/dev/docs/webpack.md
3942
chainWebpack: () => {},
4043
configureWebpack: () => {},
4144

42-
// generate sourceMap for production build?
43-
productionSourceMap: true,
44-
4545
// CSS related options
4646
css: {
4747
// extract CSS in components into a single CSS file (only in production)
@@ -64,11 +64,6 @@ module.exports = {
6464
// enabled by default if the machine has more than 1 cores
6565
parallel: require('os').cpus().length > 1,
6666

67-
// split vendors using autoDLLPlugin?
68-
// can also be an explicit Array of dependencies to include in the DLL chunk.
69-
// See https://github.com/vuejs/vue-cli/blob/dev/docs/cli-service.md#dll-mode
70-
dll: false,
71-
7267
// options for the PWA plugin.
7368
// see https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-pwa
7469
pwa: {},

packages/@vue/cli-service/__tests__/buildDLL.spec.js

-62
This file was deleted.

packages/@vue/cli-service/lib/config/app.js

+36-69
Original file line numberDiff line numberDiff line change
@@ -67,47 +67,45 @@ module.exports = (api, options) => {
6767
// This needs to be updated when upgrading to webpack 4
6868
const CommonsChunkPlugin = require('webpack/lib/optimize/CommonsChunkPlugin')
6969

70-
if (!options.dll) {
71-
// extract vendor libs into its own chunk for better caching, since they
72-
// are more likely to stay the same.
73-
webpackConfig
74-
.plugin('split-vendor')
75-
.use(CommonsChunkPlugin, [{
76-
name: 'vendor',
77-
minChunks (module) {
78-
// any required modules inside node_modules are extracted to vendor
79-
return (
80-
module.resource &&
81-
/\.js$/.test(module.resource) &&
82-
module.resource.indexOf(`node_modules`) > -1
83-
)
84-
}
85-
}])
70+
// extract vendor libs into its own chunk for better caching, since they
71+
// are more likely to stay the same.
72+
webpackConfig
73+
.plugin('split-vendor')
74+
.use(CommonsChunkPlugin, [{
75+
name: 'vendor',
76+
minChunks (module) {
77+
// any required modules inside node_modules are extracted to vendor
78+
return (
79+
module.resource &&
80+
/\.js$/.test(module.resource) &&
81+
module.resource.indexOf(`node_modules`) > -1
82+
)
83+
}
84+
}])
8685

87-
// extract webpack runtime and module manifest to its own file in order to
88-
// prevent vendor hash from being updated whenever app bundle is updated
89-
webpackConfig
90-
.plugin('split-manifest')
91-
.use(CommonsChunkPlugin, [{
92-
name: 'manifest',
93-
minChunks: Infinity
94-
}])
86+
// extract webpack runtime and module manifest to its own file in order to
87+
// prevent vendor hash from being updated whenever app bundle is updated
88+
webpackConfig
89+
.plugin('split-manifest')
90+
.use(CommonsChunkPlugin, [{
91+
name: 'manifest',
92+
minChunks: Infinity
93+
}])
9594

96-
// inline the manifest chunk into HTML
97-
webpackConfig
98-
.plugin('inline-manifest')
99-
.use(require('../webpack/InlineSourcePlugin'), [{
100-
include: /manifest\..*\.js$/
101-
}])
95+
// inline the manifest chunk into HTML
96+
webpackConfig
97+
.plugin('inline-manifest')
98+
.use(require('../webpack/InlineSourcePlugin'), [{
99+
include: /manifest\..*\.js$/
100+
}])
102101

103-
// since manifest is inlined, don't preload it anymore
104-
webpackConfig
105-
.plugin('preload')
106-
.tap(([options]) => {
107-
options.fileBlacklist.push(/manifest\..*\.js$/)
108-
return [options]
109-
})
110-
}
102+
// since manifest is inlined, don't preload it anymore
103+
webpackConfig
104+
.plugin('preload')
105+
.tap(([options]) => {
106+
options.fileBlacklist.push(/manifest\..*\.js$/)
107+
return [options]
108+
})
111109

112110
// This CommonsChunkPlugin instance extracts shared chunks from async
113111
// chunks and bundles them in a separate chunk, similar to the vendor chunk
@@ -120,37 +118,6 @@ module.exports = (api, options) => {
120118
children: true,
121119
minChunks: 3
122120
}])
123-
124-
// DLL
125-
if (options.dll) {
126-
const webpack = require('webpack')
127-
const UglifyPlugin = require('uglifyjs-webpack-plugin')
128-
const getUglifyOptions = require('./uglifyOptions')
129-
const dllEntries = Array.isArray(options.dll)
130-
? options.dll
131-
: Object.keys(api.service.pkg.dependencies)
132-
133-
webpackConfig
134-
.plugin('dll')
135-
.use(require('autodll-webpack-plugin'), [{
136-
inject: true,
137-
inherit: true,
138-
path: 'js/',
139-
context: api.resolve('.'),
140-
filename: '[name].[hash:8].js',
141-
entry: {
142-
'vendor': [
143-
...dllEntries,
144-
'vue-loader/lib/component-normalizer'
145-
]
146-
},
147-
plugins: [
148-
new webpack.DefinePlugin(resolveClientEnv(options.baseUrl)),
149-
new UglifyPlugin(getUglifyOptions(options))
150-
]
151-
}])
152-
.after('preload')
153-
}
154121
}
155122
})
156123
}

packages/@vue/cli-service/lib/options.js

-8
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ const schema = createSchema(joi => joi.object({
99
productionSourceMap: joi.boolean(),
1010
parallel: joi.boolean(),
1111
devServer: joi.object(),
12-
dll: joi.alternatives().try(
13-
joi.boolean(),
14-
joi.array().items(joi.string())
15-
),
1612

1713
// css
1814
css: joi.object({
@@ -69,10 +65,6 @@ exports.defaults = () => ({
6965
// enabled by default if the machine has more than 1 cores
7066
parallel: require('os').cpus().length > 1,
7167

72-
// split vendors using autoDLLPlugin?
73-
// can be an explicit list of dependencies to include in the DLL chunk.
74-
dll: false,
75-
7668
css: {
7769
// extract: true,
7870
// modules: false,

packages/@vue/cli-service/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"@vue/cli-shared-utils": "^3.0.0-beta.9",
2626
"@vue/web-component-wrapper": "^1.2.0",
2727
"address": "^1.0.3",
28-
"autodll-webpack-plugin": "^0.3.9",
2928
"autoprefixer": "^8.3.0",
3029
"cache-loader": "^1.2.2",
3130
"case-sensitive-paths-webpack-plugin": "^2.1.2",

0 commit comments

Comments
 (0)