Skip to content

chore!: some trivial dependency major version updates #5951

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Oct 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/migrations/migrate-from-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ If you want to migrate manually and gradually, you can run `vue upgrade <the-plu

### The `vue` Command (The Global `@vue/cli` Package)

### `@vue/cli-service`

Updated several underlying loaders and plugins:

* Updated `copy-webpack-plugin` from v5 to v6. If you never customized its config through `config.plugin('copy')`, there should be no user-facing breaking changes. A full list of breaking changes is available at <https://github.com/webpack-contrib/copy-webpack-plugin/releases/tag/v6.0.0>.
* Updated `file-loader` from v4 to v6, and `url-loader` from v2 to v4. The `esModule` option is now turned on by default for non-Vue-2 projects. Full changelog available at <https://github.com/webpack-contrib/file-loader/blob/master/CHANGELOG.md> and <https://github.com/webpack-contrib/url-loader/blob/master/CHANGELOG.md>
* Updated `terser-webpack-plugin` from v2 to v4, using terser 5 and some there are some changes in the options format. Full changelog at <https://github.com/webpack-contrib/terser-webpack-plugin/blob/master/CHANGELOG.md>

### ESLint Plugin

* `eslint-loader` is upgraded [from v2 to v4](https://github.com/webpack-contrib/eslint-loader/blob/master/CHANGELOG.md). The only major change is that it dropped support for ESLint < v6.
Expand All @@ -48,6 +56,7 @@ If you want to migrate manually and gradually, you can run `vue upgrade <the-plu

