Skip to content

Commit

Permalink
feat: update to node-resolve v11
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsDenBakker committed Dec 20, 2020
1 parent d18322b commit 0c05c0f
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 58 deletions.
7 changes: 7 additions & 0 deletions .changeset/green-ligers-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@web/dev-server': minor
'@web/dev-server-storybook': minor
'@web/test-runner': minor
---

update to node-resolve v11
5 changes: 5 additions & 0 deletions .changeset/polite-planes-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'rollup-plugin-workbox': minor
---

update to node-resolve v11
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
"devDependencies": {
"@changesets/cli": "^2.12.0",
"@rollup/plugin-node-resolve": "^10.0.0",
"@rollup/plugin-node-resolve": "^11.0.1",
"@rollup/plugin-typescript": "^8.1.0",
"@types/chai": "^4.2.14",
"@types/mocha": "^8.0.01",
Expand Down
2 changes: 1 addition & 1 deletion packages/dev-server-rollup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@rollup/plugin-alias": "^3.1.1",
"@rollup/plugin-babel": "^5.2.2",
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-node-resolve": "^10.0.0",
"@rollup/plugin-node-resolve": "^11.0.1",
"@rollup/plugin-replace": "^2.3.4",
"@types/parse5": "^5.0.3",
"@types/whatwg-url": "^8.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/dev-server-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@babel/preset-env": "^7.12.11",
"@mdx-js/mdx": "^1.6.22",
"@rollup/plugin-babel": "^5.2.2",
"@rollup/plugin-node-resolve": "^10.0.0",
"@rollup/plugin-node-resolve": "^11.0.1",
"@web/dev-server-core": "^0.2.19",
"@web/rollup-plugin-html": "^1.3.2",
"@web/rollup-plugin-polyfills-loader": "^1.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ export function createRollupConfig(params: CreateRollupConfigParams): RollupOpti
},
plugins: [
resolve({
customResolveOptions: {
moduleDirectory: ['node_modules', 'web_modules'],
},
moduleDirectories: ['node_modules', 'web_modules'],
}),
babel({
babelHelpers: 'bundled',
Expand Down
2 changes: 1 addition & 1 deletion packages/dev-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
],
"dependencies": {
"@babel/code-frame": "^7.12.11",
"@rollup/plugin-node-resolve": "^10.0.0",
"@rollup/plugin-node-resolve": "^11.0.1",
"@types/command-line-args": "^5.0.0",
"@web/config-loader": "^0.1.1",
"@web/dev-server-core": "^0.2.19",
Expand Down
4 changes: 1 addition & 3 deletions packages/dev-server/src/plugins/nodeResolvePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ export function nodeResolvePlugin(
{
rootDir,
extensions: ['.mjs', '.js', '.cjs', '.jsx', '.json', '.ts', '.tsx'],
customResolveOptions: {
moduleDirectory: ['node_modules', 'web_modules'],
},
moduleDirectories: ['node_modules', 'web_modules'],
// allow resolving polyfills for nodejs libs
preferBuiltins: false,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/rollup-plugin-workbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"workbox"
],
"dependencies": {
"@rollup/plugin-node-resolve": "^10.0.0",
"@rollup/plugin-node-resolve": "^11.0.1",
"@rollup/plugin-replace": "^2.3.4",
"pretty-bytes": "^5.4.1",
"rollup-plugin-terser": "^7.0.2",
Expand Down
24 changes: 24 additions & 0 deletions packages/test-runner/src/nodeResolvePlugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { fromRollup } from '@web/dev-server-rollup';
import rollupNodeResolve, { RollupNodeResolveOptions } from '@rollup/plugin-node-resolve';
import deepmerge from 'deepmerge';

export function nodeResolvePlugin(
rootDir: string,
preserveSymlinks?: boolean,
userOptions?: RollupNodeResolveOptions,
) {
const nodeResolve = fromRollup(rollupNodeResolve, { preserveSymlinks });
const userOptionsObject = typeof userOptions === 'object' ? userOptions : {};
const options: RollupNodeResolveOptions = deepmerge(
{
rootDir,
extensions: ['.mjs', '.js', '.cjs', '.jsx', '.json', '.ts', '.tsx'],
moduleDirectories: ['node_modules', 'web_modules'],
// allow resolving polyfills for nodejs libs
preferBuiltins: false,
},
userOptionsObject,
);

return nodeResolve(options);
}
56 changes: 9 additions & 47 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1633,41 +1633,17 @@
magic-string "^0.25.7"
resolve "^1.17.0"

"@rollup/plugin-image@^2.0.6":
version "2.0.6"
resolved "https://registry.yarnpkg.com/@rollup/plugin-image/-/plugin-image-2.0.6.tgz#2e6d7a72b25df81aa80c8c0866d45a45c1e6a265"
integrity sha512-bB+spXogbPiFjhBS7i8ajUOgOnVwWK3bnJ6VroxKey/q8/EPRkoSh+4O1qPCw97qMIDspF4TlzXVBhZ7nojIPw==
dependencies:
"@rollup/pluginutils" "^3.1.0"
mini-svg-data-uri "^1.2.3"

"@rollup/plugin-inject@^4.0.2":
version "4.0.2"
resolved "https://registry.yarnpkg.com/@rollup/plugin-inject/-/plugin-inject-4.0.2.tgz#55b21bb244a07675f7fdde577db929c82fc17395"
integrity sha512-TSLMA8waJ7Dmgmoc8JfPnwUwVZgLjjIAM6MqeIFqPO2ODK36JqE0Cf2F54UTgCUuW8da93Mvoj75a6KAVWgylw==
dependencies:
"@rollup/pluginutils" "^3.0.4"
estree-walker "^1.0.1"
magic-string "^0.25.5"

"@rollup/plugin-json@^4.1.0":
version "4.1.0"
resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-4.1.0.tgz#54e09867ae6963c593844d8bd7a9c718294496f3"
integrity sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==
dependencies:
"@rollup/pluginutils" "^3.0.8"

"@rollup/plugin-node-resolve@^10.0.0":
version "10.0.0"
resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-10.0.0.tgz#44064a2b98df7530e66acf8941ff262fc9b4ead8"
integrity sha512-sNijGta8fqzwA1VwUEtTvWCx2E7qC70NMsDh4ZG13byAXYigBNZMxALhKUSycBks5gupJdq0lFrKumFrRZ8H3A==
"@rollup/plugin-node-resolve@^11.0.1":
version "11.0.1"
resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.0.1.tgz#d3765eec4bccf960801439a999382aed2dca959b"
integrity sha512-ltlsj/4Bhwwhb+Nb5xCz/6vieuEj2/BAkkqVIKmZwC7pIdl8srmgmglE4S0jFlZa32K4qvdQ6NHdmpRKD/LwoQ==
dependencies:
"@rollup/pluginutils" "^3.1.0"
"@types/resolve" "1.17.1"
builtin-modules "^3.1.0"
deepmerge "^4.2.2"
is-module "^1.0.0"
resolve "^1.17.0"
resolve "^1.19.0"

"@rollup/plugin-node-resolve@^7.1.1":
version "7.1.3"
Expand Down Expand Up @@ -1721,16 +1697,7 @@
"@rollup/pluginutils" "^3.1.0"
resolve "^1.17.0"

"@rollup/plugin-url@^6.0.0":
version "6.0.0"
resolved "https://registry.yarnpkg.com/@rollup/plugin-url/-/plugin-url-6.0.0.tgz#20fbc8cda9bc5f0c31d7225f633002ce73e920b0"
integrity sha512-UHGyoo3EbLufCZtXon/baNf75PAYT+Gs/NUgFMx2ZaDQ314PKNP0pJTrpbhDqFkZADzpkqJWyQOfJ2Nd6Qk4TA==
dependencies:
"@rollup/pluginutils" "^3.1.0"
make-dir "^3.1.0"
mime "^2.4.6"

"@rollup/pluginutils@^3.0.4", "@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.1.0":
"@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b"
integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==
Expand Down Expand Up @@ -7713,7 +7680,7 @@ luxon@^1.24.1:
resolved "https://registry.yarnpkg.com/luxon/-/luxon-1.25.0.tgz#d86219e90bc0102c0eb299d65b2f5e95efe1fe72"
integrity sha512-hEgLurSH8kQRjY6i4YLey+mcKVAWXbDNlZRmM6AgWDJ1cY3atl8Ztf5wEY7VBReFbmGnwQPz7KYJblL8B2k0jQ==

magic-string@^0.25.0, magic-string@^0.25.5, magic-string@^0.25.7:
magic-string@^0.25.0, magic-string@^0.25.7:
version "0.25.7"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051"
integrity sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==
Expand All @@ -7727,7 +7694,7 @@ make-dir@^1.0.0, make-dir@^1.2.0:
dependencies:
pify "^3.0.0"

make-dir@^3.0.0, make-dir@^3.1.0:
make-dir@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f"
integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==
Expand Down Expand Up @@ -8017,11 +7984,6 @@ min-indent@^1.0.0:
resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869"
integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==

mini-svg-data-uri@^1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/mini-svg-data-uri/-/mini-svg-data-uri-1.2.3.tgz#e16baa92ad55ddaa1c2c135759129f41910bc39f"
integrity sha512-zd6KCAyXgmq6FV1mR10oKXYtvmA9vRoB6xPSTUJTbFApCtkefDnYueVR1gkof3KcdLZo1Y8mjF2DFmQMIxsHNQ==

minimalistic-assert@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7"
Expand Down Expand Up @@ -10393,7 +10355,7 @@ resolve-path@^1.4.0:
http-errors "~1.6.2"
path-is-absolute "1.0.1"

resolve@^1.1.6, resolve@^1.10.0, resolve@^1.11.1, resolve@^1.14.2, resolve@^1.16.1, resolve@^1.17.0, resolve@^1.3.2:
resolve@^1.1.6, resolve@^1.10.0, resolve@^1.11.1, resolve@^1.14.2, resolve@^1.16.1, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.3.2:
version "1.19.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.19.0.tgz#1af5bf630409734a067cae29318aac7fa29a267c"
integrity sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==
Expand Down

0 comments on commit 0c05c0f

Please sign in to comment.