From d7078aa1068d6082160fa85fed6b18bd809abc66 Mon Sep 17 00:00:00 2001 From: Nicolas Martel Date: Mon, 4 Oct 2021 09:45:38 -0400 Subject: [PATCH] fix: use @gem-mine/webpack-chain --- packages/neutrino/Neutrino.js | 2 +- packages/neutrino/package.json | 2 +- packages/vue/test/vue_test.js | 5 +++-- packages/web/index.js | 2 +- yarn.lock | 16 ++++++++-------- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/packages/neutrino/Neutrino.js b/packages/neutrino/Neutrino.js index 3c9fe9513..d834dc51b 100644 --- a/packages/neutrino/Neutrino.js +++ b/packages/neutrino/Neutrino.js @@ -1,5 +1,5 @@ const clone = require('lodash.clonedeep'); -const Config = require('webpack-chain'); +const Config = require('@gem-mine/webpack-chain'); const semver = require('semver'); const { isAbsolute, join } = require('path'); const { ConfigurationError } = require('./errors'); diff --git a/packages/neutrino/package.json b/packages/neutrino/package.json index 978df5385..322fe58b9 100644 --- a/packages/neutrino/package.json +++ b/packages/neutrino/package.json @@ -29,9 +29,9 @@ "yarn": ">=1.2.1" }, "dependencies": { + "@gem-mine/webpack-chain": "^7.1.0", "lodash.clonedeep": "^4.5.0", "semver": "^7.3.4", - "webpack-chain": "^6.5.1", "yargs-parser": "^20.2.4" } } diff --git a/packages/vue/test/vue_test.js b/packages/vue/test/vue_test.js index 60faf6258..370c12a83 100644 --- a/packages/vue/test/vue_test.js +++ b/packages/vue/test/vue_test.js @@ -80,8 +80,9 @@ test('adds style oneOfs in order', (t) => { const api = new Neutrino(); api.use(mw()); const { oneOfs } = api.config.module.rule('style'); + t.deepEqual( - oneOfs.values().map((oneOf) => oneOf.name), + oneOfs.values().map((oneOf) => oneOf.ruleName), ['vue-modules', 'vue-normal', 'modules', 'normal'], ); }); @@ -94,7 +95,7 @@ test('replaces style-loader with vue-style-loader in development', (t) => { api.config.module .rule('style') .oneOfs.values() - .filter((oneOf) => oneOf.name.startsWith('vue-')) + .filter((oneOf) => oneOf.ruleName.startsWith('vue-')) .forEach((oneOf) => { t.is( oneOf.use('style').get('loader'), diff --git a/packages/web/index.js b/packages/web/index.js index 026ba1fcf..aebc12838 100644 --- a/packages/web/index.js +++ b/packages/web/index.js @@ -112,7 +112,7 @@ module.exports = } // Force @babel/preset-env default behavior (.browserslistrc) - if (options.targets === false) { + if (!options.targets) { options.targets = {}; } else if (!options.targets.node && !options.targets.browsers) { options.targets.browsers = [ diff --git a/yarn.lock b/yarn.lock index bda253d66..e4c4e782d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1158,6 +1158,14 @@ unique-filename "^1.1.1" which "^1.3.1" +"@gem-mine/webpack-chain@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@gem-mine/webpack-chain/-/webpack-chain-7.1.0.tgz#e979459afed6298179bb16a68b076fd8a636a9aa" + integrity sha512-Jd/AdB9PsF6w2Ket58FUK7YfV00uMCOkQYCgG67IxuhHfzfJRWZp68omJa/wksvA2yngnxpDLvpwIK6liDGBeQ== + dependencies: + deepmerge "^1.5.2" + javascript-stringify "^2.0.1" + "@humanwhocodes/config-array@^0.5.0": version "0.5.0" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" @@ -14766,14 +14774,6 @@ webidl-conversions@^6.1.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== -webpack-chain@^6.5.1: - version "6.5.1" - resolved "https://registry.yarnpkg.com/webpack-chain/-/webpack-chain-6.5.1.tgz#4f27284cbbb637e3c8fbdef43eef588d4d861206" - integrity sha512-7doO/SRtLu8q5WM0s7vPKPWX580qhi0/yBHkOxNkv50f6qB76Zy9o2wRTrrPULqYTvQlVHuvbA8v+G5ayuUDsA== - dependencies: - deepmerge "^1.5.2" - javascript-stringify "^2.0.1" - webpack-cli@^4.7.0: version "4.8.0" resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.8.0.tgz#5fc3c8b9401d3c8a43e2afceacfa8261962338d1"