* Dropped TSLint support. As [TSLint has been deprecated](https://github.com/palantir/tslint/issues/4534), we [removed](https://github.com/vuejs/vue-cli/pull/5065) all TSLint-related code in this version.
Please consider switching to ESLint. You can check out [`tslint-to-eslint-config`](https://github.com/typescript-eslint/tslint-to-eslint-config) for a mostly automatic migration experience.
* Updated `ts-loader` from v6 to v8. It now only supports TypeScript >= 3.6.
* Updated `fork-ts-checker-webpack-plugin` from v3.x to v5.x, you can see the detailed breaking changes at <https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/releases/tag/v4.0.0> and <https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/releases/tag/v5.0.0>

### E2E-Cypress Plugin
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli-plugin-babel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@vue/cli-shared-utils": "^4.5.7",
"babel-loader": "^8.1.0",
"cache-loader": "^4.1.0",
"thread-loader": "^2.1.3",
"thread-loader": "^3.0.0",
"webpack": "^4.0.0"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/@vue/cli-plugin-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"cache-loader": "^4.1.0",
"fork-ts-checker-webpack-plugin": "^5.0.11",
"globby": "^9.2.0",
"thread-loader": "^2.1.3",
"ts-loader": "^6.2.2",
"thread-loader": "^3.0.0",
"ts-loader": "^8.0.5",
"webpack": "^4.0.0",
"yorkie": "^2.0.0"
},
Expand Down
28 changes: 13 additions & 15 deletions packages/@vue/cli-service/lib/config/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,15 @@ module.exports = (api, options) => {
const multiPageConfig = options.pages
const htmlPath = api.resolve('public/index.html')
const defaultHtmlPath = path.resolve(__dirname, 'index-default.html')
const publicCopyIgnore = ['.DS_Store']
const publicCopyIgnore = ['**/.DS_Store']

if (!multiPageConfig) {
// default, single page setup.
htmlOptions.template = fs.existsSync(htmlPath)
? htmlPath
: defaultHtmlPath

publicCopyIgnore.push({
glob: path.relative(api.resolve('public'), api.resolve(htmlOptions.template)),
matchBase: false
})
publicCopyIgnore.push(api.resolve(htmlOptions.template).replace(/\\/g, '/'))

webpackConfig
.plugin('html')
Expand Down Expand Up @@ -225,10 +222,7 @@ module.exports = (api, options) => {
? htmlPath
: defaultHtmlPath

publicCopyIgnore.push({
glob: path.relative(api.resolve('public'), api.resolve(templatePath)),
matchBase: false
})
publicCopyIgnore.push(api.resolve(templatePath).replace(/\\/g, '/'))

// inject html plugin for the page
const pageHtmlOptions = Object.assign(
Expand Down Expand Up @@ -295,12 +289,16 @@ module.exports = (api, options) => {
if (!isLegacyBundle && fs.existsSync(publicDir)) {
webpackConfig
.plugin('copy')
.use(require('copy-webpack-plugin'), [[{
from: publicDir,
to: outputDir,
toType: 'dir',
ignore: publicCopyIgnore
}]])
.use(require('copy-webpack-plugin'), [{
patterns: [{
from: publicDir,
to: outputDir,
toType: 'dir',
globOptions: {
ignore: publicCopyIgnore
}
}]
}])
}
})
}
19 changes: 13 additions & 6 deletions packages/@vue/cli-service/lib/config/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,24 @@ module.exports = (api, options) => {
)
}

// try to load vue in the project
// fallback to peer vue package in the instant prototyping environment
const vue = loadModule('vue', api.service.context) || loadModule('vue', __dirname)
let supportsEsModuleAsset = true
if (vue && semver.major(vue.version) === 2) {
supportsEsModuleAsset = false
}

const genUrlLoaderOptions = dir => {
return {
limit: inlineLimit,
esModule: supportsEsModuleAsset,
// use explicit fallback to avoid regression in url-loader>=1.1.0
fallback: {
loader: require.resolve('file-loader'),
options: {
name: genAssetSubPath(dir)
name: genAssetSubPath(dir),
esModule: supportsEsModuleAsset
}
}
}
Expand Down Expand Up @@ -69,10 +79,6 @@ module.exports = (api, options) => {
// js is handled by cli-plugin-babel ---------------------------------------

// vue-loader --------------------------------------------------------------
// try to load vue in the project
// fallback to peer vue package in the instant prototyping environment
const vue = loadModule('vue', api.service.context) || loadModule('vue', __dirname)

if (vue && semver.major(vue.version) === 2) {
// for Vue 2 projects
const vueLoaderCacheConfig = api.genCacheConfig('vue-loader', {
Expand Down Expand Up @@ -170,7 +176,8 @@ module.exports = (api, options) => {
.use('file-loader')
.loader(require.resolve('file-loader'))
.options({
name: genAssetSubPath('img')
name: genAssetSubPath('img'),
esModule: supportsEsModuleAsset
})

webpackConfig.module
Expand Down
8 changes: 4 additions & 4 deletions packages/@vue/cli-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@
"cli-highlight": "^2.1.4",
"clipboardy": "^2.3.0",
"cliui": "^6.0.0",
"copy-webpack-plugin": "^5.1.1",
"copy-webpack-plugin": "^6.2.1",
"css-loader": "^3.5.3",
"cssnano": "^4.1.10",
"debug": "^4.1.1",
"default-gateway": "^6.0.2",
"dotenv": "^8.2.0",
"dotenv-expand": "^5.1.0",
"file-loader": "^4.2.0",
"file-loader": "^6.1.1",
"fs-extra": "^7.0.1",
"globby": "^9.2.0",
"hash-sum": "^2.0.0",
Expand All @@ -68,8 +68,8 @@
"portfinder": "^1.0.26",
"postcss-loader": "^3.0.0",
"ssri": "^8.0.0",
"terser-webpack-plugin": "^2.3.6",
"thread-loader": "^2.1.3",
"terser-webpack-plugin": "^4.2.3",
"thread-loader": "^3.0.0",
"url-loader": "^2.2.0",
"vue-loader": "^15.9.2",
"vue-style-loader": "^4.1.2",
Expand Down
Loading