Skip to content

Commit

Permalink
we can import fs/promises since it's only used in a node environmen…
Browse files Browse the repository at this point in the history
…t. (#1062)
  • Loading branch information
Janther authored Nov 14, 2024
1 parent 7641856 commit 7e34f9e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default {
optimization: { minimize: false },
target: ['browserslist'],

externals: { 'fs/promises': 'fs/promises' },
externals: { 'fs/promises': 'import fs/promises' },

experiments: {
asyncWebAssembly: true,
Expand Down
1 change: 0 additions & 1 deletion tests/config/get-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ if (process.env.TEST_STANDALONE) {
? self
: this || {};
root.prettier = await getPrettier();
root["fs/promises"] = await import("fs/promises");
}

function getPluginsInternal() {
Expand Down
5 changes: 2 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ export default (webpackEnv) => {
entry: './src/index.js',

// Avoid bundling Prettier
externalsType: 'global',
externals: {
prettier: 'prettier',
'fs/promises': 'fs/promises'
prettier: 'global prettier',
'fs/promises': 'import fs/promises'
},

plugins: [
Expand Down

0 comments on commit 7e34f9e

Please sign in to comment.