diff --git a/ember-cli-build.js b/ember-cli-build.js index 775584f..3521529 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -2,6 +2,7 @@ const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); const { maybeEmbroider } = require('@embroider/test-setup'); +const { ProvidePlugin } = require('webpack'); /** * `EMBROIDER_TEST_SETUP_OPTIONS` is set by the Embroider scenarios for `ember-try`: @@ -34,10 +35,16 @@ module.exports = function (defaults) { node: { global: true, }, + plugins: [ + new ProvidePlugin({ + process: 'process/browser', + }), + ], resolve: { fallback: { // `stream-browserify` is added for the Embroider tests, see `config/ember-try.js`. - stream: require.resolve('stream-browserify') // eslint-disable-line + stream: require.resolve('stream-browserify'), + util: require.resolve('util/') }, }, }, diff --git a/index.js b/index.js index f79d121..2415ce7 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,7 @@ 'use strict'; +const { ProvidePlugin } = require('webpack'); + module.exports = { name: require('./package').name, options: { @@ -8,9 +10,15 @@ module.exports = { node: { global: true, }, + plugins: [ + new ProvidePlugin({ + process: 'process/browser', + }), + ], resolve: { fallback: { stream: require.resolve('stream-browserify'), + util: require.resolve('util/'), }, }, }, diff --git a/package.json b/package.json index 24d5798..26e2423 100644 --- a/package.json +++ b/package.json @@ -46,8 +46,11 @@ "ember-cli-babel": "^7.26.11", "ember-cli-htmlbars": "^6.2.0", "humanize-duration": "^3.27.0", + "process": "^0.11.10", "reading-time": "^1.5.0", - "stream-browserify": "^3.0.0" + "stream-browserify": "^3.0.0", + "util": "^0.12.5", + "webpack": "^5.75.0" }, "devDependencies": { "@babel/core": "^7.18.2", @@ -81,8 +84,7 @@ "loader.js": "^4.7.0", "prettier": "^2.8.3", "qunit": "^2.19.3", - "qunit-dom": "^2.0.0", - "webpack": "^5.75.0" + "qunit-dom": "^2.0.0" }, "peerDependencies": { "ember-source": "^3.28.0 || ^4.0.0" diff --git a/yarn.lock b/yarn.lock index f22db89..e1926d9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5810,7 +5810,7 @@ is-accessor-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" -is-arguments@^1.1.1: +is-arguments@^1.0.4, is-arguments@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== @@ -5930,6 +5930,13 @@ is-fullwidth-code-point@^3.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== +is-generator-function@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.10.tgz#f1558baf1ac17e0deea7c0415c438351ff2b3c72" + integrity sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A== + dependencies: + has-tostringtag "^1.0.0" + is-git-url@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-git-url/-/is-git-url-1.0.0.tgz#53f684cd143285b52c3244b4e6f28253527af66b" @@ -6056,7 +6063,7 @@ is-type@0.0.1: dependencies: core-util-is "~1.0.0" -is-typed-array@^1.1.10, is-typed-array@^1.1.9: +is-typed-array@^1.1.10, is-typed-array@^1.1.3, is-typed-array@^1.1.9: version "1.1.10" resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.10.tgz#36a5b5cb4189b575d1a3e4b08536bfb485801e3f" integrity sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A== @@ -7674,6 +7681,11 @@ process-relative-require@^1.0.0: dependencies: node-modules-path "^1.0.0" +process@^0.11.10: + version "0.11.10" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== + promise-map-series@^0.2.1: version "0.2.3" resolved "https://registry.yarnpkg.com/promise-map-series/-/promise-map-series-0.2.3.tgz#c2d377afc93253f6bd03dbb77755eb88ab20a847" @@ -9257,6 +9269,17 @@ util-deprecate@^1.0.1, util-deprecate@^1.0.2: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== +util@^0.12.5: + version "0.12.5" + resolved "https://registry.yarnpkg.com/util/-/util-0.12.5.tgz#5f17a6059b73db61a875668781a1c2b136bd6fbc" + integrity sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA== + dependencies: + inherits "^2.0.3" + is-arguments "^1.0.4" + is-generator-function "^1.0.7" + is-typed-array "^1.1.3" + which-typed-array "^1.1.2" + utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" @@ -9459,7 +9482,7 @@ which-collection@^1.0.1: is-weakmap "^2.0.1" is-weakset "^2.0.1" -which-typed-array@^1.1.9: +which-typed-array@^1.1.2, which-typed-array@^1.1.9: version "1.1.9" resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.9.tgz#307cf898025848cf995e795e8423c7f337efbde6" integrity sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==